#include <delaunay.h>
Public Members | |||
![]() | ![]() | triangulation ( const double l, const double r, const double t, const double b ) | |
![]() | ![]() | The only constructur for a triangulation. More... | |
![]() | ![]() | virtual | ~triangulation (void) |
![]() | ![]() | bool | corner_point ( const vector2 &p ) const |
![]() | ![]() | Indicate whether a point is one of the corner points of the intitial rectangle. More... | |
![]() | ![]() | bool | border_triangle ( const triangle &t ) const |
![]() | ![]() | Indicate whether a triangle includes one of the corner points of the intitial rectangle. More... | |
![]() | ![]() | bool | contains ( const vector2 &p ) const |
![]() | ![]() | Indicate whether a given point is one of the points of the triangulation. More... | |
![]() | ![]() | const vector< triangle >& | triangles (void) const |
![]() | ![]() | Provide the set of triangles that form the triangulation. More... | |
![]() | ![]() | void | add_point ( const vector2 &p ) |
![]() | ![]() | Add a point to the set of points in the triangulation. More... | |
![]() | ![]() | const double | left |
![]() | ![]() | The x ordinate of the left side of the initial rectangle. | |
![]() | ![]() | const double | right |
![]() | ![]() | The x ordinate of the right side of the initial rectangle. | |
![]() | ![]() | const double | top |
![]() | ![]() | The y ordinate of the top side of the initial rectangle. | |
![]() | ![]() | const double | bottom |
![]() | ![]() | The y ordinate of the bottom side of the initial rectangle. | |
![]() | ![]() | const vector2 | tl |
![]() | ![]() | The top left corner of the initial rectangle. | |
![]() | ![]() | const vector2 | tr |
![]() | ![]() | The top right corner of the initial rectangle. | |
![]() | ![]() | const vector2 | br |
![]() | ![]() | The bottom right corner of the initial rectangle. | |
![]() | ![]() | const vector2 | bl |
![]() | ![]() | The bottom left corner of the initial rectangle. | |
A Delaunay triangulation is a set of triangles that has some particular properties with respect to a set of points. The triangles have the points as their corners, and no other points as their corners. All the points are at the corner of at least one of the triangles. The circumcircle of any of the triangles contains only the points in the set that are the corners of the triangle. The set of triangles fills the convex hull of the set of points.
The faces of the Voroni polygons for the set of points perpendicularly bisect the edges of the triangles. The Voroni polygon of one of the points is the region that is closer to that point than to any other point in the set. Therefore, the edges of the triangles connect a point in the set to the other points in the set that are its nearby neighbours.
This class supports calculation of a Delaunay triangulation for an arbitrary set of points by providing a member function for adding another point to an existing Delaunay triangulation.
Definition at line 276 of file delaunay.h.
| delaunay::triangulation::triangulation (const double l, const double r, const double t, const double b) |
The only constructur for a triangulation.
This creates an initial triangulation that fills a given rectangle. All points added to the triangulation must lie within this rectangle. The initial triangulation consists of four points, at the corners of the rectangle, and two triangles.
The class provides a member function, corner_point(vector2), for distinguishing the points at the corners of the rectangle from the other points in the triangulation, and a member function, border_triangle(triangle), for distinguishing the triangles that include one of the rectangle's corner points from the other triangles in the triangulation. Those functions are useful if the user is interested in the Delaunay triangulation of a set of points that do not have a rectangular convex hull. The user can create an initial rectangular triangulation that is guaranteed to include all the points of interst, add the points of interest, then eliminate from consideration the points indicated by corner_point and the triangles indicated by border_triangle.
| l | the x ordinate of the left side of the initial rectangle |
| r | the x ordinate of the right side of the initial rectangle |
| t | the y ordinate of the top side of the initial rectangle |
| b |
the y ordinate of the bottom side of the initial rectangle
|
assert( l <= r ); assert( b <= t );
assert( this->left == l ); assert( this->right == r ); assert( this->top == t ); assert( this->bottom == b ); assert( this->tl == vector2( l, t ) ); assert( this->tr == vector2( r, t ) ); assert( this->br == vector2( r, b ) ); assert( this->bl == vector2( l, b ) );
triangle objects that fill the rectangle specified by the given ordinates. The corners of those triangles are the four border corners. Definition at line 117 of file delaunay.cpp.
delaunay::triangulation::~triangulation (void) [virtual]
|
Definition at line 140 of file delaunay.cpp.
bool delaunay::triangulation::corner_point (const vector2 & p) const [inline]
|
Indicate whether a point is one of the corner points of the intitial rectangle.
| p | the point to check |
true iff p is one of the corner points of the initial rectangle
assert( this->corner_point( this->tl ) ); assert( this->corner_point( this->tr ) ); assert( this->corner_point( this->br ) ); assert( this->corner_point( this->bl ) );
corner_point returns false. Definition at line 585 of file delaunay.h.
bool delaunay::triangulation::border_triangle (const triangle & t) const [inline]
|
Indicate whether a triangle includes one of the corner points of the intitial rectangle.
true iff t includes one of the corner points of the initial rectangle. Definition at line 602 of file delaunay.h.
| bool delaunay::triangulation::contains (const vector2 & p) const |
Indicate whether a given point is one of the points of the triangulation.
That is, whether the given point is a vertex of any of the traingles of the triangulation.
| p | the point to test |
true iff p is one of the points of the triangulation
assert( this->contains( this->tl ) ); assert( this->contains( this->tr ) ); assert( this->contains( this->br ) ); assert( this->contains( this->bl ) );
Definition at line 220 of file delaunay.cpp.
const vector<triangle>& delaunay::triangulation::triangles (void) const [inline]
|
Provide the set of triangles that form the triangulation.
Definition at line 450 of file delaunay.h.
| void delaunay::triangulation::add_point (const vector2 & p) |
Add a point to the set of points in the triangulation.
This alters the set returned by triangles().
| p |
the point to add
|
assert( this->left <= p.x && p.x <= this->right ); assert( this->bottom <= p.y && p.y <= this->top ); assert( !this->contains( p ) );
assert( this->contains( p ) );
Definition at line 147 of file delaunay.cpp.
| const double delaunay::triangulation::left |
The x ordinate of the left side of the initial rectangle.
Definition at line 347 of file delaunay.h.
| const double delaunay::triangulation::right |
The x ordinate of the right side of the initial rectangle.
Definition at line 352 of file delaunay.h.
| const double delaunay::triangulation::top |
| const double delaunay::triangulation::bottom |
The y ordinate of the bottom side of the initial rectangle.
Definition at line 362 of file delaunay.h.
| const vector2 delaunay::triangulation::tl |
| const vector2 delaunay::triangulation::tr |
| const vector2 delaunay::triangulation::br |
| const vector2 delaunay::triangulation::bl |
1.0.0 written by Dimitri van Heesch,
© 1997-1999