pfMeshVertex(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfMeshVertexCoord, pfGetMeshVertexCoord, pfMeshVertexCoordPtr,
pfGetMeshVertexCoordPtr, pfMeshVertexNextVertex,
pfGetMeshVertexNextVertex, pfMeshVertexNumNeighbors,
pfGetMeshVertexNumNeighbors, pfMeshVertexSetNeighbor,
pfGetMeshVertexNeighbor, pfPreviousNeighborMeshVertex,
pfPreviousNeighborIndexMeshVertex, pfNextNeighborMeshVertex,
pfNextNeighborIndexMeshVertex, pfFlagsMeshVertex, pfGetMeshVertexFlags -
Stores vertex as a part of a pfMesh
FUNCTION SPECIFICATION
#include <Performer/pf.h>
void pfMeshVertexCoord(pfMeshVertex* meshvertex,
pfVec3 *v);
pfVec3* pfGetMeshVertexCoord(pfMeshVertex* meshvertex);
void pfMeshVertexCoordPtr(pfMeshVertex* meshvertex,
pfVec3 *v);
pfVec3* -
pfGetMeshVertexCoordPtr(pfMeshVertex* meshvertex);
void pfMeshVertexNextVertex(pfMeshVertex* meshvertex,
int v);
int -
pfGetMeshVertexNextVertex(pfMeshVertex* meshvertex);
void -
pfMeshVertexNumNeighbors(pfMeshVertex* meshvertex,
int n);
int -
pfGetMeshVertexNumNeighbors(pfMeshVertex* meshvertex);
void pfMeshVertexSetNeighbor(pfMeshVertex* meshvertex,
int i, pfMeshVertexNeighbor *n);
pfMeshVertexNeighbor* pfGetMeshVertexNeighbor(pfMeshVertex* meshvertex,
int i);
pfMeshVertexNeighbor* -
pfPreviousNeighborMeshVertex(pfMeshVertex* meshvertex,
int v1);
int -
pfPreviousNeighborIndexMeshVertex(pfMeshVertex* meshvertex,
int v1);
Page 1
pfMeshVertex(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfMeshVertexNeighbor* -
pfNextNeighborMeshVertex(pfMeshVertex* meshvertex,
int v1);
int -
pfNextNeighborIndexMeshVertex(pfMeshVertex* meshvertex,
int v1);
void pfFlagsMeshVertex(pfMeshVertex* meshvertex,
int which, int value);
int pfGetMeshVertexFlags(pfMeshVertex* meshvertex,
int which);
DESCRIPTION
A pfMeshVertex is a high level OpenGL Performer class. A pfMeshVertex is
used in a pfMesh to store information about vertices. A pfMeshVertex
stores vertex coordinates, the pointer to the original vertex coordinates
(to be able to detect local changes in the mesh), an array of vertex
neighbors, a set of binary flags and an index of another vertex at the
same location (used for non-manifolds, see below).
The vertex coordinates and the pointer to the original coordinates are
set using pfMeshVertexCoord and pfMeshVertexCoordPtr. The value set by
pfMeshVertexCoord should correspond to the value at location set by
pfMeshVertexCoordPtr. If the supplied pointer is NULL (for example, in
case that a pfGeoSet was under a pfSCS node) it is not possible to
automatically detect changes in position of vertices and the user have to
modify all the vertices manually by calling pfMeshVertexCoord. In case
you do not plan to animate the mesh you can set the pointer to NULL.
Each vertex stores an array of its neighbors. You can query the
neighbors using functions pfMeshVertexNumNeighbors and
pfMeshVertexNeighbor. The structure pfMeshVertexNeighbor is defined in
pf.h as follows:
typedef struct
{
int vertex;
int face;
short int edgeType;
short int next, prev;
} pfMeshVertexNeighbor;
This structure consists of the vertex index (in the array of vertices in
pfMesh), face index (in the array of faces in pfMesh), edge type and
index of the next and previous neighbor in the array of neighbors. The
edge can be of the following type:
Page 2
pfMeshVertex(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
PFM_EDGE_NORMAL smooth edge with two adjacent faces
PFM_EDGE_CREASE sharp edge with two adjacent faces
+PFM_EDGE_BOUNDARY edge with one adjacent face to the left of the
edge
-PFM_EDGE_BOUNDARY
edge with one adjacent face to the right of the edge
The face is the face to the left of the edge (unless the edge is marked
as -PFM_EDGE_BOUNDARY). The next neighbor is part of this face and the
previous neighbor is part of the face to the left. If the edge is of type
-PFM_EDGE_BOUNDARY the next neighbor points to the corresponding edge of
type +PFM_EDGE_BOUNDARY and the previous neighbors of the edge of type
+PFM_EDGE_BOUNDARY points to the the corresponding edge of type
+PFM_EDGE_BOUNDARY. Note that in case of manifolds each vertex has are
exactly zero or two boundary edges.
In case of arbitrary surfaces there may be more than one loop of
neighbors (if you follow the next links). That is why the class pfMesh
provides a function pfMeshSplitVertices that splits each vertex at which
the surface behaves as non-manifold. The vertex is split into several
vertices with the same position, each having a single loop of ordered
neighbors.
You can access the next and previous neighbor for a given neighbor with
vertex indexed v1 by calling pfPreviousNeighborMeshVertex and
pfNextNeighborMeshVertex. You can also determine the index of such
neighbor in the array of neighbors by calling
pfPreviousNeighborIndexMeshVertex and pfNextNeighborIndexMeshVertex.
The following flags can be set for each pfMeshVertex:
PFMV_FLAG_VERTEX_CHANGED set by function
pfMeshUpdateMesh when the coordinate stored at
the vertex does not match the value at the
coordinate pointer
PFMV_FLAG_VERTEX_NEIGHBOR_CHANGED
set by function pfMeshUpdateMesh when position of
any neighbor changes
PFMV_FLAG_VERTEX_FACE_CHANGED
set by function pfMeshUpdateMesh when position of
any vertex on any of the faces associated with
this vertex changes
Page 3
pfMeshVertex(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
PFMV_FLAG_VERTEX_SPLIT
set by function pfMeshSplitVertices when surface
around the vertex is not manifold and the vertex
is split into several vertices (see above)
SEE ALSO
pfMesh, pfMeshFace, pfObject, pfNode
Page 4