Table of Contents
This chapter describes how to create a node-kit class. The examples show how to create a new subclass and how to customize the node-kit catalog. Creating a node kit is essentially the same as creating a node, except you use special node-kit macros found in SoSubKit.h. In addition, you use special macros for defining the node-kit catalog.
NodeKit and custom nodes described in Chapter 2, Creating a Node may represent the same thing, but they are conceptually different. A NodeKit is use to represent a structured group of nodes. It really represents a SceneGraph by itself. A custom node is used to represent a stand-alone node, which is internally implemented using other nodes. NodeKit are also more high level but have some drawback. For examples, the structure of their internal scenegraph cannot be changed on the fly.
Before reading this chapter, be sure to read Chapter 16, Node Kits , as well as Chapter 2 in this book.
The first part of this chapter offers an overview of the steps required to create a new node kit. When necessary, additional sections explain key concepts in further detail and list the relevant macros. The chapter examples show how to create three node-kit classes:
SoAppearanceKit SoAppearanceKit SoAppearanceKit , a node kit in the Open Inventor library, which is a simple grouping of properties
PyramidKit, a node kit that uses an existing node-kit class and changes one of its parts
JumpingJackKit, a node kit that adds new parts to the parent class, including a built-in event callback that moves the parts when the user selects the object with the mouse