Package com.openinventor.inventor.misc
Class SoState
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.misc.SoState
Traversal state.
An
SoState
collects and holds state while traversing a scene graph. A state is composed of a variety of elements, each of which holds some specific information, such as coordinates or diffuse color of the surface material.
Each element is stored in its own stack so that save and restore can be implemented as push and pop. These stack operations are performed lazily, so that pushing of a value occurs only when the value would be overwritten, for efficiency.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enableSendToGL
(boolean enable) Enables or disables sendToGL in SoElements affected by the GLRenderAction.Returns the action instance the state is part of.getConstElement
(int stackIndex) Deprecated.As of Open Inventor 9.0.0.0.getConstElement
(Class<? extends Inventor> type, int stackIndex) Returns the top (read-only) instance of the given element stack.getElement
(int stackIndex) Deprecated.As of Open Inventor 9.0.0.0.getElement
(Class<? extends Inventor> type, int stackIndex) Returns a writable instance of the element on the top of the stack with the given index and type.boolean
Gets sendToGL activation flag.void
pop()
Pops the state, restoring the state to just before the lastpush()
.void
push()
Pushes (saves) the current state until apop()
restores it.Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Method Details
-
getElement
Deprecated.As of Open Inventor 9.0.0.0. Use the templated version instead.Returns a writable instance of the element on the top of the stack with the given stack index.Warning Deprecated since Open Inventor 9000. Use the templated version instead.
-
getAction
Returns the action instance the state is part of. -
getElement
Returns a writable instance of the element on the top of the stack with the given index and type. -
getConstElement
Deprecated.As of Open Inventor 9.0.0.0. Use the type safe templated version instead.Returns the top (read-only) instance of the given element stack.Warning Deprecated since Open Inventor 9000. Use the type safe templated version instead.
-
pop
public void pop()Pops the state, restoring the state to just before the lastpush()
. -
push
public void push()Pushes (saves) the current state until apop()
restores it. The push is done lazily: this just increments the depth in the state. When an element is accessed with getElement() and its depth is less than the current depth, it is then pushed individually. -
isSendToGLEnabled
public boolean isSendToGLEnabled()Gets sendToGL activation flag. -
getConstElement
Returns the top (read-only) instance of the given element stack. -
enableSendToGL
public void enableSendToGL(boolean enable) Enables or disables sendToGL in SoElements affected by the GLRenderAction.
-