|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.Appearance
public class Appearance
Describes the appearance of an object.
Attribute classes are used to control various visual details about the object being rendered. Although a single instance of this class can take all the attribute types at once, you'll need to consider what this object is being used for. Most of the time you should only ever need to use one of Point/Line/Polygon attributes.
Note: If you have semi-transparent objects that need blending, you
do not need provide an instance of
BlendAttributes
. Aviatrix3D will
internally handle the correct settings that you need, so there is no need
to provide your own. Only use it when you want to blend objects with
something different than the standard blending setup for non-transparent
and transparent objects as it will remove this object from the normal
transparency sorting processing and into a separate state.
Field Summary |
---|
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 |
Constructor Summary | |
---|---|
Appearance()
The default constructor. |
Method Summary | |
---|---|
protected void |
checkForCyclicChild(SceneGraphObject parent)
Check to see if this node is the same reference as the passed node that is a parent of this node. |
int |
compareTo(Appearance app)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(Appearance app)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
AlphaAttributes |
getAlphaAttributes()
Get the current alpha rendering attributes in use. |
AppearanceAttributeRenderable |
getAttributeRenderable(int attrib)
Fetch the sub-renderable for the given type. |
BlendAttributes |
getBlendAttributes()
Get the current blend rendering attributes in use. |
DepthAttributes |
getDepthAttributes()
Get the current depth buffer attributes in use. |
LineAttributes |
getLineAttributes()
Get the current line rendering attributes in use. |
Material |
getMaterial()
Get the current material in use. |
TransparentObjectRenderable |
getMaterialRenderable()
Fetch the renderable that corresponds to material properties. |
PointAttributes |
getPointAttributes()
Get the current pointgon rendering attributes in use. |
PolygonAttributes |
getPolygonAttributes()
Get the current polygon rendering attributes in use. |
Shader |
getShader()
Get the current shader in use. |
ShaderRenderable |
getShaderRenderable()
Fetch the renderable that corresponds to the set programmable shader. |
StencilAttributes |
getStencilAttributes()
Get the current stencil buffer attributes in use. |
TextureRenderable |
getTextureRenderable(int unitNumber)
Request the renderable for the given texture unit number. |
void |
getTextureUnits(TextureUnit[] texUnits)
Get the texture units used by the material. |
boolean |
hasTransparency()
Ask the appearance if it has any transparency values. |
boolean |
hasTransparencyInfo()
Additional state information to supplement hasTransparency() by
stating whether we have any set of sub-renderables that even define
transparency information. |
boolean |
isVisible()
Check to see if this appearance is making the geometry visible or not. |
int |
numTextureRenderables()
Request the number of texture renderables that are available to process in this node. |
int |
numTextureUnits()
Get the current number of texture units that are valid |
void |
postRender(javax.media.opengl.GL gl)
Restore all openGL state. |
void |
render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component. |
void |
setAlphaAttributes(AlphaAttributes attr)
Set the alpha rendering attributes to use. |
void |
setBlendAttributes(BlendAttributes attr)
Set the blend rendering attributes to use. |
void |
setDepthAttributes(DepthAttributes attr)
Set the depth buffer attributes to use. |
void |
setLineAttributes(LineAttributes attr)
Set the line rendering attributes to use. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setMaterial(Material mat)
Set the material to use. |
void |
setPointAttributes(PointAttributes attr)
Set the point rendering attributes to use. |
void |
setPolygonAttributes(PolygonAttributes attr)
Set the polygon rendering attributes to use. |
void |
setShader(Shader s)
Set the shader to use. |
void |
setStencilAttributes(StencilAttributes attr)
Set the stencil buffer attributes to use. |
void |
setTextureUnits(TextureUnit[] texUnits,
int num)
Set the texture units to use. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
void |
setVisible(boolean state)
Set the visibility state of any geometry associated with this instance. |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Appearance()
Method Detail |
---|
public boolean isVisible()
isVisible
in interface AppearanceRenderable
public boolean hasTransparency()
hasTransparency
in interface AppearanceRenderable
public boolean hasTransparencyInfo()
hasTransparency()
by
stating whether we have any set of sub-renderables that even define
transparency information. This is used for when an appearance renderable
defines, say, polygon attributes, but no material or blend attributes at
all. In this case you want to know about the 2-sided rendering but need
to later check the geometry for colour with alpha being used.
hasTransparencyInfo
in interface AppearanceRenderable
public AppearanceAttributeRenderable getAttributeRenderable(int attrib)
getAttributeRenderable
in interface AppearanceRenderable
attrib
- The attribute type identifier from
AppearanceAttributeRenderable
public int numTextureRenderables()
numTextureRenderables
in interface AppearanceRenderable
public TextureRenderable getTextureRenderable(int unitNumber)
getTextureRenderable
in interface AppearanceRenderable
unitNumber
- The number of the texture unit to fetch
public ShaderRenderable getShaderRenderable()
getShaderRenderable
in interface AppearanceRenderable
public TransparentObjectRenderable getMaterialRenderable()
getMaterialRenderable
in interface AppearanceRenderable
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 withprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowprotected void checkForCyclicChild(SceneGraphObject parent) throws CyclicSceneGraphStructureException
checkForCyclicChild
in class SceneGraphObject
parent
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and childpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec 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 setVisible(boolean state)
state
- true to make the object visible
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setMaterial(Material mat) throws InvalidWriteTimingException
mat
- The new material
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic Material getMaterial()
public void setPolygonAttributes(PolygonAttributes attr) throws InvalidWriteTimingException
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic PolygonAttributes getPolygonAttributes()
public void setLineAttributes(LineAttributes attr) throws InvalidWriteTimingException
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic LineAttributes getLineAttributes()
public void setPointAttributes(PointAttributes attr) throws InvalidWriteTimingException
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic PointAttributes getPointAttributes()
public void setBlendAttributes(BlendAttributes attr) throws InvalidWriteTimingException
Note Setting a value will disable state sorting for transparency on this object.
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic BlendAttributes getBlendAttributes()
public void setAlphaAttributes(AlphaAttributes attr) throws InvalidWriteTimingException
Note Setting a value will disable state sorting for transparency on this object.
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic AlphaAttributes getAlphaAttributes()
public void setDepthAttributes(DepthAttributes attr) throws InvalidWriteTimingException
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic DepthAttributes getDepthAttributes()
public void setStencilAttributes(StencilAttributes attr) throws InvalidWriteTimingException
attr
- The new attributes or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic StencilAttributes getStencilAttributes()
public void setShader(Shader s) throws InvalidWriteTimingException
s
- The new shader instance to use or null
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic Shader getShader()
public void setTextureUnits(TextureUnit[] texUnits, int num) throws InvalidWriteTimingException
texUnits
- The new Texture lists to setnum
- The number of valid entries in the array
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int numTextureUnits()
public void getTextureUnits(TextureUnit[] texUnits)
texUnits
- An array to copy the texture units into
java.lang.IllegalArgumentException
- The provided array is not big enough
to hold all the texture unitspublic int compareTo(Appearance app)
app
- The argument instance to be compared
public boolean equals(Appearance app)
app
- The appearance instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |