4 Data Structures
The entire general polygon can have a set of attributes, and any or all of the vertices of any contour can have a set of attributes.
The orientation of a general polygon is determined by the order of the first three noncolinear and noncoincident vertices in the first contour of the general polygon and by the current orientation style of the model containing the polygon. See the chapter "Style Objects" for more information on orientation styles.
A general polygon is defined by the TQ3GeneralPolygonData
data type. See "Creating and Editing General Polygons," beginning on page 4-87 for a description of the routines you can use to create and edit general polygons. Figure 4-14 shows a general polygon.
typedef struct TQ3GeneralPolygonData { unsigned long numContours; TQ3GeneralPolygonContourData *contours; TQ3GeneralPolygonShapeHint shapeHint; TQ3AttributeSet generalPolygonAttributeSet; } TQ3GeneralPolygonData;The elements of the array of contours pointed to by thenumContours
The number of contours in the general polygon. The value of this field must be at least 1.contours
A pointer to an array of contours that define the general polygon.shapeHint
A constant that specifies the shape of the general polygon. A general polygon's shape hint may be used by a renderer to optimize drawing the polygon. You can use the following constants for shape hints: typedef enum TQ3GeneralPolygonShapeHint { kQ3GeneralPolygonShapeHintComplex, kQ3GeneralPolygonShapeHintConcave, kQ3GeneralPolygonShapeHintConvex } TQ3GeneralPolygonShapeHint; The constantkQ3GeneralPolygonShapeHintComplex
indicates that the general polygon consists of more than one contour, is self-intersecting, or is not known to be either concave or convex. For a general polygon with exactly one contour, the constantkQ3GeneralPolygonShapeHintConcave
indicates that the polygon is concave, and the constantkQ3GeneralPolygonShapeHintConvex
indicates that the polygon is convex.generalPolygonAttributeSet
A set of attributes for the general polygon. The value in this field isNULL
if no general polygon attributes are defined.
contours
field are of type TQ3GeneralPolygonContourData
, defined as follows:
typedef struct TQ3GeneralPolygonContourData { unsigned long numVertices; TQ3Vertex3D *vertices; } TQ3GeneralPolygonContourData;numVertices
The number of vertices in the contour. The value of this field must be at least 3.vertices
A pointer to an array of vertices that define the contour.
Let us know what you think of these prototype pages.
Generated with Harlequin WebMaker