# Mesh Library - Vertex

 Sturcture: Vertex source: edge.c

Definition:
```struct vertex{

Id        vertexno;
HalfEdge  *vedge;
double    gauss_cur;
double    vcoord[3];
double    ncoord[3];

Vertex    *next;
Vertex    *prev;

int      alivev;
};
```

Data Members:
• vertexno - Id of current vertex
• vedge - the halfedge , which has current vertex as starting vertex
• gauss_cur - gaussian curvature of current vertex
• vcoord - coordinates of the vertex
• ncoord - coordinates of the normal attached to the vertex
• next,prev - vertex pointers in vertex list, no geometric meaning
• alivev - indicating if the vertex is alive

Methods:
• Id VertexIDReset();
During the construction of vertex list, a static in variable is used to indicating the Ids of vertices. After the construction of the vertex list, call this function to reset this static variable.

• void VertexConstruct( Solid ** s, double x, double y, double z );
Construct a vertex with coordinates (x,y,z) and add it to the vertex list of solid s.

• oid VertexConstructN( Solid ** s, double x, double y, double z,double nx , double ny, double nz);
Construct a vertex with coordinates (x,y,z) and normal (nx,ny,nz), and add it to the vertex list of sold s.

• void VertexDestruct( Vertex ** v);
Desctruct the vertex v

• HalfEdge * VertexFirstOutHalfEdge( Vertex * v);
Return the first halfedge issuing out from vertex v.

• HalfEdge * VertexNextOutHalfEdge( HalfEdge * h);
Return the adjacent halfedge r of h, such that r and h shares the same starting vertex, and the rotation from h to r is ccw

• HalfEdge * VertexFirstInHalfEdge( Vertex * v);
Return the first halfedge entering vertex v

• HalfEdge * VertexNextInHalfEdge( HalfEdge * h);
Return the adjacent halfedge r of h, such that r and h shares the same ending vertex, and the rotation from h to r is ccw

• Face * VertexFirstFace( Vertex * v );
Find the first face attached to v

• Face * VertexNextFace( Vertex * v , Face * f );
Find the next face g attached to v, the rotation from f to g is ccw

• Vertex * VertexFirstVertex( Vertex * v);
Return the first vertex attached to vertex

• Vertex * VertexNextVertex( Vertex * v, Vertex * w);
W is a vertex attached to vertex v.Return the next vertex u attached to vertex v, (u,v,w) is ccw

• void VertexCheckConsistency( Vertex * v);
Check if vertex v is convex locally.

• int VertexCheckNeighorConvexity( Vertex * v);
Check if the neighborhood of vertex v is consistent with manifold structure