org.xith3d.scenegraph
Class PolygonAttributes

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.NodeComponent
          extended by org.xith3d.scenegraph.PolygonAttributes
All Implemented Interfaces:
java.lang.Comparable<PolygonAttributes>, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, StateTrackable<PolygonAttributes>

public class PolygonAttributes
extends NodeComponent
implements StateTrackable<PolygonAttributes>

PolygonAttributes defines attributes that apply to .


Field Summary
static org.jagatoo.opengl.enums.FaceCullMode CULL_BACK
           
static org.jagatoo.opengl.enums.FaceCullMode CULL_FRONT
           
static org.jagatoo.opengl.enums.FaceCullMode CULL_NONE
           
static org.jagatoo.opengl.enums.FaceCullMode CULL_SWITCH
           
static org.jagatoo.opengl.enums.DrawMode POLYGON_FILL
           
static org.jagatoo.opengl.enums.DrawMode POLYGON_LINE
           
static org.jagatoo.opengl.enums.DrawMode POLYGON_POINT
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
PolygonAttributes()
          Constructs a new PolygonAttributes object.
PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode)
          Constructs a new PolygonAttributes object.
PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode, org.jagatoo.opengl.enums.FaceCullMode cullFace)
          Constructs a new PolygonAttributes object.
PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode, org.jagatoo.opengl.enums.FaceCullMode cullFace, float polygonOffset)
          Constructs a new PolygonAttributes object.
PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode, org.jagatoo.opengl.enums.FaceCullMode cullFace, float polygonOffset, float polygonOffsetFactor)
          Constructs a new PolygonAttributes object.
PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode, org.jagatoo.opengl.enums.FaceCullMode cullFace, float polygonOffset, float polygonOffsetFactor, boolean backFaceNormalFlip, boolean antialiasing, boolean sortEnabled)
          Constructs a new PolygonAttributes object.
PolygonAttributes(org.jagatoo.opengl.enums.FaceCullMode cullFace)
          Constructs a new PolygonAttributes object.
 
Method Summary
 PolygonAttributes cloneNodeComponent(boolean forceDuplicate)
          
 int compareTo(PolygonAttributes o)
          
protected  void duplicateNodeComponent(NodeComponent original, boolean forceDuplicate)
          
 boolean equals(java.lang.Object o)
          
 void freeOpenGLResources(CanvasPeer canvasPeer)
          This method frees OpenGL resources (names) for all this NodeComponent and all child-components.
 boolean getBackFaceNormalFlip()
           
 PolygonAttributes getCopy()
           
 org.jagatoo.opengl.enums.DrawMode getDrawMode()
           
 org.jagatoo.opengl.enums.FaceCullMode getFaceCullMode()
          Gets the face culling mode.
 float getPolygonOffset()
          Gets the polygon offset.
 float getPolygonOffsetFactor()
           
 long getStateId()
           
 StateNode getStateNode()
           
 boolean isPolygonAntialiasingEnabled()
          Get antialiasing.
 boolean isSortEnabled()
           
 void setBackFaceNormalFlip(boolean backFaceNormalFlip)
           
 void setDrawMode(org.jagatoo.opengl.enums.DrawMode drawMode)
          Sets the polygon draw mode.
 void setFaceCullMode(org.jagatoo.opengl.enums.FaceCullMode mode)
          Sets the face culling mode.
 void setPolygonAntialiasingEnabled(boolean state)
          Set antialiasing .
 void setPolygonOffset(float polygonOffset)
          Sets the polygon offset.
 void setPolygonOffsetFactor(float polygonOffsetFactor)
           
 void setSortEnabled(boolean sortEnabled)
          Enables or disables transaprency sorting for this shape.
 void setStateNode(StateNode node)
          Used by the render engine to set the state id for the node.
 
Methods inherited from class org.xith3d.scenegraph.NodeComponent
freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setChanged, setDuplicateOnCloneTree, setModListener
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CULL_NONE

public static final org.jagatoo.opengl.enums.FaceCullMode CULL_NONE
See Also:
FaceCullMode.NONE

CULL_FRONT

public static final org.jagatoo.opengl.enums.FaceCullMode CULL_FRONT
See Also:
FaceCullMode.FRONT

CULL_BACK

public static final org.jagatoo.opengl.enums.FaceCullMode CULL_BACK
See Also:
FaceCullMode.BACK

CULL_SWITCH

public static final org.jagatoo.opengl.enums.FaceCullMode CULL_SWITCH
See Also:
FaceCullMode.SWITCH

POLYGON_POINT

public static final org.jagatoo.opengl.enums.DrawMode POLYGON_POINT
See Also:
DrawMode.POINT

POLYGON_LINE

public static final org.jagatoo.opengl.enums.DrawMode POLYGON_LINE
See Also:
DrawMode.LINE

POLYGON_FILL

public static final org.jagatoo.opengl.enums.DrawMode POLYGON_FILL
See Also:
DrawMode.FILL
Constructor Detail

PolygonAttributes

public PolygonAttributes()
Constructs a new PolygonAttributes object.


PolygonAttributes

public PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode,
                         org.jagatoo.opengl.enums.FaceCullMode cullFace,
                         float polygonOffset)
Constructs a new PolygonAttributes object.


PolygonAttributes

public PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode,
                         org.jagatoo.opengl.enums.FaceCullMode cullFace)
Constructs a new PolygonAttributes object.


PolygonAttributes

public PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode)
Constructs a new PolygonAttributes object.


PolygonAttributes

public PolygonAttributes(org.jagatoo.opengl.enums.FaceCullMode cullFace)
Constructs a new PolygonAttributes object.


PolygonAttributes

public PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode,
                         org.jagatoo.opengl.enums.FaceCullMode cullFace,
                         float polygonOffset,
                         float polygonOffsetFactor)
Constructs a new PolygonAttributes object.


PolygonAttributes

public PolygonAttributes(org.jagatoo.opengl.enums.DrawMode drawMode,
                         org.jagatoo.opengl.enums.FaceCullMode cullFace,
                         float polygonOffset,
                         float polygonOffsetFactor,
                         boolean backFaceNormalFlip,
                         boolean antialiasing,
                         boolean sortEnabled)
Constructs a new PolygonAttributes object.

Method Detail

setDrawMode

public void setDrawMode(org.jagatoo.opengl.enums.DrawMode drawMode)
Sets the polygon draw mode.

Parameters:
drawMode -

getDrawMode

public final org.jagatoo.opengl.enums.DrawMode getDrawMode()
Returns:
the polygon draw mode.

setFaceCullMode

public final void setFaceCullMode(org.jagatoo.opengl.enums.FaceCullMode mode)
Sets the face culling mode. The default mode is CULL_NONE.


getFaceCullMode

public final org.jagatoo.opengl.enums.FaceCullMode getFaceCullMode()
Gets the face culling mode.


setPolygonOffset

public final void setPolygonOffset(float polygonOffset)
Sets the polygon offset.


getPolygonOffset

public final float getPolygonOffset()
Gets the polygon offset.


setPolygonAntialiasingEnabled

public final void setPolygonAntialiasingEnabled(boolean state)
Set antialiasing .


isPolygonAntialiasingEnabled

public final boolean isPolygonAntialiasingEnabled()
Get antialiasing.


setSortEnabled

public void setSortEnabled(boolean sortEnabled)
Enables or disables transaprency sorting for this shape. Line can be classified as transparent if it has antialiasing enabled.

Transparency attributes can be marked to disable sorting transparent shapes by calling of setSortEnabled(false). When this is done, transparent shape it will not be drawn during the transparent rendering pass, but will be drawn with the solids (in the opaque rendering pass), i.e. this transparent shape will be treated just like regular opaque shape.

By default, sorting is enabled.

See Also:
OrderedGroup, TransparencyAttributes.setSortEnabled(boolean)

isSortEnabled

public final boolean isSortEnabled()

setBackFaceNormalFlip

public void setBackFaceNormalFlip(boolean backFaceNormalFlip)

getBackFaceNormalFlip

public final boolean getBackFaceNormalFlip()

setPolygonOffsetFactor

public void setPolygonOffsetFactor(float polygonOffsetFactor)

getPolygonOffsetFactor

public final float getPolygonOffsetFactor()

setStateNode

public final void setStateNode(StateNode node)
Description copied from interface: StateTrackable
Used by the render engine to set the state id for the node.

Specified by:
setStateNode in interface StateTrackable<PolygonAttributes>

getStateNode

public final StateNode getStateNode()
Specified by:
getStateNode in interface StateTrackable<PolygonAttributes>
Returns:
the id of the object. This should return -1 if there is no assigned id.

getStateId

public final long getStateId()

getCopy

public PolygonAttributes getCopy()
Specified by:
getCopy in interface StateTrackable<PolygonAttributes>
Returns:
a copy of the state of the referenced trackable object.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(PolygonAttributes o)

Specified by:
compareTo in interface java.lang.Comparable<PolygonAttributes>

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent original,
                                      boolean forceDuplicate)

Overrides:
duplicateNodeComponent in class NodeComponent

cloneNodeComponent

public PolygonAttributes cloneNodeComponent(boolean forceDuplicate)

Specified by:
cloneNodeComponent in class NodeComponent

freeOpenGLResources

public void freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all this NodeComponent and all child-components.

Specified by:
freeOpenGLResources in class NodeComponent