19 #ifndef GEOS_TRIANGULATE_QUADEDGE_VERTEX_H
20 #define GEOS_TRIANGULATE_QUADEDGE_VERTEX_H
25 #include <geos/geom/Coordinate.h>
26 #include <geos/algorithm/HCoordinate.h>
27 #include <geos/triangulate/quadedge/TrianglePredicate.h>
32 namespace triangulate {
40 namespace triangulate {
62 static const int LEFT = 0;
63 static const int RIGHT = 1;
64 static const int BEYOND = 2;
65 static const int BEHIND = 3;
66 static const int BETWEEN = 4;
67 static const int ORIGIN = 5;
68 static const int DESTINATION = 6;
73 Vertex(
double _x,
double _y);
75 Vertex(
double _x,
double _y,
double _z);
107 getCoordinate()
const
113 equals(
const Vertex& _x)
const
115 if(p.
x == _x.getX() && p.
y == _x.getY()) {
122 equals(
const Vertex& _x,
double tolerance)
const
124 if(p.
distance(_x.getCoordinate()) < tolerance) {
141 return (p.
x * v.getY() - p.
y * v.getX());
153 return (p.
x * v.getX() + p.
y * v.getY());
162 inline std::unique_ptr<Vertex>
165 return std::unique_ptr<Vertex>(
new Vertex(c * p.
x, c * p.
y));
169 inline std::unique_ptr<Vertex>
172 return std::unique_ptr<Vertex>(
new Vertex(p.
x + v.getX(), p.
y + v.getY()));
176 inline std::unique_ptr<Vertex>
177 sub(
const Vertex& v)
const
179 return std::unique_ptr<Vertex>(
new Vertex(p.
x - v.getX(), p.
y - v.getY()));
186 return (sqrt(p.
x * p.
x + p.
y * p.
y));
190 inline std::unique_ptr<Vertex>
193 return std::unique_ptr<Vertex>(
new Vertex(p.
y, -p.
x));
226 return (b.p.
x - p.
x) * (c.p.
y - p.
y)
227 > (b.p.
y - p.
y) * (c.p.
x - p.
x);
230 bool rightOf(
const QuadEdge& e)
const;
231 bool leftOf(
const QuadEdge& e)
const;
234 static std::unique_ptr<algorithm::HCoordinate> bisector(
const Vertex& a,
const Vertex& b);
239 return sqrt(pow(v2.getX() - v1.getX(), 2.0)
240 + pow(v2.getY() - v1.getY(), 2.0));
253 double circumRadiusRatio(
const Vertex& b,
const Vertex& c);
261 std::unique_ptr<Vertex> midPoint(
const Vertex& a);
270 std::unique_ptr<Vertex> circleCenter(
const Vertex& b,
const Vertex& c)
const;
276 double interpolateZValue(
const Vertex& v0,
const Vertex& v1,
const Vertex& v2)
const;
307 operator<(
const Vertex& v1,
const Vertex& v2)
309 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
static bool isInCircleRobust(const Coordinate &a, const Coordinate &b, const Coordinate &c, const Coordinate &p)
A class that represents the edge data structure which implements the quadedge algebra.
Definition: QuadEdge.h:54
Models a site (node) in a QuadEdgeSubdivision.
Definition: Vertex.h:60
double crossProduct(const Vertex &v) const
Definition: Vertex.h:139
std::unique_ptr< Vertex > times(double c) const
Definition: Vertex.h:163
double dot(Vertex v) const
Definition: Vertex.h:151
bool isCCW(const Vertex &b, const Vertex &c) const
Definition: Vertex.h:223
bool isInCircle(const Vertex &a, const Vertex &b, const Vertex &c) const
Definition: Vertex.h:210
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26