PEXOCCIndexedTriangles - Indexed Triangle Primitive (5.2)


Synopsis

 
     void PEXOCCIndexedTriangles(
          PEXOCC context,
          unsigned int all_independent,
          unsigned int num_facets,
          PEXPointer facet_data,
          unsigned int num_verts,
          PEXPointer vertices,
          unsigned int index_count,
          PEXSwitch *per_edge_data,
          unsigned short *connectivity
     )
 

Arguments

context
An OC context returned by a successful PEXCreateOCC call.

display (OCC)
A pointer to a display structure returned by a successful XOpenDisplay call.

resource_id (OCC)
The resource identifier of the renderer or structure.

req_type (OCC)
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

facet_attributes (OCC)
A mask indicating the facet attributes provided (PEXGANone, PEXGAColor, PEXGANormal or PEXGAFloatData).

surface_vertex_attributes (OCC)
A mask indicating the vertex attributes provided (PEXGANone, PEXGAColor, PEXGANormal, PEXGAFloatData or PEXGA2D).

edge_attributes (OCC)
A mask indicating the edge attributes provided (PEXGANone, PEXGAEdges).

color_type (OCC)
The type of color data provided (PEXColorTypeIndexed, PEXColorTypeRGB, PEXColorTypeCIE, PEXColorTypeHSV, PEXColorTypeHLS, PEXColorTypeRGB8, PEXColorTypeRGB16, PEXColorTypeRGBA, PEXColorTypeRGBA8, or PEXColorTypeRGBA16).

facet_fp_data_count (OCC)
Number of floats per facet provided.

surface_vertex_fp_data_count (OCC)
Number of floats per vertex provided.

all_independent
True if vertices are a simple list.

num_facets
Number of facets.

facet_data
A pointer to the facet data. See Facet / Vertex Data Formats.

num_verts
Number of vertices.

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

index_count
The number of vertex connectivity indices (also number of edge flags, if edges are specified).

per_edge_data
Optional edge data.

connectivity
A pointer to the list of triangle 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.

Returns

None.

Description

Invoke PEXOCCIndexedTriangles to create a triangle set primitive output command (PEXOCTriangleSetWithData).

This primitive independently renders each triangle in a set of triangles. A triangle set is a collection of triangles defined by reference into a modeling coordinates vertex list. The vertices are defined in a list of length num_verts such that the first vertex is referenced as vertex 0. The triangles are defined by the connectivity array which consists of num_facets 3-tuples of indices into the vertices. If you indicate that facet data is present with the facet attributes, you must supply facet data for each facet (triangle).

Define the all_independent argument to indicate whether vertices contains a simple list of independent triangles which has a connectivity list assumed to be (0, 1, 2), (3, 4, 5),..., (num_verts-3, num_verts-2, num_verts-1). When all_independent is True, the implementation ignores connectivity. For this case, the PEXOCCTriangles function is simplier.

If you define facet and/or vertex colors, then they are of the type specified by color_type. Otherwise the implementation ignores color_type.

Facet and vertex normals are assumed to be unit length vectors. If you specify a normal that is not unit length, then the result is implementation-dependent.

If you set the PEXGAFloatData bit of the facet attributes and/or vertex attributes, then you must supply extended floating-point data with each facet and/or vertex, respectively. If the PEXGAFloatData facet attribute bit is set, then facet_fp_data_count indicates the number of floating-point values for each facet. If you set the PEXGAFloatData vertex attribute bit, then surface_vertex_fp_data_count indicates the number of floating-point values for each vertex. If you set only one floating-point data attribute bit, then the implementation ignores the count corresponding to the other floating-point data attribute bit. If neither floating-point data attribute bit is set, then the implementation ignores both facet_fp_data_count and surface_vertex_fp_data_count.

If you set the PEXGA2D vertex attribute bit, then the vertex coordinates are of type COORD_2D instead of type COORD_3D.

Edge flags are present in per_edge_data if the PEXGAEdges bit is set in edge_attributes. This edge data is used if the pipeline state's surface edge flag is PEXOn. per_edge_data is a list of 3*num_facets entries, each of which contains a switch (set to either PEXOn or PEXOff) indicating whether the corresponding edge is drawn. Each edge flag specifies whether the edge between vertices is to be rendered. The list corresponds to the order in which vertices and triangles are specified in connectivity, with the first edge flag in per_edge_data corresponding to the edge between the first and second vertices of the first triangle, the second edge flag corresponding to the edge between the second and third vertices, the third edge flag corresponding to the edge between the third and first vertices of the triangle, and so on for each triangle. If the edges bit is not set, the per_edge_data list is empty. If no edge data is supplied, all the edges are drawn if the pipeline state's surface edge flag is PEXOn.

Clipping is similar to Fill Area 3D. See Surfaces - General Attributes.

The basic surface, styled and shaded surface, edge, and data mapping attribute sets are applied to this primitive.

All other aspects of this primitive are the same as PEXOCCFillArea.

Errors

BadPEXOutputCommand
The output command contains an invalid value.

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For primitives similar to this one, see:

There are no PEXlib 5.1 compatibility primitives similar to this one.

For attributes that affect this primitive, see,

For an overview, see Output Command Functions.