Triangulation class for the half-edge data structure with adaption to TTL. More...
#include <ttl/halfedge/HeTriang.h>
Public Member Functions | |
Triangulation () | |
Default constructor. | |
Triangulation (const Triangulation &tr) | |
Copy constructor. | |
~Triangulation () | |
Destructor. | |
void | createDelaunay (vector< Node * >::iterator first, vector< Node * >::iterator last) |
Creates a Delaunay triangulation from a set of points. | |
Edge * | initTwoEnclosingTriangles (vector< Node * >::iterator first, vector< Node * >::iterator last) |
Creates an initial Delaunay triangulation from two enclosing triangles. | |
void | swapEdge (Edge &diagonal) |
Swaps the edge associated with diagonal. | |
Edge * | splitTriangle (Edge &edge, Node &point) |
Splits the triangle associated with edge into three new triangles joining at point. | |
void | removeTriangle (Edge &edge) |
Removes the boundary triangle associated with edge. | |
void | reverse_splitTriangle (Edge &edge) |
The reverse operation of removeTriangle. | |
Dart | createDart () |
Creates an arbitrary CCW dart. | |
const list< Edge * > & | getLeadingEdges () const |
Returns a list of "triangles" (one leading half-edge for each triangle). | |
int | noTriangles () const |
Returns the number of triangles. | |
list< Edge * > * | getEdges (bool skip_boundary_edges=false) const |
Returns a list of half-edges (one half-edge for each arc). | |
void | flagNodes (bool flag) const |
Sets flag in all the nodes. | |
list< Node * > * | getNodes () const |
Returns a list of nodes. This function requires TTL_USE_NODE_FLAG to be defined. | |
void | optimizeDelaunay () |
Swaps edges until the triangulation is Delaunay (constrained edges are not swapped). | |
bool | checkDelaunay () const |
Checks if the triangulation is Delaunay. | |
Edge * | getInteriorNode () const |
Returns an arbitrary interior node (as the source node of the returned edge). | |
Edge * | getBoundaryEdge () const |
Returns an arbitrary boundary edge. | |
void | printEdges (ofstream &os) const |
Print edges for plotting with, e.g., gnuplot. | |
Protected Member Functions | |
void | addLeadingEdge (Edge *edge) |
bool | removeLeadingEdgeFromList (Edge *leadingEdge) |
void | cleanAll () |
Protected Attributes | |
list< Edge * > | leadingEdges_ |
Triangulation class for the half-edge data structure with adaption to TTL.
Definition at line 206 of file HeTriang.h.
hed::Triangulation::Triangulation | ( | ) | [inline] |
hed::Triangulation::Triangulation | ( | const Triangulation & | tr | ) | [inline] |
Copy constructor.
Definition at line 219 of file HeTriang.h.
hed::Triangulation::~Triangulation | ( | ) | [inline] |
void hed::Triangulation::addLeadingEdge | ( | Edge * | edge | ) | [inline, protected] |
Definition at line 210 of file HeTriang.h.
References leadingEdges_, and hed::Edge::setAsLeadingEdge().
00210 { edge->setAsLeadingEdge(); leadingEdges_.push_front(edge); }
bool hed::Triangulation::checkDelaunay | ( | ) | const |
Checks if the triangulation is Delaunay.
void hed::Triangulation::cleanAll | ( | ) | [protected] |
Referenced by ~Triangulation().
Dart hed::Triangulation::createDart | ( | ) |
Creates an arbitrary CCW dart.
void hed::Triangulation::createDelaunay | ( | vector< Node * >::iterator | first, | |
vector< Node * >::iterator | last | |||
) |
Creates a Delaunay triangulation from a set of points.
void hed::Triangulation::flagNodes | ( | bool | flag | ) | const |
Sets flag in all the nodes.
Edge* hed::Triangulation::getBoundaryEdge | ( | ) | const |
Returns an arbitrary boundary edge.
list<Edge*>* hed::Triangulation::getEdges | ( | bool | skip_boundary_edges = false |
) | const |
Returns a list of half-edges (one half-edge for each arc).
Edge* hed::Triangulation::getInteriorNode | ( | ) | const |
Returns an arbitrary interior node (as the source node of the returned edge).
const list<Edge*>& hed::Triangulation::getLeadingEdges | ( | ) | const [inline] |
Returns a list of "triangles" (one leading half-edge for each triangle).
Definition at line 260 of file HeTriang.h.
References leadingEdges_.
00260 { return leadingEdges_; }
list<Node*>* hed::Triangulation::getNodes | ( | ) | const |
Returns a list of nodes. This function requires TTL_USE_NODE_FLAG to be defined.
Edge* hed::Triangulation::initTwoEnclosingTriangles | ( | vector< Node * >::iterator | first, | |
vector< Node * >::iterator | last | |||
) |
Creates an initial Delaunay triangulation from two enclosing triangles.
int hed::Triangulation::noTriangles | ( | ) | const [inline] |
Returns the number of triangles.
Definition at line 263 of file HeTriang.h.
References leadingEdges_.
00263 { return leadingEdges_.size(); }
void hed::Triangulation::optimizeDelaunay | ( | ) |
Swaps edges until the triangulation is Delaunay (constrained edges are not swapped).
void hed::Triangulation::printEdges | ( | ofstream & | os | ) | const |
Print edges for plotting with, e.g., gnuplot.
bool hed::Triangulation::removeLeadingEdgeFromList | ( | Edge * | leadingEdge | ) | [protected] |
void hed::Triangulation::removeTriangle | ( | Edge & | edge | ) |
Removes the boundary triangle associated with edge.
Referenced by hed::TTLtraits::removeBoundaryTriangle().
void hed::Triangulation::reverse_splitTriangle | ( | Edge & | edge | ) |
The reverse operation of removeTriangle.
Referenced by hed::TTLtraits::reverse_splitTriangle().
Splits the triangle associated with edge into three new triangles joining at point.
Referenced by hed::TTLtraits::splitTriangle().
void hed::Triangulation::swapEdge | ( | Edge & | diagonal | ) |
Swaps the edge associated with diagonal.
Referenced by hed::TTLtraits::swapEdge().
list<Edge*> hed::Triangulation::leadingEdges_ [protected] |
Definition at line 209 of file HeTriang.h.
Referenced by addLeadingEdge(), getLeadingEdges(), and noTriangles().