libosmscout  0.1
p2t Namespace Reference

Sweep-line, Constrained Delauney Triangulation (CDT) See: Domiter, V. More...

Classes

class  AdvancingFront
 
class  CDT
 
struct  Edge
 
struct  Node
 
struct  Point
 
class  Sweep
 
class  SweepContext
 
class  Triangle
 

Enumerations

enum  Orientation { CW, CCW, COLLINEAR }
 

Functions

bool cmp (const Point *a, const Point *b)
 
Point Cross (const double s, const Point &a)
 Perform the cross product on a scalar and a point. More...
 
double Cross (const Point &a, const Point &b)
 Perform the cross product on two vectors. In 2D this produces a scalar. More...
 
Point Cross (const Point &a, double s)
 Perform the cross product on a point and a scalar. More...
 
double Dot (const Point &a, const Point &b)
 Peform the dot product on two vectors. More...
 
bool InScanArea (Point &pa, Point &pb, Point &pc, Point &pd)
 
bool operator!= (const Point &a, const Point &b)
 
Point operator* (double s, const Point &a)
 Multiply point by scalar. More...
 
Point operator+ (const Point &a, const Point &b)
 Add two points_ component-wise. More...
 
Point operator- (const Point &a, const Point &b)
 Subtract two points_ component-wise. More...
 
bool operator== (const Point &a, const Point &b)
 
Orientation Orient2d (const Point &pa, const Point &pb, const Point &pc)
 Formula to calculate signed area
Positive if CCW
Negative if CW
0 if collinear
More...
 

Variables

const double EPSILON = 1e-12
 
const double kAlpha = 0.3
 
const double PI_3div4 = 3 * M_PI / 4
 
const double PI_div2 = 1.57079632679489661923
 

Detailed Description

Sweep-line, Constrained Delauney Triangulation (CDT) See: Domiter, V.

Author
Mason Green mason.nosp@m..gre.nosp@m.en@gm.nosp@m.ail..nosp@m.com

and Zalik, B.(2008)'Sweep-line algorithm for constrained Delaunay triangulation', International Journal of Geographical Information Science

"FlipScan" Constrained Edge Algorithm invented by Thomas Åhlén, thahl.nosp@m.en@g.nosp@m.mail..nosp@m.com

Enumeration Type Documentation

◆ Orientation

Enumerator
CW 
CCW 
COLLINEAR 

Function Documentation

◆ cmp()

bool p2t::cmp ( const Point a,
const Point b 
)
inline

References p2t::Point::x, and p2t::Point::y.

◆ Cross() [1/3]

Point p2t::Cross ( const double  s,
const Point a 
)
inline

Perform the cross product on a scalar and a point.

In 2D this produces a point.

References p2t::Point::x, and p2t::Point::y.

◆ Cross() [2/3]

double p2t::Cross ( const Point a,
const Point b 
)
inline

Perform the cross product on two vectors. In 2D this produces a scalar.

References p2t::Point::x, and p2t::Point::y.

◆ Cross() [3/3]

Point p2t::Cross ( const Point a,
double  s 
)
inline

Perform the cross product on a point and a scalar.

In 2D this produces a point.

References p2t::Point::x, and p2t::Point::y.

◆ Dot()

double p2t::Dot ( const Point a,
const Point b 
)
inline

Peform the dot product on two vectors.

References p2t::Point::x, and p2t::Point::y.

◆ InScanArea()

bool p2t::InScanArea ( Point pa,
Point pb,
Point pc,
Point pd 
)

References EPSILON, p2t::Point::x, and p2t::Point::y.

◆ operator!=()

bool p2t::operator!= ( const Point a,
const Point b 
)
inline

References p2t::Point::x, and p2t::Point::y.

◆ operator*()

Point p2t::operator* ( double  s,
const Point a 
)
inline

Multiply point by scalar.

References p2t::Point::x, and p2t::Point::y.

◆ operator+()

Point p2t::operator+ ( const Point a,
const Point b 
)
inline

Add two points_ component-wise.

References p2t::Point::x, and p2t::Point::y.

◆ operator-()

Point p2t::operator- ( const Point a,
const Point b 
)
inline

Subtract two points_ component-wise.

References p2t::Point::x, and p2t::Point::y.

◆ operator==()

bool p2t::operator== ( const Point a,
const Point b 
)
inline

References p2t::Point::x, and p2t::Point::y.

◆ Orient2d()

Orientation p2t::Orient2d ( const Point pa,
const Point pb,
const Point pc 
)

Formula to calculate signed area
Positive if CCW
Negative if CW
0 if collinear

A[P1,P2,P3]  =  (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
             =  (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)

References CCW, COLLINEAR, CW, EPSILON, p2t::Point::x, and p2t::Point::y.

Variable Documentation

◆ EPSILON

const double p2t::EPSILON = 1e-12

Referenced by InScanArea(), and Orient2d().

◆ kAlpha

const double p2t::kAlpha = 0.3

◆ PI_3div4

const double p2t::PI_3div4 = 3 * M_PI / 4

◆ PI_div2

const double p2t::PI_div2 = 1.57079632679489661923