PEXOCCQuadrilateralMesh - Quadrilateral Mesh Primitive (5.0)


Synopsis

 
     void PEXOCCQuadrilateralMesh(
          PEXOCC context,
          PEXPointer occ_facet_data,
          unsigned int col_count,
          unsigned int row_count,
          PEXPointer occ_vertices
     )

 
     void PEXQuadrilateralMesh(
          Display *display,
          XID resource_id,
          PEXOCRequestType req_type,
          int shape_hint,
          unsigned int facet_attributes,
          unsigned int vertex_attributes,
          int color_type,
          PEXArrayOfFacetData facet_data,
          unsigned int col_count,
          unsigned int row_count,
          PEXArrayOfVertex vertices
     )
 

Arguments

context
A pointer to 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).

shape_hint (OCC)
The shape which describes all of the quadrilaterals (PEXShapeComplex, PEXShapeNonConvex, PEXShapeConvex or PEXShapeUnknown).

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

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

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)
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.

occ_facet_data
An array of facet data. . See Facet / Vertex Data Formats.

facet_data
A pointer to the facet data.

col_count
The number of columns in the vertex array.

row_count
The number of rows in the vertex array.

occ_vertices
A pointer a the vertex data which is interpreted as a two-dimensional (row-major) array defining the quadrilateral mesh. See Facet / Vertex Data Formats.

vertices
A two-dimensional (row-major) array of vertices defining the quadrilateral mesh.

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 PEXOCCQuadrilateralMesh to create a quadrilateral mesh primitive output command (PEXOCQuadrilateralMeshFP). If the display is a connection to a PEX 5.1 server, or the Alternate Protocol Level is 5.1, this function will generate a PEXOCQuadrilateralMesh output command instead of a PEXOCQuadrilateralMeshFP output command.

The quadrilateral mesh surface is created from the vertices. The vertex array is accessed in row major order (i.e., the column number varies fastest as vertices are accessed). The (i, j), ((i+1), j), ((i+1), (j+1), and (i, j+1) vertices are connected to create a single facet. The implementation interconnects adjacent vertices until the entire facet network is processed.

If you set the PEXGAEdges bit of the surface vertex attribute, then you specify two surface edge flags with each vertex. This edge data is used if the pipeline state's surface edge flag is PEXOn. For the (ith, jth) vertex, the first edge bit (0x00000001) indicates whether to draw the edge between the ((i-1)th, jth) and (ith, jth) vertices, and the second flag bit (0x00000002) indicates whether to draw the edge between the (ith, (j-1)th) and the (ith, jth) vertex. The first edge flag is ignored for all vertices where i=1 and the second edge is ignored for all vertices where j=1. If the edges vertex attribute is not set, then all edges are drawn if the pipeline state's surface edge flag is PEXOn.

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

If your application does not explicitly provide normals for quadrilaterals, then the normals are computed by taking the cross product of the diagonals. For a quadrilateral with the above vertices, the cross product would be formed as follows:

normal(i,j) = (vertex(i+1, j+1) - vertex(i, j)) * (vertex(i, j+1) - vertex(i+1, j))

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

There must be an entry in the facet data array for each facet, if facet data is indicated by the facet attributes.

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

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 PEXlib 5.1 compatibility primitives similar to this one see: PEXQuadrilateralMesh.

For attributes that affect this primitive, see

For an overview, see Output Command Functions.