|
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.Node
org.j3d.aviatrix3d.Leaf
org.j3d.aviatrix3d.AppearanceOverride
public class AppearanceOverride
An appearance that can be placed higher in the tree other than the Appearance node and overrides the appearance of all objects lower in the tree.
This class can be used to override the appearance of everything in the tree, for example, to highlight a sub section of parts of a greater assembly. Two different types of behaviours are allowed: it can be used to always override everything below, or if can be provided as a backup if there is no appearance provided at the leaf nodes.
An additional configuration option is available in either mode. When the local appearance option is false it will add any missing appearance items from the leaf node Appearance class instance that it does not have locally specified. This allows you to, for example, provide a global shader, but leave the definition of the material and normal map textures to the individual shape node instances, without having to cart the shader around everywhere. Another way of thinking about this, is that content loaded from external sources that have colours and normal maps defined, don't have to worry about loading in the root shader to change rendering styles as part of the loader process. So long as your loader is consistent about which index each texture goes in, you don't have to care about what rendering style is applied globally (ie, normal texture is always texture unit 0, colour texture always texture unit 1 etc etc).
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable |
---|
AUDIO_CULLABLE, CLIP_CULLABLE, FOG_CULLABLE, GEOMETRY_CULLABLE, LIGHT_CULLABLE, OVERRIDE_CULLABLE |
Constructor Summary | |
---|---|
AppearanceOverride()
Creates an override that is disabled by default and does not override the lower items on the tree. |
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(AppearanceOverride sh)
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(AppearanceOverride sh)
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. |
Appearance |
getAppearance()
Get the current appearance associated with this shape. |
AppearanceRenderable |
getAppearanceRenderable()
Fetch the renderable that represents the visual appearance modifiers of this shape. |
int |
getCullableType()
Get the type that this cullable represents. |
Renderable |
getRenderable()
Get the child renderable of this object. |
boolean |
isEnabled()
Get the current enabled state of the light. |
boolean |
isLocalAppearanceOnly()
Check whether the override shoudl include from the leaf Appearance nodes any missing definitions. |
boolean |
isOverridingLower()
Check which direction has preference for the appearance handling. |
boolean |
overrideLower()
Check which direction has preference for the appearance handling. |
void |
setAppearance(Appearance newApp)
Set the appearance for this shape. |
void |
setEnabled(boolean state)
Set the enabled state of this override. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setLocalAppearanceOnly(boolean state)
Set the override function to determine whether we should override also include any missing appearance options that are defined in leaf Appearance nodes on the Shape nodes. |
void |
setOverrideLower(boolean state)
Set the override function to determine whether we should override lower appearances or not. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
boolean |
useLocalOnlyAppearance()
Check to see if this is a local appearance only or it should accumulate the leaf node colours/textures. |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, markBoundsDirty, recomputeBounds, removeParent, requestBoundsUpdate, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable |
---|
getBounds |
Constructor Detail |
---|
public AppearanceOverride()
Method Detail |
---|
public int getCullableType()
getCullableType
in interface LeafCullable
public Renderable getRenderable()
getRenderable
in interface LeafCullable
public boolean overrideLower()
overrideLower
in interface OverrideRenderable
public boolean useLocalOnlyAppearance()
useLocalOnlyAppearance
in interface OverrideRenderable
public AppearanceRenderable getAppearanceRenderable()
getAppearanceRenderable
in interface OverrideRenderable
public boolean isEnabled()
isEnabled
in interface CascadeRenderable
protected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected 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 setEnabled(boolean state) throws InvalidWriteTimingException
state
- The new state of the override
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setOverrideLower(boolean state) throws InvalidWriteTimingException
state
- Set true if this should trump lower instances in the tree
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isOverridingLower()
public void setLocalAppearanceOnly(boolean state) throws InvalidWriteTimingException
state
- Set true if this should trump lower instances in the tree
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isLocalAppearanceOnly()
public Appearance getAppearance()
public void setAppearance(Appearance newApp) throws InvalidWriteTimingException
newApp
- The appearance
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int compareTo(AppearanceOverride sh)
sh
- The argument instance to be compared
public boolean equals(AppearanceOverride sh)
sh
- The shape instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |