Home | Hierarchy | Members | Alphabetical | Related Pages |
#include <triangulator.h>
Public Types | |
typedef P | PointType |
typedef std::list< Face >::const_iterator | face_const_iterator |
Public Member Functions | |
template<class T> | |
Triangulator (T first, const T &last) | |
void | process () throw (std::runtime_error) |
unsigned int | faces_size () const |
face_const_iterator | faces_begin () const |
face_const_iterator | faces_end () const |
Protected Member Functions | |
bool | snip (const int u, const int v, const int w, const int nv) |
int | nbPoints () const |
const PointType & | point (const int i) const |
void | addFace (const int u, const int v, const int w) |
Static Protected Member Functions | |
static bool | isInTriangle (const PointType &A, const PointType &B, const PointType &C, const PointType &M) |
Classes | |
class | Face |
The code is fully templated which means it can be used with any type of point and any type of sequence.
Here is an exemple of use, where Vec2 is a trivial 2D point type:
list<Vec2> polygon; polygon.push_back(Vec2(0.0f,0.0f)); polygon.push_back(Vec2(1.0f,0.0f)); polygon.push_back(Vec2(1.0f,1.0f)); polygon.push_back(Vec2(0.0f,1.0f)); Triangulator<Vec2> triangulator(polygon.begin(),polygon.end()); triangulator.process(); for (Triangulator<Vec2>::face_const_iterator fter = triangulator.faces_begin(); fter != triangulator.faces_end();++fter) { cout<<"face joining\n" <<" "<<*(fter->vertex(0)) <<" "<<*(fter->vertex(1))<<endl; }
typedef P PointType |
typedef std::list<Face>::const_iterator face_const_iterator |
Triangulator | ( | T | first, | |
const T & | last | |||
) | [inline] |
void process | ( | ) | throw (std::runtime_error) [inline] |
unsigned int faces_size | ( | ) | const [inline] |
Triangulator< P >::face_const_iterator faces_begin | ( | ) | const [inline] |
Triangulator< P >::face_const_iterator faces_end | ( | ) | const [inline] |
static bool isInTriangle | ( | const PointType & | A, | |
const PointType & | B, | |||
const PointType & | C, | |||
const PointType & | M | |||
) | [inline, static, protected] |
bool snip | ( | const int | u, | |
const int | v, | |||
const int | w, | |||
const int | nv | |||
) | [inline, protected] |
int nbPoints | ( | ) | const [inline, protected] |
const P & point | ( | const int | i | ) | const [inline, protected] |
void addFace | ( | const int | u, | |
const int | v, | |||
const int | w | |||
) | [inline, protected] |
Generated on 5 Jan 2007 with
![]() |
|