Surface isolines and teselation control

The TGrafBundle and TGrafBundle3D classes have the following functions for getting, adopting, and orphaning attributes in addition to the standard set of attributes to which the Adopt functions of the attribute bundle provide access.

      virtual void AdoptGrafAttribute( TGrafAttribute* adoptedAttribute );
      virtual TGrafAttribute* OrphanGrafAttribute( const TToken& attributeName );
      virtual const TGrafAttribute* GetGrafAttribute( const TToken& attributeName ) const;
An attribute is adopted by passing a TGrafAttribute instance to the AdoptGrafAttribute function. As shown in the function declarations and in Figure 208, the TGrafAttribute instance uses a token, which is a string of text that represents the attribute name. You pass the token to orphan the attribute or to return a constant pointer to the attribute. You can adopt one of the TGrafAttribute derived classes, or you can derive from TGrafAttribute to create your own attribute.


TToken: TToken is constructed from a TText instance. The attribute bundle can hold only one attribute by a particular name. The name provided by the text string in the token is used, not the name of the TGrafAttribute instance. If a new attribute is adopted by a bundle that has the same name as an attribute already in the bundle, the new attribute replaces the old attribute.

TSurfaceIsolines: This class is a 3D attribute that can be adopted by TGrafBundle3D. This attribute tells the renderer the number of isolines to draw on a 3-D surface (a TGSurface3D). Isolines (also known as isoparametric lines) are quasi-parallel curves that run along a curved surface in one parametrid direction. A surface has two parametric directions that are roughly perpendicular, so the siolines along one direction cross the isolines along the other to divide the surface into four-sided pieces. TSurfaceIsolines is used only on frames.

When the value is zero, only the edges of the surface are drawn. By default, the number of isolines is the number of isolines per span. A span is the region between two control points along one parametric direction of the surface.

TTesselationControl: This class is a 3D attribute that can be adopted by TGrafBundle3D. This attribute tells the tessellator how finely to tessellate (divide into shards) a 3-D surface (TGSurface3D). TTesselationControl is used only on surfaces. This attribute specifies the resolution of tesselation or how large the shards should be. A larger number for the resolution gives a coarser resolution or larger shards.

NOTE See the online Class and Member Function descriptions for more information on TSurfaceIsolines and TTesselationControl.


[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