com.jme.scene.state
Class WireframeState

java.lang.Object
  extended by com.jme.scene.state.RenderState
      extended by com.jme.scene.state.WireframeState
All Implemented Interfaces:
Savable
Direct Known Subclasses:
JOGLWireframeState, LWJGLWireframeState

public abstract class WireframeState
extends RenderState

WireframeState maintains whether a node and it's children should be drawn in wireframe or solid fill. By default all nodes are rendered solid.

Version:
$Id: WireframeState.java 4336 2009-05-03 20:57:01Z christoph.luder $
Author:
Mark Powell, Joshua Slack

Nested Class Summary
static class WireframeState.Face
           
 
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState
RenderState.StateType
 
Field Summary
protected  boolean antialiased
          Default line style
protected  WireframeState.Face face
          Default wireframe of front and back.
protected  float lineWidth
          Default line width of 1 pixel.
 
Fields inherited from class com.jme.scene.state.RenderState
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER
 
Constructor Summary
WireframeState()
           
 
Method Summary
 java.lang.Class<?> getClassTag()
           
 WireframeState.Face getFace()
          Returns the face state of this wireframe state.
 float getLineWidth()
          Returns the current lineWidth.
 RenderState.StateType getStateType()
          getStateType returns the type RenderState.StateType.Wireframe
 int getType()
          Deprecated. As of 2.0, use RenderState.getStateType() instead.
 boolean isAntialiased()
           
 void read(JMEImporter e)
           
 void setAntialiased(boolean antialiased)
          Set whether this wireframe should use antialiasing when drawing lines.
 void setFace(WireframeState.Face face)
          setFace sets which face will recieve the wireframe.
 void setLineWidth(float width)
          setLineWidth sets the width of lines the wireframe is drawn in.
 void write(JMEExporter e)
           
 
Methods inherited from class com.jme.scene.state.RenderState
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

face

protected WireframeState.Face face
Default wireframe of front and back.


lineWidth

protected float lineWidth
Default line width of 1 pixel.


antialiased

protected boolean antialiased
Default line style

Constructor Detail

WireframeState

public WireframeState()
Method Detail

getType

public int getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead.

getType returns the type of render state this is. (RS_WIREFRAME).

Specified by:
getType in class RenderState
Returns:
An int identifying this render state.
See Also:
RenderState.getType()

getStateType

public RenderState.StateType getStateType()
getStateType returns the type RenderState.StateType.Wireframe

Specified by:
getStateType in class RenderState
Returns:
RenderState.StateType.Wireframe
See Also:
RenderState.getStateType()

setLineWidth

public void setLineWidth(float width)
setLineWidth sets the width of lines the wireframe is drawn in. Attempting to set a line width smaller than 0.0 throws an IllegalArgumentException.

Parameters:
width - the line width, in pixels

getLineWidth

public float getLineWidth()
Returns the current lineWidth.

Returns:
the current LineWidth

setFace

public void setFace(WireframeState.Face face)
setFace sets which face will recieve the wireframe.

Parameters:
face - which face will be rendered in wireframe.
Throws:
java.lang.IllegalArgumentException - if face is null

getFace

public WireframeState.Face getFace()
Returns the face state of this wireframe state.

Returns:
The face state (one of WS_FRONT, WS_BACK, or WS_FRONT_AND_BACK)

setAntialiased

public void setAntialiased(boolean antialiased)
Set whether this wireframe should use antialiasing when drawing lines. May decrease performance. If you want to enabled antialiasing, you should also use an alphastate with a source of SourceFunction.SourceAlpha and a destination of DB_ONE_MINUS_SRC_ALPHA or DB_ONE.

Parameters:
antialiased - true for using smoothed antialiased lines.

isAntialiased

public boolean isAntialiased()
Returns:
whether this wireframe uses antialiasing for drawing lines.

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class RenderState
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class RenderState
Throws:
java.io.IOException

getClassTag

public java.lang.Class<?> getClassTag()
Specified by:
getClassTag in interface Savable
Overrides:
getClassTag in class RenderState