PEXOCCGeoNormIndexedFillAreaSets Utility


Synopsis

 
   int PEXOCCGeoNormIndexedFillAreaSets(
       PEXOCC context,
       unsigned int set_count,
       PEXPointer occ_facet_data,
       unsigned int vertex_count,
       PEXPointer occ_vertex_data,
       unsigned int index_count,
       PEXConnectivityData *connectivity,
       int handedness
   )
 

   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

context
An OC context returned by a successful PEXCreateOCC call.

facet_attributes (OCC)
A mask indicating the facet attributes provided. It should contain the bit PEXGANormal.

vertex_attributes (OCC)
A mask indicating the vertex attributes provided.

color_type (OCC)
The type of color data provided.

facet_fp_data_count (OCC)
The number of optional floating-point numbers for each facet.

surface_vertex_fp_data_count (OCC)
The number of optional floating-point numbers for each vertex.

set_count
The number of fill area sets.

occ_facet_data
A pointer to facet data. This function adds the geometric normal to this data. See Facet / Vertex Data Formats.

facet_data
An array of facet data. This function adds the geometric normals to this data.

vertex_count
The number of vertices.

occ_vertex_data
A pointer to the vertex data. See Facet / Vertex Data Formats.

vertices
An array of vertices.

index_count
The number of vertex connectivity indices.

connectivity
A pointer to the list of contour connectivity data.

data_model (OCC)
Specifies the data model used to represent the geometric data.

data_model_specs (OCC)
Offset and size data for the PEXDataStride or PEXDataUnpacked data models.

handedness
Orientation of the coordinate system assumed by the vertex data (PEXVertexOrderRightHand, PEXVertexOrderLeftHand).

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

Invoke PEXOCCGeoNormIndexedFillAreaSets to compute the geometric normals of the set of fill area sets primitive and store 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 PEXOCCGeoNormFillAreaSet.

PEXGeoNormSetOfFillAreaSets assumes the handedness is PEXVertexOrderRightHand.

Specify the handedness argument to generate normals that match the orientation of the coordinate system that the vertex data uses. PEXVertexOrderRightHand indicates that the coordinate system is right-handed, and PEXVertexOrderLeftHand indicates that the normals are to be "flipped" from the right-handed orientation to match a left-handed coordinate system.

If the facet attributes does not contain the bit PEXGANormal, then the utility does not compute the geometric normal. However, the utility 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.

Errors

None.

See Also

For a list of utilities that compute geometric normals, see Computing Geometric Normals. For a list of related topics, see PEXlib Utilities.