Common MGraphic3D behavior

MGraphic3D is an abstract base class that derives from MDrawable. MDrawable provides the protocols for drawing a 2D or 3D graphic, and MGraphic3D provides the protocols common to all 3D graphics -- obtaining attribute information, transforming the graphic, finding the bounds of the graphic, and detecting whether the graphic has been selected by the user (hit detection).

Figure 143 shows the class relationships for MGraphic3D and MDrawable and lists the MGraphic3D member functions described in this chapter. MDrawable has a pure virtual Draw function that is implemented in the MGraphic3D derived classes. You typically call the Draw function from the TView::DrawContents function to draw into a view and the View system passes the correct TGrafPort to the DrawContents function. Chapter 12 has several DrawContents implementations.


The MGraphic3D constructors are protected and used only when you derive from MGraphic3D to create a custom 3-D graphic. Chapter 11 describes a custom 2-D graphic; the protocol is much the same for a custom 3-D graphic.

Using attribute bundles
Transforming a 3D graphic
Detecting hits

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker