Class SoNode

All Implemented Interfaces:
SafeDisposable
Direct Known Subclasses:
MoActionNode, OrthoSliceBorder, PoNode, Ruler, SoAlphaPolicy, SoAnnoText3Property, SoBackground, SoBaseColor, SoBaseKit, SoBBox, SoBevelProperty, SoCallback, SoCamera, SoClipPlane, SoColorIndex, SoColorMap, SoColorMask, SoComplexity, SoComputeShaderScheduler, SoCoordinate3, SoCoordinate4, SoDataCompositor, SoDataRange, SoDataSet, SoDataSetId, SoDepthBuffer, SoDepthOffset, SoDrawStyle, SoEdgeFlag, SoEnvironment, SoEnvironmentMap, SoEventCallback, SoFile, SoFont, SoFullSceneAntialiasing, SoGeometryPriority, SoGeoOrigin, SoGeoRender, SoGroup, SoHardwareQuery, SoInfo, SoInteractiveComplexity, SoLabel, SoLight, SoLightModel, SoMarker, SoMaterial, SoMaterialBinding, SoNodeKitListPart, SoNormal, SoNormalBinding, SoNurbsBoundary, SoNurbsProperty, SoOffscreenVolumeRender, SoPackedColor, SoPattern, SoPhysicalMaterial, SoPickStyle, SoPolygonOffset, SoProfile, SoProfileCoordinate2, SoProfileCoordinate3, SoProjection, SoRemoteVizClient, SoRenderToTextureProperty, SoROI, SoScreenDrawer, SoShaderObject, SoShaderParameter, SoShaderProgram, SoShadowStyle, SoShape, SoShapeHints, SoTextProperty, SoTexture, SoTexture2Transform, SoTexture3Transform, SoTextureCombiner, SoTextureCoordinate2, SoTextureCoordinate3, SoTextureCoordinateBinding, SoTextureCoordinateFunction, SoTextureMatrix, SoTextureUnit, SoTransferFunction, SoTransformation, SoVertexFlag, SoVertexProperty, SoViewingCube, SoViewport, SoViewportClipping, SoVolumeDataDrawStyle, SoVolumeRenderingPhysicalQuality, SoVolumeTransform, SoWWWInline

public class SoNode extends SoFieldContainer
Abstract base class for all database nodes. This is the abstract base class from which all scene graph node classes are derived.

File format/default:

This is an abstract class. See the reference page of a derived class for the format and default values.

Action behavior:

SoSearchAction
If the node, type, or name matches the search criteria, returns a path to the node.

SoWriteAction
Writes the contents of the node to the current SoOutput.

See Also:
  • Method Details

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

      public void distribute(SoDistributeAction action)
    • 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, SoEnvironmentMap, SoFont, SoFullSceneAntialiasing, SoLightModel, SoMaterial, SoPhysicalMaterial, 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.
    • getPrimitiveCount

      public void getPrimitiveCount(SoGetPrimitiveCountAction action)
    • search

      public void search(SoSearchAction action)
    • rayPick

      public void rayPick(SoRayPickAction action)
    • pick

      public void pick(SoPickAction action)
    • handleEvent

      public void handleEvent(SoHandleEventAction action)
    • getByName

      public static SoNode getByName(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.
    • write

      public void write(SoWriteAction action)
    • 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.
    • GLRenderOffPath

      public void GLRenderOffPath(SoGLRenderAction action)
    • doAction

      public void doAction(SoAction action)
    • getRenderUnitID

      public int getRenderUnitID()
    • GLRender

      public void GLRender(SoGLRenderAction action)
    • callback

      public void callback(SoCallbackAction action)
    • grabEventsCleanup

      public void grabEventsCleanup()
    • getMatrix

      public void getMatrix(SoGetMatrixAction action)
    • 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.

    • getBoundingBox

      public void getBoundingBox(SoGetBoundingBoxAction action)
    • GLRenderInPath

      public void GLRenderInPath(SoGLRenderAction action)