The ring array plug-in has several key classes:
RingDriver
class.DrivenControl
class.RingDriverCreationManager
class.RingDriverCreateMode
class.This section examines each of these classes in terms of their function within the system.
The RingDriver
class (derived from ReferenceTarget
) is responsible for directing the entire system after it is created. It maintains a table of all the nodes it controls. It also manages the user interface parameters of the system using a parameter block. For more details on parameter blocks see the topic on Parameter Blocks. This class has a very important method named GetValue()
. The driven controllers directing the position of the ring nodes call this method in their implementation of Control::GetValue()
. This allows the RingDriver
to control all the driven controllers based on their position in the ring array and the UI parameters.
The class DrivenControl
is derived from class Control
. In its implementation of GetValue()
the driven controller calls the method of the same name on the RingDriver
. This is how the driven controllers derive their position and orientation from the driver -- the driver simply supplies all the values to each of its driven controllers. Each driven controller has a reference to the RingDriver
. This is used to register a dependency between the driven controller and the RingDriver
in the system. If the user changes the parameters of the driver controller, it sends a REFMSG_CHANGE
message up to the driven controllers, which sends it to the nodes they control. This invalidates the nodes and causes them to get redrawn in the next screen update.
The class RingDriverCreationManager
(derived from both MouseCallBack
and ReferenceMaker
) manages the user interaction during the creation process. It is used to handle the creation of the center dummy object and the box objects in the ring surrounding the center. In addition to creating the objects, it creates nodes in the scene for these objects, sets their transform controllers, and links the ring nodes to the parent node at the center of the ring. The creation manager maintains a data member theMaster
. This is a pointer to an instance of class RingDriver
. This is used to call methods of the driver such as its BeginEditParams()
and EndEditParams()
. This object also maintains a reference to the first driven node it creates. This is used so that if the user deselects this driven node the creation process will begin with a new item (and not continue to edit the existing item if the UI controls are adjusted). An instance of this class is the mouse callback object for the RingDriverCreateMode
class described below.
The class RingDriverCreateMode
(derived from CommandMode
) is the command mode that is put into effect when the Ring Array is being created. A command mode has a mouse procedure that handles the user/mouse interaction during creation. This takes place during execution of the ClassDesc::BeginCreate()
method. See the section below for more details on how BeginCreate()
and EndCreate()
bracket the creation phase of a plug-in. The mouse callback object portion of the command mode (returned from method CommandMode::MouseProc()
) is an instance of class RingDriverCreationManager
.