The file SoSubNode.h contains the macros for defining new node classes. The SO_NODE_HEADER() macro declares type identifier and naming variables and methods that all node classes must support. The SO_NODE_SOURCE() macro defines the static variables and methods declared in the SO_NODE_HEADER() macro. Other macros useful in creating new node classes are mentioned in the following sections.
Creating a new node requires these steps:
a. For a property node, you usually need to implement the GLRender() and callback() methods (see Creating a Property Node). You may also need to implement getBoundingBox(), getMatrix(), and other methods.
b. For a shape node, you need to implement the generate- Primitives() method for the SoCallbackAction as well as the getBoundingBox() method. You may want to implement a specific GLRender() or rayPick() method as well (see Creating a Shape Node). For vertex-based shapes, you may need to implement a generateDefaultNormals() method (see Generating Default Normals).
c. For a group node, you need to implement all actions to ensure that the children are traversed (see Creating a Group Node).