PEXGeoNormSetOfFillAreaSets(3) — Subroutines
Name
PEXGeoNormSetOfFillAreaSets
Synopsis
int PEXGeoNormSetOfFillAreaSets(unsigned int facet_attributes, unsigned int vertex_attributes, int color_type, unsigned int set_count, PEXArrayOfFacetData facet_data, unsigned int vertex_count, PEXArrayOfVertex vertices, unsigned int index_count, PEXConnectivityData ∗connectivity)
Arguments
facet_attributes
A mask indicating the facet attributes provided. It should contain the bit PEXGANormal.
vertex_attributes
A mask indicating the vertex attributes provided.
color_typeThe type of color data provided.
set_countThe number of fill area sets.
facet_dataAn array of facet data. This function adds the geometric normals to this data.
vertex_countThe number of vertices.
verticesAn array of vertices.
index_countThe number of vertex connectivity indices.
connectivityA pointer to the list of contour connectivity data.
Returns
Zero if successful; otherwise, one of the following:
PEXBadPrimitive - A normal cannot be computed for a fill area set because all its fill areas are degenerate or because all the vertices of all fill areas in the set are colinear.
Description
This function computes the geometric normals of set of fill area sets primitive and stores them in the specified facet data.
The normals are computed by finding the first three non-colinear points in each fill area set, beginning with the first fill area of each set and searching until three such points are found in a single fill area. Two vectors are formed from these points: one vector from the first point to the second point, and one vector from the first point to the third point. The geometric normal returned is the normalized cross product of these two vectors.
The three points for each fill area set are selected as described for PEXGeoNormFillAreaSet.
If the facet attributes does not contain the bit PEXGANormal, the geometric normal is not computed. However, the function still returns successfully.
A geometric normal is computed for all fill area sets where it is possible to compute one, even if a normal cannot be computed for some other fill area sets. The function returns unsuccessfully if a normal cannot be computed for one or more of the fill area sets.
Data Structures
typedef struct {
unsigned short count;
PEXListOfUShort ∗lists;
} PEXConnectivityData;
typedef struct {
unsigned short count;
unsigned short ∗shorts;
} PEXListOfUShort;
See also the PEXStructuresman page.
Errors
None