Chapter 8. Creating Draggers and Manipulators

This chapter shows how to create new draggers and manipulators. The first half of the chapter deals with creating new draggers, which are a special type of node kit with a user interface. The second half of the chapter describes creating new manipulators, which are nodes that employ draggers.

Before reading this chapter, you should first read and thoroughly understand Chapter 17, Draggers and Manipulators. Also, because draggers are node kits, you should be familiar with Chapter 16, Node Kits and Chapter 7 in this book. If you want to create a new manipulator that uses existing draggers, you can skip directly to Section 8.3, “Creating a Manipulator”.

The chapter examples show how to create four new classes:

  • A simple dragger, TranslateRadialDragger, which allows translation along a line

  • A compound dragger, RotTransDragger, which allows independent rotation in the x, y, and z directions as well as translation along a line

  • A transform manipulator, RotTransManip, which uses a RotTransDragger for editing its transform fields

  • A manipulator, Coord3Manip, which is derived from SoCoordinate3 SoCoordinate3 SoCoordinate3 and which uses an SoDragPointDragger SoDragPointDragger SoDragPointDragger for editing its point field

The first two classes created in this chapter are derived from the SoDragger class. The first class, TranslateRadialDragger, shows how to create a simple dragger, which typically performs only one operation such as scaling or translating. The second class, RotTransDragger, shows how to combine simple draggers into a compound dragger that can perform more than one operation. The third class, RotTransManip, shows how to create a new manipulator that is a subclass of SoTransformManip. The last class, Coord3Manip, shows how to create a manipulator that is subclassed from SoCoordinate3 and uses an existing dragger, the SoDragPointDragger.