Ring Array References

There are several classes in the Ring Array that make references. This section provides an overview of how the references are used by the classes. For a general introduction to the 3ds Max reference mechanism topic on Reference System.

The RingDriver is the class that manages the user interface parameters. It creates a parameter block and makes a reference to it. The RingDriver also maintains indirect references to the nodes in the system object. It creates a container of indirect references (IIndirectRefTargContainer) and makes a reference to it. The RingDriver ensures that the container's size is updated when the user changes the number of nodes in the Ring Array, and sets up the container's elements with the pointers to the nodes by calling RingDriver::SetDrivenNode(int I, INode* node). To find out more about indirect references, see Indirect References.

The RingDriverCreationManager maintains a reference to the first driven node that it creates. This is done so it receives notification when the driven node is selected, deselected or deleted. This class is responsible for managing the editing of the Ring Array user interface parameters. When the selected driven node is deselected it indicates that the creation process is to begin on a new Ring Array. The user can no longer adjust the spinners in the UI and update the existing Ring Array. Therefore when the user deselects the node (via Edit / Select None) the creation manager calls EndEditParams() on the RingDriver to terminate the editing of the parameters. Note that Edit / Select None is the only way that this can happen. If the user were to choose the Select Object tool and deselect the node, the RingDriverCreateMode command mode would be replaced by the Select Object command mode and the entire process would be finished. If however the user selected Edit / Select None the node would be deselected but the Ring Array command mode would still be active.

The drivenController makes a reference to the RingDriver object it uses to calculate its value. Because the driven controller has a pointer to the RingDriver it is dependent upon its existence. To indicate to the system that the dependency exists, it creates a reference to the RingDriver. If the user changes the parameters of the RingDriver 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 be redrawn in the next screen update.