org.xith3d.scenegraph
Class LineAttributes

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

public class LineAttributes
extends NodeComponent
implements StateTrackable<LineAttributes>

LineAttributes defines attributes that apply to .


Field Summary
static org.jagatoo.opengl.enums.LinePattern PATTERN_DASH
           
static org.jagatoo.opengl.enums.LinePattern PATTERN_DASH_DOT
           
static org.jagatoo.opengl.enums.LinePattern PATTERN_DOT
           
static org.jagatoo.opengl.enums.LinePattern PATTERN_SOLID
           
static org.jagatoo.opengl.enums.LinePattern PATTERN_USER_DEFINED
           
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
LineAttributes()
          Constructs a new LineAttributes object.
LineAttributes(float lineWidth, org.jagatoo.opengl.enums.LinePattern linePattern, boolean antialiasing)
          Constructs a new LineAttributes object with the specified attributes.
LineAttributes(float lineWidth, org.jagatoo.opengl.enums.LinePattern linePattern, int patternScaleFactor, int patternMask, boolean antialiasing)
          Constructs a new LineAttributes object with the specified attributes.
 
Method Summary
 LineAttributes cloneNodeComponent(boolean forceDuplicate)
          
 int compareTo(LineAttributes 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.
 LineAttributes getCopy()
           
 org.jagatoo.opengl.enums.LinePattern getLinePattern()
          Get the line pattern.
 float getLineWidth()
          Get the line width.
 int getPatternMask()
          Get the line pattern mask.
 int getPatternScaleFactor()
          Get the line pattern repeat factor.
 long getStateId()
           
 StateNode getStateNode()
           
 boolean isLineAntialiasingEnabled()
          Get antialiasing.
 boolean isSortEnabled()
           
 void setLineAntialiasingEnabled(boolean state)
          Set antialiasing .
 void setLinePattern(org.jagatoo.opengl.enums.LinePattern linePattern)
          Set the line pattern.
 void setLineWidth(float lineWidth)
          Set the line width.
 void setPatternMask(int patternMask)
          Set the line pattern mask.
 void setPatternScaleFactor(int factor)
          Set the line pattern repeat (scale) factor.
 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

PATTERN_SOLID

public static final org.jagatoo.opengl.enums.LinePattern PATTERN_SOLID
See Also:
LineAttributes.Pattern#SOLID

PATTERN_DASH

public static final org.jagatoo.opengl.enums.LinePattern PATTERN_DASH
See Also:
LineAttributes.LinePattern#DASHED

PATTERN_DOT

public static final org.jagatoo.opengl.enums.LinePattern PATTERN_DOT
See Also:
LineAttributes.LinePattern#DOTTED

PATTERN_DASH_DOT

public static final org.jagatoo.opengl.enums.LinePattern PATTERN_DASH_DOT
See Also:
LineAttributes.LinePattern#DASHED_DOTTED

PATTERN_USER_DEFINED

public static final org.jagatoo.opengl.enums.LinePattern PATTERN_USER_DEFINED
See Also:
LineAttributes.LinePattern#USER_DEFINED
Constructor Detail

LineAttributes

public LineAttributes()
Constructs a new LineAttributes object.


LineAttributes

public LineAttributes(float lineWidth,
                      org.jagatoo.opengl.enums.LinePattern linePattern,
                      boolean antialiasing)
Constructs a new LineAttributes object with the specified attributes.


LineAttributes

public LineAttributes(float lineWidth,
                      org.jagatoo.opengl.enums.LinePattern linePattern,
                      int patternScaleFactor,
                      int patternMask,
                      boolean antialiasing)
Constructs a new LineAttributes object with the specified attributes.

Method Detail

setLineWidth

public final void setLineWidth(float lineWidth)
Set the line width.


getLineWidth

public final float getLineWidth()
Get the line width.


setLineAntialiasingEnabled

public final void setLineAntialiasingEnabled(boolean state)
Set antialiasing .


isLineAntialiasingEnabled

public final boolean isLineAntialiasingEnabled()
Get antialiasing.


setLinePattern

public final void setLinePattern(org.jagatoo.opengl.enums.LinePattern linePattern)
Set the line pattern.


getLinePattern

public final org.jagatoo.opengl.enums.LinePattern getLinePattern()
Get the line pattern.


setPatternMask

public final void setPatternMask(int patternMask)
Set the line pattern mask.


getPatternMask

public final int getPatternMask()
Get the line pattern mask.


setPatternScaleFactor

public final void setPatternScaleFactor(int factor)
Set the line pattern repeat (scale) factor.

Repeat (scale) factor is a multiplier for each bit in the line stipple pattern. If factor is 3, for example, each bit in the pattern will be used three times before the next bit in the pattern is used. The factor parameter is clamped to the range [1, 256] and defaults to one.


getPatternScaleFactor

public final int getPatternScaleFactor()
Get the line pattern repeat factor.


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 boolean isSortEnabled()

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<LineAttributes>

getStateNode

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

getStateId

public final long getStateId()

getCopy

public LineAttributes getCopy()
Specified by:
getCopy in interface StateTrackable<LineAttributes>
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(LineAttributes o)

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

duplicateNodeComponent

protected void duplicateNodeComponent(NodeComponent original,
                                      boolean forceDuplicate)

Overrides:
duplicateNodeComponent in class NodeComponent

cloneNodeComponent

public LineAttributes 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