Coin
4.0.3
Coin3D core library
|
Nodekits modularize sub-structures of a scene graph. More...
Classes | |
class | SoAppearanceKit |
The SoAppearanceKit class is a node kit catalog that collects miscellaneous appearance node types. More... | |
class | SoBaseKit |
The SoBaseKit class is the top level superclass for nodekits. More... | |
class | SoCameraKit |
The SoCameraKit class is a node kit with a transform and a camera. More... | |
class | SoInteractionKit |
The SoInteractionKit class is a base class for draggers. More... | |
class | SoLightKit |
The SoLightKit class provides a kit with a transform, a light and a shape or subgraph. More... | |
class | SoNodeKit |
The SoNodeKit class is used to initialize the nodekit classes. More... | |
class | SoNodekitCatalog |
The SoNodekitCatalog class is a container for nodekit layouts. More... | |
class | SoNodeKitListPart |
The SoNodeKitListPart class is a container node. More... | |
class | SoNodeKitPath |
The SoNodeKitPath class is a path that contains only nodekit nodes. More... | |
class | SoSceneKit |
The SoSceneKit class collects node kits needed to set up a scene: camera, light and shapes. More... | |
class | SoSeparatorKit |
The SoSeparatorKit class provides a typical set of nodes to influence a shape subgraph. More... | |
class | SoShapeKit |
The SoShapeKit class provides templates to insert what is usually needed for shape nodes. More... | |
class | SoWrapperKit |
The SoWrapperKit class is a simple kit for wrapping a transform and a subgraph. More... | |
Nodekits modularize sub-structures of a scene graph.
Wrapping ones head around when, how, and why to create nodekits can be difficult in the beginning. When do you write a nodekit, and when do you write a custom node? It is easy to think in those terms in the beginning, but it is often not an either/or situation.
The concept of nodekits is to modularize useful, potentially repeated sub-structures you have in your scene graph as it approaches some level of complexity. They are especially useful if you might need to rearrange the structure of the sub-structure in the future, which you probably will.
On file, a nodekit is like a macro for the scene graph. The nodekit will not expose its internal structure, but when read in it will create the node structure internally. The node structure can even have optional parts that are only expanded if necessary.
A nodekit will give you access to its "slots" in the internal structure through its fields. Only those fields should be the user interface for the nodekit, the rest of the substructure should be completely automatic, derived from those slot fields.
To return to the question on whether to implement a custom node or a nodekit, the answer is to think of what exactly is really custom about what you need to implement, and trim that down to the atomic level (but please stop trimming before you trim away all meaning). If there is nothing really custom in what you want to implement, then it is likely that implementing it as a nodekit is what you ought to do. However, if you do have to do something custom that Coin doesn't support, then implement that part as a custom node, and then, if it seems worthwhile, implement the nodekit you need to bundle up this custom part with an auxiliary support structure to achieve what you set out to achieve.
For VRML97, you have something called PROTOs, which is something similar to nodekits, except they are not very accessible from C++, as opposed to nodekits.