Package gov.nih.mipav.view.renderer.J3D
Class SoftwareVertexProperty
java.lang.Object
gov.nih.mipav.view.renderer.J3D.SoftwareVertexProperty
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
FieldsModifier and TypeFieldDescriptionprivate javax.vecmath.Color3fDOCUMENT ME!private javax.vecmath.Vector3fDOCUMENT ME!private javax.vecmath.Point3fBy default, vertex diffuse and specular colors are optional.private javax.vecmath.Color3fDOCUMENT ME! -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidenableDiffuse(boolean bEnable) Enable/disable the optional diffuse color vertex property.final voidenableSpecular(boolean bEnable) Enable/disable the optional specular color vertex property.final javax.vecmath.Color3fQuery current optional diffuse color for vertex.final javax.vecmath.Vector3fQuery current normal vector for vertex.final javax.vecmath.Point3fQuery current position of vertex.final javax.vecmath.Color3fQuery current optional specular color for vertex.final booleanQuery if the vertex diffuse color property is enabled.final booleanQuery if the vertex specular color property is enabled.final voidsetDiffuse(float fR, float fG, float fB) Set the diffuse color for the vertex.final voidsetDiffuse(javax.vecmath.Color3f kDiffuse) Set the diffuse color for the vertex.final voidsetNormal(float fX, float fY, float fZ) Set the normal vector for the vertex.final voidsetNormal(javax.vecmath.Vector3f kNormal) Set the normal vector for the vertex.final voidsetPosition(float fX, float fY, float fZ) Set the position of the vertex.final voidsetPosition(javax.vecmath.Point3f kPosition) Set the position of the vertex.final voidsetSpecular(float fR, float fG, float fB) Set the specular color for the vertex.final voidsetSpecular(javax.vecmath.Color3f kSpecular) Set the specular color for the vertex.
-
Field Details
-
m_kDiffuse
private javax.vecmath.Color3f m_kDiffuseDOCUMENT ME! -
m_kNormal
private javax.vecmath.Vector3f m_kNormalDOCUMENT ME! -
m_kPosition
private javax.vecmath.Point3f m_kPositionBy default, vertex diffuse and specular colors are optional. -
m_kSpecular
private javax.vecmath.Color3f m_kSpecularDOCUMENT 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.
-