Class SoftwareVertexProperty

java.lang.Object
gov.nih.mipav.view.renderer.J3D.SoftwareVertexProperty

public class SoftwareVertexProperty extends Object
This class maintains the following properties for a vertex.

- position (required) - normal (required) - diffuse (optional) - specular (optional)

The optional properties are specified by setting their references to null. In this case, the value will be determined from the SoftwareMaterial reference that is specified.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private javax.vecmath.Color3f
    DOCUMENT ME!
    private javax.vecmath.Vector3f
    DOCUMENT ME!
    private javax.vecmath.Point3f
    By default, vertex diffuse and specular colors are optional.
    private javax.vecmath.Color3f
    DOCUMENT ME!
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    enableDiffuse(boolean bEnable)
    Enable/disable the optional diffuse color vertex property.
    final void
    enableSpecular(boolean bEnable)
    Enable/disable the optional specular color vertex property.
    final javax.vecmath.Color3f
    Query current optional diffuse color for vertex.
    final javax.vecmath.Vector3f
    Query current normal vector for vertex.
    final javax.vecmath.Point3f
    Query current position of vertex.
    final javax.vecmath.Color3f
    Query current optional specular color for vertex.
    final boolean
    Query if the vertex diffuse color property is enabled.
    final boolean
    Query if the vertex specular color property is enabled.
    final void
    setDiffuse(float fR, float fG, float fB)
    Set the diffuse color for the vertex.
    final void
    setDiffuse(javax.vecmath.Color3f kDiffuse)
    Set the diffuse color for the vertex.
    final void
    setNormal(float fX, float fY, float fZ)
    Set the normal vector for the vertex.
    final void
    setNormal(javax.vecmath.Vector3f kNormal)
    Set the normal vector for the vertex.
    final void
    setPosition(float fX, float fY, float fZ)
    Set the position of the vertex.
    final void
    setPosition(javax.vecmath.Point3f kPosition)
    Set the position of the vertex.
    final void
    setSpecular(float fR, float fG, float fB)
    Set the specular color for the vertex.
    final void
    setSpecular(javax.vecmath.Color3f kSpecular)
    Set the specular color for the vertex.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_kDiffuse

      private javax.vecmath.Color3f m_kDiffuse
      DOCUMENT ME!
    • m_kNormal

      private javax.vecmath.Vector3f m_kNormal
      DOCUMENT ME!
    • m_kPosition

      private javax.vecmath.Point3f m_kPosition
      By default, vertex diffuse and specular colors are optional.
    • m_kSpecular

      private javax.vecmath.Color3f m_kSpecular
      DOCUMENT ME!
  • Constructor Details

    • SoftwareVertexProperty

      public SoftwareVertexProperty()
      Default constructor. Default vertex properties.
  • Method Details

    • enableDiffuse

      public final void enableDiffuse(boolean bEnable)
      Enable/disable the optional diffuse color vertex property. Must call this method to enable the property before calling the setDiffuse method to change its value. If enabling the property, the default color is set to white.
      Parameters:
      bEnable - boolean True to enable; false to disable.
    • enableSpecular

      public final void enableSpecular(boolean bEnable)
      Enable/disable the optional specular color vertex property. Must call this method to enable the property before calling the setSpecular method to change its value. If enabling the property, the default color is set to white.
      Parameters:
      bEnable - boolean True to enable; false to disable.
    • getDiffuse

      public final javax.vecmath.Color3f getDiffuse()
      Query current optional diffuse color for vertex. Can also be used to determine if this property is enabled.
      Returns:
      Color3f Non-null reference to vertex diffuse color if it is defined.
    • getNormal

      public final javax.vecmath.Vector3f getNormal()
      Query current normal vector for vertex.
      Returns:
      Vector3f Non-null reference to vertex normal.
    • getPosition

      public final javax.vecmath.Point3f getPosition()
      Query current position of vertex.
      Returns:
      Point3f Non-null reference to vertex position.
    • getSpecular

      public final javax.vecmath.Color3f getSpecular()
      Query current optional specular color for vertex. Can also be used to determine if this property is enabled.
      Returns:
      Color3f Non-null reference to vertex specular color if it is defined.
    • isEnabledDiffuse

      public final boolean isEnabledDiffuse()
      Query if the vertex diffuse color property is enabled.
      Returns:
      boolean True if enabled.
    • isEnabledSpecular

      public final boolean isEnabledSpecular()
      Query if the vertex specular color property is enabled.
      Returns:
      boolean True if enabled.
    • setDiffuse

      public final void setDiffuse(javax.vecmath.Color3f kDiffuse)
      Set the diffuse color for the vertex. The vertex diffuse color property must be enabled.
      Parameters:
      kDiffuse - Color3f Diffuse color for the vertex.
    • setDiffuse

      public final void setDiffuse(float fR, float fG, float fB)
      Set the diffuse color for the vertex.
      Parameters:
      fR - float Red channel of vertex diffuse color.
      fG - float Green channel of vertex diffuse color.
      fB - float Blue channel of vertex diffuse color.
    • setNormal

      public final void setNormal(javax.vecmath.Vector3f kNormal)
      Set the normal vector for the vertex.
      Parameters:
      kNormal - Vector3f Normal vector for the vertex.
    • setNormal

      public final void setNormal(float fX, float fY, float fZ)
      Set the normal vector for the vertex.
      Parameters:
      fX - float X coordinate of vertex normal vector.
      fY - float Y coordinate of vertex normal vector.
      fZ - float Z coordinate of vertex normal vector.
    • setPosition

      public final void setPosition(javax.vecmath.Point3f kPosition)
      Set the position of the vertex.
      Parameters:
      kPosition - Point3f Position coordinates for the vertex.
    • setPosition

      public final void setPosition(float fX, float fY, float fZ)
      Set the position of the vertex.
      Parameters:
      fX - float X coordinate of vertex position.
      fY - float Y coordinate of vertex position.
      fZ - float Z coordinate of vertex position.
    • setSpecular

      public final void setSpecular(javax.vecmath.Color3f kSpecular)
      Set the specular color for the vertex. The vertex specular color property must be enabled.
      Parameters:
      kSpecular - Color3f Specular color for the vertex.
    • setSpecular

      public final void setSpecular(float fR, float fG, float fB)
      Set the specular color for the vertex.
      Parameters:
      fR - float Red channel of vertex specular color.
      fG - float Green channel of vertex specular color.
      fB - float Blue channel of vertex specular color.