Package com.openinventor.inventor.misc
Class SoState
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoState
-
public class SoState extends Inventor
Traversal state. AnSoState
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
enableSendToGL(boolean enable)
Enables or disables sendToGL in SoElements affected by the GLRenderAction.SoAction
getAction()
Returns the action instance the state is part of.SoElement
getConstElement(int stackIndex)
Deprecated.As of Open Inventor 9.0.0.0.SoElement
getConstElement(java.lang.Class<? extends Inventor> type, int stackIndex)
Returns the top (read-only) instance of the given element stack.SoElement
getElement(int stackIndex)
Deprecated.As of Open Inventor 9.0.0.0.SoElement
getElement(java.lang.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
isSendToGLEnabled()
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 Detail
-
getElement
@Deprecated(since="9.0.0.0") public SoElement getElement(int stackIndex)
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
public SoAction getAction()
Returns the action instance the state is part of.
-
getElement
public SoElement getElement(java.lang.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.
-
getConstElement
@Deprecated(since="9.0.0.0") public SoElement getConstElement(int stackIndex)
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
public SoElement getConstElement(java.lang.Class<? extends Inventor> type, int stackIndex)
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.
-
-