Class SoNode

    • Method Detail

      • getRenderEngineMode

        public SoNode.RenderModes getRenderEngineMode()
        Returns the supported Render engine mode.

        For custom node, this method returns by default SoNode.RenderModes.OIV_UNKNOWN_RENDERING_MODE, override this method to specify the Render engine mode supported by your custom node.

        Returns:
        the supported Render engine mode for this node.
      • copy

        public SoNode copy()
        Calls copy(false).
      • setOverride

        public void setOverride​(boolean state)
        Turns the override flag on or off.

        The following property nodes are affected by the override flag: SoBaseColor, SoColorIndex, SoComplexity, SoDepthBuffer, SoDrawStyle, SoEnvironment, SoFont, SoFullSceneAntialiasing, SoLightModel, SoMaterial, SoMaterialBinding, SoPackedColor, SoPattern, SoPickStyle, SoPolygonOffset, SoShapeHints, SoVertexProperty, SoTextProperty.

        Every node has an override flag associated with it. The override flag is a powerful mechanism typically used (sparingly) near the top of a scene graph. When this flag is set, any nodes of the same type encountered later in the graph are ignored even if they also have their own override flag set. For example, you might insert a line-style SoDrawStyle node at the top of a graph to ensure that the whole scene is drawn as wireframe objects, regardless of drawing styles specified lower in the scene graph. Use the setOverride() method to set and reset the override flag. The isOverride() method returns the state of the override flag.

        Normally, the override flag is not used within a scene graph for modeling. Use it in applications where you need to specify a temporary change to the whole graph.

        Note: The override flag is not written to a file.

        Setting the override flag on a node whose field values are not inherited (for example on a sphere with a radius of 7) has no effect on other nodes in the graph of that type.

      • isOverride

        public boolean isOverride()
        Returns the state of the override flag.
      • copy

        public SoNode copy​(boolean copyConnections)
        Creates and returns an exact copy of the node. If the node is a group, it copies the children as well. If copyConnections is true (it is false by default), any connections to (but not from) fields of the node are copied, as well. Note that multiple references to a node under the node to be copied will result in multiple references to the copy of that node. To be copyable, a custom node must define a default contructor. Note that OIV require that every custom node must define a default contructor.

        Please also note that instance data other than Inventor fields and public children will not be copied by this method. If extra data needs to be copied as well, this method will have to be manually overridden.

      • affectsState

        public boolean affectsState()
        Returns true if a node has an effect on the state during traversal. The default method returns true. Node classes (such as SoSeparator) that isolate their effects from the rest of the graph override this method to return false.
      • getByName

        public static SoNode getByName​(java.lang.String name)
        A node's name can be set using SoBase.setName(). This method allows nodes to be looked up by name. It returns the last node given the specified name.
      • grabEventsSetup

        public void grabEventsSetup()
      • isBoundingBoxIgnoring

        public boolean isBoundingBoxIgnoring()
        This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored. See boundingBoxIgnoring field of nodes SoGroup, SoShape and SoBaseKit. Default is false.
      • doAction

        public void doAction​(SoAction action)
      • getRenderUnitID

        public int getRenderUnitID()
      • grabEventsCleanup

        public void grabEventsCleanup()
      • touch

        public void touch()
        Marks an instance as modified, simulating a change to it. This will notify auditors (parent nodes, connected engines, and so on) of a change to this object and cause attached sensors to be triggered.
        Overrides:
        touch in class SoBase
      • GLRenderBelowPath

        public void GLRenderBelowPath​(SoGLRenderAction action)
      • getAlternateRep

        public SoNode getAlternateRep​(SoAction action)
        This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). For example, when an SoIndexedTexture2 node is traversed by an SoToU3DAction, it returns an SoTexture2 node as its alternate representation, because indexed textures are not supported in U3D. A custom node can use this mechanism to provide an alternate representation using standard nodes when it is travered by an SoWriteAction.

        By default the node itself is returned.