Package gov.nih.mipav.view.renderer.J3D
Class SoftwareVertexProperty
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.SoftwareVertexProperty
-
public class SoftwareVertexProperty extends java.lang.ObjectThis 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.Color3fm_kDiffuseDOCUMENT ME!private javax.vecmath.Vector3fm_kNormalDOCUMENT ME!private javax.vecmath.Point3fm_kPositionBy default, vertex diffuse and specular colors are optional.private javax.vecmath.Color3fm_kSpecularDOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description SoftwareVertexProperty()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenableDiffuse(boolean bEnable)Enable/disable the optional diffuse color vertex property.voidenableSpecular(boolean bEnable)Enable/disable the optional specular color vertex property.javax.vecmath.Color3fgetDiffuse()Query current optional diffuse color for vertex.javax.vecmath.Vector3fgetNormal()Query current normal vector for vertex.javax.vecmath.Point3fgetPosition()Query current position of vertex.javax.vecmath.Color3fgetSpecular()Query current optional specular color for vertex.booleanisEnabledDiffuse()Query if the vertex diffuse color property is enabled.booleanisEnabledSpecular()Query if the vertex specular color property is enabled.voidsetDiffuse(float fR, float fG, float fB)Set the diffuse color for the vertex.voidsetDiffuse(javax.vecmath.Color3f kDiffuse)Set the diffuse color for the vertex.voidsetNormal(float fX, float fY, float fZ)Set the normal vector for the vertex.voidsetNormal(javax.vecmath.Vector3f kNormal)Set the normal vector for the vertex.voidsetPosition(float fX, float fY, float fZ)Set the position of the vertex.voidsetPosition(javax.vecmath.Point3f kPosition)Set the position of the vertex.voidsetSpecular(float fR, float fG, float fB)Set the specular color for the vertex.voidsetSpecular(javax.vecmath.Color3f kSpecular)Set the specular color for the vertex.
-
-
-
Field Detail
-
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!
-
-
Method Detail
-
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.
-
-