19 #ifndef GEOS_TRIANGULATE_QUADEDGE_VERTEX_H
20 #define GEOS_TRIANGULATE_QUADEDGE_VERTEX_H
26 #include <geos/geom/Coordinate.h>
27 #include <geos/algorithm/HCoordinate.h>
28 #include <geos/triangulate/quadedge/TrianglePredicate.h>
33 namespace triangulate {
41 namespace triangulate {
63 static const int LEFT = 0;
64 static const int RIGHT = 1;
65 static const int BEYOND = 2;
66 static const int BEHIND = 3;
67 static const int BETWEEN = 4;
68 static const int ORIGIN = 5;
69 static const int DESTINATION = 6;
74 Vertex(
double _x,
double _y);
76 Vertex(
double _x,
double _y,
double _z);
108 getCoordinate()
const
114 equals(
const Vertex& _x)
const
116 return p.equals2D(_x.p);
120 equals(
const Vertex& _x,
double tolerance)
const
122 if(p.
distance(_x.getCoordinate()) < tolerance) {
139 return (p.
x * v.getY() - p.
y * v.getX());
151 return (p.
x * v.getX() + p.
y * v.getY());
160 inline std::unique_ptr<Vertex>
163 return std::unique_ptr<Vertex>(
new Vertex(c * p.
x, c * p.
y));
167 inline std::unique_ptr<Vertex>
170 return std::unique_ptr<Vertex>(
new Vertex(p.
x + v.getX(), p.
y + v.getY()));
174 inline std::unique_ptr<Vertex>
175 sub(
const Vertex& v)
const
177 return std::unique_ptr<Vertex>(
new Vertex(p.
x - v.getX(), p.
y - v.getY()));
184 return (sqrt(p.
x * p.
x + p.
y * p.
y));
188 inline std::unique_ptr<Vertex>
191 return std::unique_ptr<Vertex>(
new Vertex(p.
y, -p.
x));
224 return (b.p.
x - p.
x) * (c.p.
y - p.
y)
225 > (b.p.
y - p.
y) * (c.p.
x - p.
x);
228 bool rightOf(
const QuadEdge& e)
const;
229 bool leftOf(
const QuadEdge& e)
const;
232 static std::unique_ptr<algorithm::HCoordinate> bisector(
const Vertex& a,
const Vertex& b);
237 return sqrt(pow(v2.getX() - v1.getX(), 2.0)
238 + pow(v2.getY() - v1.getY(), 2.0));
251 double circumRadiusRatio(
const Vertex& b,
const Vertex& c);
259 std::unique_ptr<Vertex> midPoint(
const Vertex& a);
268 std::unique_ptr<Vertex> circleCenter(
const Vertex& b,
const Vertex& c)
const;
274 double interpolateZValue(
const Vertex& v0,
const Vertex& v1,
const Vertex& v2)
const;
305 operator<(
const Vertex& v1,
const Vertex& v2)
307 return v1.getCoordinate() < v2.getCoordinate();
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
double distance(const Coordinate &p) const
double y
y-coordinate
Definition: Coordinate.h:83
double x
x-coordinate
Definition: Coordinate.h:80
double z
z-coordinate
Definition: Coordinate.h:86
A class that represents the edge data structure which implements the quadedge algebra.
Definition: QuadEdge.h:54
static bool isInCircleRobust(const Coordinate &a, const Coordinate &b, const Coordinate &c, const Coordinate &p)
Models a site (node) in a QuadEdgeSubdivision.
Definition: Vertex.h:61
double crossProduct(const Vertex &v) const
Definition: Vertex.h:137
std::unique_ptr< Vertex > times(double c) const
Definition: Vertex.h:161
double dot(Vertex v) const
Definition: Vertex.h:149
bool isCCW(const Vertex &b, const Vertex &c) const
Definition: Vertex.h:221
bool isInCircle(const Vertex &a, const Vertex &b, const Vertex &c) const
Definition: Vertex.h:208
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26