libsurf
Programmer's Documentation

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DnTriangle Class Reference

Detailed Description

Triangle in 3D Delaunay triangulation.

DnTriangle contains indices to its vertices, to three edges, and data about its circumsphere.

See Also
DnMesh

#include <dntriangle.h>

Public Member Functions

 DnTriangle (uint a, uint b, uint c)
 create new triangle
 
void reconnect (uint a, uint b, uint c)
 change triangle vertices
 
void computeSphere (const Surface &, const DnVertexArray &vtx, bool spt)
 compute circumsphere
 
bool isValid () const
 check if triangle is defined
 
bool hasDuplicates () const
 check if triangle has duplicate vertices
 
void invalidate ()
 mark triangle as invalid
 
const uint * vertices () const
 access vertices
 
const uint * nbEdges () const
 access neighbor edges
 
uint * nbEdges ()
 access neighbor edges
 
void reverse ()
 reverse normal vector
 
void itranslate (const Indices &repl)
 translate vertex indices
 
uint opposedVertex (const DnEdge &e) const
 find vertex opposed to edge e
 
uint replaceVertex (uint vold, uint vnew)
 replace a single vertex index
 
uint attachEdge (uint ei)
 add edge to neighbor list
 
uint detachEdge (uint ei)
 remove edge from neighbor list
 
uint replaceEdge (uint fold, uint fnew)
 replace neighbor edge
 
Vct3 normal (const DnVertexArray &vtx) const
 compute normal vector (not normalized)
 
Vct2 pCenter (const DnVertexArray &vtx) const
 center in parametric space
 
Vct3 sCenter (const DnVertexArray &vtx) const
 center in real space
 
Vct2 pCircumCenter (const DnVertexArray &vtx) const
 compute parametric circumcenter
 
Vct3 sCircumCenter (const DnVertexArray &vtx) const
 compute spatial circumcenter
 
int isInside (const DnEdgeArray &edges, const DnVertexArray &vtx, const Vct2 &p) const
 Check if point is inside triangle. More...
 
int inCircle (const DnVertexArray &vtx, uint i) const
 Check if point is in circumcircle (uv-plane). More...
 
int inSphere (const DnVertexArray &vtx, uint i) const
 check if point is inside circumsphere
 
Vct3 project (const DnVertexArray &vtx, const Vct3 &pt) const
 compute projection (ut,vt,wt) of a 3D point on triangle
 
Vct2 sProject (const DnVertexArray &vtx, const Vct3 &pt) const
 compute projection (u,v) of a 3D point on mesh surface
 
void pFixDirection (const DnVertexArray &vtx)
 make sure that the normal direction is correct (u,v space)
 
void sFixDirection (const DnVertexArray &vtx)
 make sure that the normal direction is correct (3-space)
 
uint find (uint v) const
 find index of vertex index v
 
uint findEdge (uint e) const
 find index of edge index e
 

Private Member Functions

void order (uint a, uint b, uint c)
 establish correct ordering
 
bool touchesUBound (const DnVertexArray &vtx) const
 decide if triangle touches a u-boundary with at vertex
 

Private Attributes

Vct3 pcs
 point on circumsphere
 
uint vi [3]
 vertex indices
 
uint nbe [3]
 neighbor edges
 

Member Function Documentation

int DnTriangle::inCircle ( const DnVertexArray &  vtx,
uint  i 
) const
inline

Check if point is in circumcircle (uv-plane).

Returns a positive value if i is inside, 0 if on, or negative if i is outside the circumcircle of the triangles vertices.

int DnTriangle::isInside ( const DnEdgeArray &  edges,
const DnVertexArray &  vtx,
const Vct2 &  p 
) const
inline

Check if point is inside triangle.

Returns 0,1,2 if p is exactly on the corresponding edge, -1 if it is inside the triangle, but not on the edge, and -2 if p is outside.


The documentation for this class was generated from the following file:
Generated on Wed Jan 19 2022 03:03:16 for libsurf by   doxygen 1.8.5