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];
void MarkConstrainedEdge(const int index)
double y
Definition: shapes.h:47
Triangle * NeighborCCW(Point &point)
Point operator*(double s, const Point &a)
Multiply point by scalar.
Definition: shapes.h:245
void ClearNeighbor(Triangle *triangle)
void SetConstrainedEdgeCCW(Point &p, bool ce)
Triangle & NeighborAcross(Point &opoint)
void set_zero()
Set this point to all zeros.
Definition: shapes.h:63
Point operator-() const
Negate this point.
Definition: shapes.h:77
Point()
Default constructor does nothing (for performance).
Definition: shapes.h:50
void SetConstrainedEdgeCW(Point &p, bool ce)
int Index(const Point *p)
bool constrained_edge[3]
Flags to determine if an edge is a Constrained edge.
Definition: shapes.h:157
double x
Definition: shapes.h:47
void SetDelunayEdgeCW(Point &p, bool e)
bool operator==(const Point &a, const Point &b)
Definition: shapes.h:250
bool GetConstrainedEdgeCW(Point &p)
Edge(Point &p1, Point &p2)
Constructor.
Definition: shapes.h:128
bool Contains(Point *p)
Definition: shapes.h:296
Triangle * NeighborCW(Point &point)
Point * PointCW(Point &point)
bool GetDelunayEdgeCW(Point &p)
void MarkNeighbor(Point *p1, Point *p2, Triangle *t)
Point * q
Definition: shapes.h:125
Point operator+(const Point &a, const Point &b)
Add two points_ component-wise.
Definition: shapes.h:233
double Normalize()
Convert this point into a unit point. Returns the Length.
Definition: shapes.h:112
int EdgeIndex(const Point *p1, const Point *p2)
double Length() const
Get the length of this point (the norm).
Definition: shapes.h:106
void set(double x_, double y_)
Set this point to some specified coordinates.
Definition: shapes.h:70
void operator+=(const Point &v)
Add a point to this point.
Definition: shapes.h:85
Point operator-(const Point &a, const Point &b)
Subtract two points_ component-wise.
Definition: shapes.h:239
double Dot(const Point &a, const Point &b)
Peform the dot product on two vectors.
Definition: shapes.h:261
bool delaunay_edge[3]
Flags to determine if an edge is a Delauney edge.
Definition: shapes.h:159
Point * p
Definition: shapes.h:125
bool operator!=(const Point &a, const Point &b)
Definition: shapes.h:255
void operator*=(double a)
Multiply this point by a scalar.
Definition: shapes.h:99
Point(double x, double y)
Construct using coordinates.
Definition: shapes.h:60
bool IsInterior()
Definition: shapes.h:311
bool GetDelunayEdgeCCW(Point &p)
Point * PointCCW(Point &point)
Triangle * GetNeighbor(const int &index)
Definition: shapes.h:291
bool cmp(const Point *a, const Point *b)
Definition: shapes.h:219
Triangle(Point &a, Point &b, Point &c)
Constructor.
bool GetConstrainedEdgeCCW(Point &p)
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
void SetDelunayEdgeCCW(Point &p, bool e)
void Legalize(Point &point)
Point * GetPoint(const int &index)
Definition: shapes.h:286
void operator-=(const Point &v)
Subtract a point from this point.
Definition: shapes.h:92
std::vector< Edge * > edge_list
The edges this point constitutes an upper ending point.
Definition: shapes.h:57
Point * OppositePoint(Triangle &t, Point &p)