70 void set(
double x_,
double y_)
108 return sqrt(
x *
x +
y *
y);
133 }
else if (p1.
y == p2.
y) {
137 }
else if (p1.
x == p2.
x) {
223 }
else if (a->
y == b->
y) {
247 return Point(s * a.
x, s * a.
y);
252 return a.
x == b.
x && a.
y == b.
y;
257 return !(a.
x == b.
x) && !(a.
y == b.
y);
263 return a.
x * b.
x + a.
y * b.
y;
269 return a.
x * b.
y - a.
y * b.
x;
276 return Point(s * a.
y, -s * a.
x);
283 return Point(-s * a.
y, s * a.
x);
288 return points_[index];
293 return neighbors_[index];
298 return p == points_[0] || p == points_[1] || p == points_[2];
int Index(const Point *p)
bool GetConstrainedEdgeCW(Point &p)
Point * OppositePoint(Triangle &t, Point &p)
Triangle * NeighborCW(Point &point)
Triangle & NeighborAcross(Point &opoint)
void Legalize(Point &point)
void MarkConstrainedEdge(Edge &edge)
void MarkNeighbor(Triangle &t)
bool GetDelunayEdgeCCW(Point &p)
Point * PointCW(const Point &point) const
void MarkConstrainedEdge(Point *p, Point *q)
void SetConstrainedEdgeCW(Point &p, bool ce)
void MarkConstrainedEdge(const int index)
bool constrained_edge[3]
Flags to determine if an edge is a Constrained edge.
Definition shapes.h:157
Point * PointCCW(const Point &point) const
Point * GetPoint(const int &index) const
Definition shapes.h:286
Triangle * NeighborCCW(Point &point)
void SetConstrainedEdgeCCW(Point &p, bool ce)
void SetDelunayEdgeCW(Point &p, bool e)
bool Contains(Point *p)
Definition shapes.h:296
Triangle * GetNeighbor(const int &index)
Definition shapes.h:291
bool IsInterior()
Definition shapes.h:311
void SetDelunayEdgeCCW(Point &p, bool e)
bool GetConstrainedEdgeCCW(Point &p)
Triangle(Point &a, Point &b, Point &c)
Constructor.
void MarkNeighbor(Point *p1, Point *p2, Triangle *t)
void Legalize(Point &opoint, Point &npoint)
bool delaunay_edge[3]
Flags to determine if an edge is a Delauney edge.
Definition shapes.h:159
int EdgeIndex(const Point *p1, const Point *p2)
void ClearNeighbor(Triangle *triangle)
bool GetDelunayEdgeCW(Point &p)
double Dot(const Point &a, const Point &b)
Peform the dot product on two vectors.
Definition shapes.h:261
bool cmp(const Point *a, const Point *b)
Definition shapes.h:219
double Cross(const Point &a, const Point &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
Definition shapes.h:267
Point * p
Definition shapes.h:125
Point * q
Definition shapes.h:125
Edge(Point &p1, Point &p2)
Constructor.
Definition shapes.h:128
double Length() const
Get the length of this point (the norm).
Definition shapes.h:106
Point operator-() const
Negate this point.
Definition shapes.h:77
void operator+=(const Point &v)
Add a point to this point.
Definition shapes.h:85
std::vector< Edge * > edge_list
The edges this point constitutes an upper ending point.
Definition shapes.h:57
double x
Definition shapes.h:47
Point(double x, double y)
Construct using coordinates.
Definition shapes.h:60
void operator-=(const Point &v)
Subtract a point from this point.
Definition shapes.h:92
Point()
Default constructor does nothing (for performance).
Definition shapes.h:50
void operator*=(double a)
Multiply this point by a scalar.
Definition shapes.h:99
void set(double x_, double y_)
Set this point to some specified coordinates.
Definition shapes.h:70
void set_zero()
Set this point to all zeros.
Definition shapes.h:63
double y
Definition shapes.h:47
double Normalize()
Convert this point into a unit point. Returns the Length.
Definition shapes.h:112