tpp::Delaunay Class Reference

The main Delaunay Class that wraps around triangle. More...

#include <del_interface.hpp>

List of all members.

Public Types

typedef reviver::dpoint< double, 2 > Point
 Point Typedef.

Public Member Functions

 Delaunay (std::vector< Point > &v)
 The main constructor.
void Triangulate ()
 Delaunay Triangulate the input points.
void writeoff (std::string &fname)
 Output a geomview .off file containing the delaunay triangulation.
int nedges ()
 Number of edges in the triangulation.
int ntriangles ()
 Number of triangles in the triangulation.
int nvertices ()
 Number of vertices in the triangulation.
int hull_size ()
 Number of vertices on the convex hull.
 ~Delaunay ()
 The main destructor.
vIterator vbegin ()
 Vertex iterator begin function.
vIterator vend ()
 Vertex iterator end function.
int vertexId (vIterator const &)
 Given an iterator, find its index in the input vector of points.
const Pointpoint_at_vertex_id (int i)
 Given an index, return the actual double Point.
fIterator fbegin ()
 Face iterator begin function.
fIterator fend ()
 Face iterator end function.
int faceId (fIterator const &)
int Org (fIterator const &fit)
 Access the origin (Org) vertex of a face.
int Dest (fIterator const &fit)
 Access the destination (Dest) vertex of a face.
int Apex (fIterator const &fit)
 Access the apex (Apex) vertex of a face.
int Sym (fIterator const &fit, char i)
 Access the triangle adjoining edge i.
fIterator Sym (fIterator const &fit)
 Access the triangle opposite to current edge of the face.
bool empty (fIterator const &fit)
 Is the iterator empty?
bool isdummy (fIterator const &fit)
 Is the iterator pointing to the dummy triangle?
fIterator Lnext (fIterator const &fit)
 Find the next edge (counterclockwise) of a triangle.
fIterator Lprev (fIterator const &fit)
 Find the previous edge (clockwise) of a triangle.
fIterator Onext (fIterator const &fit)
 Find the next edge (counterclockwise) of a triangle with the same origin.
fIterator Oprev (fIterator const &fit)
 Find the next edge clockwise with the same origin.
void trianglesAroundVertex (int vertexid, std::vector< int > &ivv)
 Calculate incident triangles around a vertex.
double area (fIterator const &fit)
 Calculate the area of a face.
fIterator locate (int vertexid)
 Point locate a vertex v.

Friends

class vIterator
class fIterator

Classes

class  fIterator
 The face iterator for the Delaunay class. More...
class  vIterator
 The vertex iterator for the Delaunay class. More...


Detailed Description

The main Delaunay Class that wraps around triangle.

This is a C++ wrapper of the triangle package by JRS. It currently uses the dpoint class written by me (the point class is a d-dimensional point class but for this application it only uses the d=2 case).

Definition at line 126 of file del_interface.hpp.


Member Typedef Documentation

typedef reviver::dpoint<double, 2> tpp::Delaunay::Point
 

Point Typedef.

Warning: If you want to use your own point class, you might have to work hard...

Definition at line 132 of file del_interface.hpp.


Constructor & Destructor Documentation

tpp::Delaunay::Delaunay std::vector< Point > &  v  )  [inline]
 

The main constructor.

Takes a vector of 2 dimensional points where each of the coordinates is expressed as double.

Definition at line 151 of file del_interface.hpp.

tpp::Delaunay::~Delaunay  ) 
 

The main destructor.

Does memory cleanup mostly.

Definition at line 73 of file del_impl.cpp.


Member Function Documentation

int tpp::Delaunay::Apex fIterator const &  fit  ) 
 

Access the apex (Apex) vertex of a face.

Parameters:
fit Face interator.
Returns:
Index of the vertex in pList.
A triangle abc has origin (org) a,destination (dest) b, and apex (apex) c. These vertices occur in counterclockwise order about the triangle. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 332 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, tpp::Delaunay::fIterator::MyDelaunay, and pmesh.

Referenced by area(), and trianglesAroundVertex().

double tpp::Delaunay::area fIterator const &  fit  ) 
 

Calculate the area of a face.

Parameters:
fit Face interator.
Returns:
area of the face associated with the iterator.

Definition at line 410 of file del_impl.cpp.

References Apex(), Dest(), Org(), and point_at_vertex_id().

int tpp::Delaunay::Dest fIterator const &  fit  ) 
 

Access the destination (Dest) vertex of a face.

Parameters:
fit Face interator.
Returns:
Index of the vertex in pList.
A triangle abc has origin (org) a,destination (dest) b, and apex (apex) c. These vertices occur in counterclockwise order about the triangle. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 313 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, tpp::Delaunay::fIterator::MyDelaunay, and pmesh.

Referenced by area(), and trianglesAroundVertex().

bool tpp::Delaunay::empty fIterator const &  fit  )  [inline]
 

Is the iterator empty?

Parameters:
fit Face interator.
Returns:
true if the iterator is empty

Definition at line 375 of file del_interface.hpp.

References tpp::Delaunay::fIterator::floop.

int tpp::Delaunay::faceId fIterator const &   ) 
 

fIterator tpp::Delaunay::fbegin  )  [inline]
 

Face iterator begin function.

Definition at line 285 of file del_interface.hpp.

References fIterator.

Delaunay::fIterator tpp::Delaunay::fend  ) 
 

Face iterator end function.

Definition at line 256 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop.

int tpp::Delaunay::hull_size  ) 
 

Number of vertices on the convex hull.

Returns:
Number of vertices on the convex hull. Remember to call Triangulate before using this function.

Definition at line 128 of file del_impl.cpp.

Referenced by main().

bool tpp::Delaunay::isdummy fIterator const &  fit  )  [inline]
 

Is the iterator pointing to the dummy triangle?

Parameters:
fit Face interator.
Returns:
true if the iterator is of the dummy triangle.

Definition at line 526 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop.

Referenced by trianglesAroundVertex().

Delaunay::fIterator tpp::Delaunay::Lnext fIterator const &  fit  )  [inline]
 

Find the next edge (counterclockwise) of a triangle.

Parameters:
fit face iterator
Returns:
The face iterator corresponding to the next counterclockwise edge of a triangle
Lnext(abc) -> bca. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 460 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, and tpp::Delaunay::fIterator::MyDelaunay.

Delaunay::fIterator tpp::Delaunay::locate int  vertexid  ) 
 

Point locate a vertex v.

Parameters:
vertexid vertex id
Returns:
a face iterator whose origin is v.

Definition at line 424 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, and tpp::Delaunay::fIterator::MyDelaunay.

Referenced by trianglesAroundVertex().

Delaunay::fIterator tpp::Delaunay::Lprev fIterator const &  fit  )  [inline]
 

Find the previous edge (clockwise) of a triangle.

Parameters:
fit face iterator
Returns:
The face iterator corresponding to the previous clockwise edge of a triangle
Lprev(abc) -> cab. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 471 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, and tpp::Delaunay::fIterator::MyDelaunay.

int tpp::Delaunay::nedges  ) 
 

Number of edges in the triangulation.

Returns:
Number of Edges Remember to call Triangulate before using this function.

Definition at line 104 of file del_impl.cpp.

Referenced by main().

int tpp::Delaunay::ntriangles  ) 
 

Number of triangles in the triangulation.

Returns:
Number of Triangles Remember to call Triangulate before using this function.

Definition at line 109 of file del_impl.cpp.

Referenced by main().

int tpp::Delaunay::nvertices  ) 
 

Number of vertices in the triangulation.

Returns:
Number of Vertices Remember to call Triangulate before using this function.

Definition at line 114 of file del_impl.cpp.

Referenced by main().

Delaunay::fIterator tpp::Delaunay::Onext fIterator const &  fit  )  [inline]
 

Find the next edge (counterclockwise) of a triangle with the same origin.

Parameters:
fit face iterator
Returns:
The face iterator corresponding to the next edge counterclockwise with the same origin.
Onext(abc) -> ac*. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 486 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, and tpp::Delaunay::fIterator::MyDelaunay.

Referenced by trianglesAroundVertex().

Delaunay::fIterator tpp::Delaunay::Oprev fIterator const &  fit  )  [inline]
 

Find the next edge clockwise with the same origin.

Parameters:
fit face iterator
Returns:
The face iterator corresponding to the next edge clockwise with the same origin.
Onext(abc) -> a*b. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 508 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, and tpp::Delaunay::fIterator::MyDelaunay.

Referenced by trianglesAroundVertex().

int tpp::Delaunay::Org fIterator const &  fit  ) 
 

Access the origin (Org) vertex of a face.

Parameters:
fit Face interator.
Returns:
Index of the vertex in pList.
A triangle abc has origin (org) a,destination (dest) b, and apex (apex) c. These vertices occur in counterclockwise order about the triangle. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 293 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, tpp::Delaunay::fIterator::MyDelaunay, and pmesh.

Referenced by area(), and trianglesAroundVertex().

const Point& tpp::Delaunay::point_at_vertex_id int  i  )  [inline]
 

Given an index, return the actual double Point.

Definition at line 245 of file del_interface.hpp.

Referenced by area().

Delaunay::fIterator tpp::Delaunay::Sym fIterator const &  fit  ) 
 

Access the triangle opposite to current edge of the face.

Parameters:
fit Face iterator
Returns:
The iterator of the opposite face
A triangle abc has origin (org) a,destination (dest) b, and apex (apex) c. These vertices occur in counterclockwise order about the triangle. The iterator to the triangle is returned. The iterator is empty if the edge is on the convex hull. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 380 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, tpp::Delaunay::fIterator::MyDelaunay, and pmesh.

int tpp::Delaunay::Sym fIterator const &  fit,
char  i
 

Access the triangle adjoining edge i.

Parameters:
fit Face Iterator
i edge number
Returns:
The vertex on the opposite face
A triangle abc has origin (org) a,destination (dest) b, and apex (apex) c. These vertices occur in counterclockwise order about the triangle.
  • sym(abc, 0) -> ba*
  • sym(abc, 1) -> cb*
  • sym(abc, 2) -> ac*
is the farthest vertex on the adjoining triangle whose index is returned. A -1 is returned if the edge is part of the convex hull. Remember to call Triangulate before using this function. Do not use it on a null iterator.

Definition at line 351 of file del_impl.cpp.

References tpp::Delaunay::fIterator::floop, tpp::Delaunay::fIterator::MyDelaunay, and pmesh.

void tpp::Delaunay::trianglesAroundVertex int  vertexid,
std::vector< int > &  ivv
 

Calculate incident triangles around a vertex.

Parameters:
vertexid The vertex for which you want incident triangles.
ivv Returns triangles around a vertex in counterclockwise order.
Note that behaviour is undefined if vertexid is greater than number of vertices - 1. Remember to call Triangulate before using this function. All triangles returned have Org(triangle) = vertexid. All triangles returned are in counterclockwise order.

Definition at line 533 of file del_impl.cpp.

References Apex(), Dest(), isdummy(), locate(), Onext(), Oprev(), and Org().

void tpp::Delaunay::Triangulate  )  [inline]
 

Delaunay Triangulate the input points.

This function calls triangle to delaunay triangulate points given as input to the constructor of this class.

Definition at line 161 of file del_interface.hpp.

vIterator tpp::Delaunay::vbegin  )  [inline]
 

Vertex iterator begin function.

Definition at line 237 of file del_interface.hpp.

References vIterator.

Referenced by main().

Delaunay::vIterator tpp::Delaunay::vend  ) 
 

Vertex iterator end function.

Definition at line 173 of file del_impl.cpp.

References tpp::Delaunay::vIterator::vloop.

Referenced by main().

int tpp::Delaunay::vertexId vIterator const &   ) 
 

Given an iterator, find its index in the input vector of points.

Definition at line 133 of file del_impl.cpp.

References tpp::Delaunay::vIterator::MyDelaunay, pmesh, and tpp::Delaunay::vIterator::vloop.

Referenced by main().

void tpp::Delaunay::writeoff std::string &  fname  ) 
 

Output a geomview .off file containing the delaunay triangulation.

Parameters:
fname output file name.

Definition at line 89 of file del_impl.cpp.

Referenced by main().


Friends And Related Function Documentation

friend class fIterator [friend]
 

Definition at line 483 of file del_interface.hpp.

Referenced by fbegin().

friend class vIterator [friend]
 

Definition at line 245 of file del_interface.hpp.

Referenced by vbegin().


The documentation for this class was generated from the following files:
Generated on Fri Nov 3 21:59:03 2006 for Triangle++ by  doxygen 1.4.6