Class SoState


  • public class SoState
    extends Inventor
    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.

    • Method Detail

      • getElement

        @Deprecated
        public SoElement getElement​(int stackIndex)
        Deprecated.
        As of Open Inventor 9000. 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
        public SoElement getConstElement​(int stackIndex)
        Deprecated.
        As of Open Inventor 9000. 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 last push().
      • push

        public void push()
        Pushes (saves) the current state until a pop() 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.

        enableSendToGL().

      • 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.