|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.PolygonAttributes
public class PolygonAttributes
Describes attributes used when rendering a polygon.
Attributes control the visibility and some lighting calculations of the polygon. You can control which face to cull, which way to wind the polygons to calculate front and back faces, as well as some lighting control.
The default setup of this class mirrors the OpenGL defaults:
Internationalisation Resource Names
Field Summary | |
---|---|
static int |
CULL_BACK
The cull mode says to draw back faces only |
static int |
CULL_BOTH
The cull mode says to not draw any faces |
static int |
CULL_FRONT
The cull mode says to draw front faces only |
static int |
CULL_NONE
The cull mode says to draw both front and back faces |
static int |
DRAW_FILLED
Draw the face filled as a solid object |
static int |
DRAW_LINE
Draw the face as outline lines only |
static int |
DRAW_POINT
Draw the face as the points of the vertices only |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.AppearanceAttributeRenderable |
---|
ALPHA_ATTRIBUTE, BLEND_ATTRIBUTE, DEPTH_ATTRIBUTE, LINE_ATTRIBUTE, POINT_ATTRIBUTE, POLYGON_ATTRIBUTE, STENCIL_ATTRIBUTE |
Constructor Summary | |
---|---|
PolygonAttributes()
Constructs a attribute set with default values. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(PolygonAttributes pa)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(PolygonAttributes pa)
Compares this object with the specified object to check for equivalence. |
int |
getAttributeType()
Get the type this visual attribute represents. |
int |
getCulledFace()
Get the current face culled flag. |
int |
getDrawMode(boolean front)
Get the draw mode for the specified face. |
void |
getPolygonOffset(float[] values)
Get the current polygon offset details. |
boolean |
isAntiAliased()
Check the state of the antialiased flag setting for this geometry. |
boolean |
isCCW()
Check the state of the CCW flag setting for this geometry. |
boolean |
isFlatShaded()
Check the state of the separate specular lighting flag setting for this geometry. |
boolean |
isSeparateSpecular()
Check the state of the separate specular lighting flag setting for this geometry. |
boolean |
isTwoSidedLighting()
Check the state of the two-sided lighting flag setting for this geometry. |
void |
postRender(javax.media.opengl.GL gl)
Restore all openGL state to the given drawable. |
void |
render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component |
void |
setAntiAliased(boolean state)
Set the antialiased flag state. |
void |
setCCW(boolean state)
Set the CCW flag. |
void |
setCulledFace(int face)
Set which face is to be culled. |
void |
setDrawMode(boolean front,
int mode)
Set the draw mode for either the front or back face. |
void |
setFlatShaded(boolean state)
Set the shading style to use either flat or smooth shading. |
void |
setPolygonOffset(float factor,
float units)
Set the polygon offset details. |
void |
setSeparateSpecular(boolean state)
Set the separated specular lighting flag. |
void |
setStipplePattern(byte[] pattern)
Set the stipple mask to be used on the polygon. |
void |
setTwoSidedLighting(boolean state)
Set the two-sided lighting flag. |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CULL_NONE
public static final int CULL_FRONT
public static final int CULL_BACK
public static final int CULL_BOTH
public static final int DRAW_POINT
public static final int DRAW_LINE
public static final int DRAW_FILLED
Constructor Detail |
---|
public PolygonAttributes()
Method Detail |
---|
public int getAttributeType()
getAttributeType
in interface AppearanceAttributeRenderable
public void render(javax.media.opengl.GL gl)
render
in interface ObjectRenderable
gl
- The gl context to draw withpublic void postRender(javax.media.opengl.GL gl)
postRender
in interface ObjectRenderable
gl
- The gl context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The object to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setAntiAliased(boolean state) throws InvalidWriteTimingException
state
- True to use antialiasing, false to turn it off
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isAntiAliased()
public void setCCW(boolean state) throws InvalidWriteTimingException
state
- True to use CCW triangles, false for CW
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isCCW()
public void setTwoSidedLighting(boolean state) throws InvalidWriteTimingException
state
- True to use two sided lighting triangles, false for single sided
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isTwoSidedLighting()
public void setSeparateSpecular(boolean state) throws InvalidWriteTimingException
state
- True to generate a separated specular component
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isSeparateSpecular()
public void setFlatShaded(boolean state) throws InvalidWriteTimingException
state
- True to render as flat shaded polygons
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isFlatShaded()
public void setCulledFace(int face) throws InvalidWriteTimingException
face
- The face that should be culled
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getCulledFace()
public void setDrawMode(boolean front, int mode) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
front
- true if this is the front-face settingmode
- The mode to use for this face
java.lang.IllegalArgumentException
- Invalid mode supplied
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getDrawMode(boolean front)
front
- true if requesting the front-face settingpublic void setPolygonOffset(float factor, float units) throws InvalidWriteTimingException
factor
- The offset factor mulitplierunits
- The offset unit multiplier
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void getPolygonOffset(float[] values)
values
- The array to copy the current values intopublic void setStipplePattern(byte[] pattern) throws InvalidWriteTimingException
pattern
- The bytes of the pattern or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int compareTo(PolygonAttributes pa)
pa
- The attributes instance to be compared
public boolean equals(PolygonAttributes pa)
pa
- The attributes instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |