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 return p.equals2D(_x.p);
119 equals(
const Vertex& _x,
double tolerance)
const
121 if(p.distance(_x.getCoordinate()) < tolerance) {
138 return (p.x * v.getY() - p.y * v.getX());
150 return (p.x * v.getX() + p.y * v.getY());
159 inline std::unique_ptr<Vertex>
162 return std::unique_ptr<Vertex>(
new Vertex(c * p.x, c * p.y));
166 inline std::unique_ptr<Vertex>
169 return std::unique_ptr<Vertex>(
new Vertex(p.x + v.getX(), p.y + v.getY()));
173 inline std::unique_ptr<Vertex>
174 sub(
const Vertex& v)
const
176 return std::unique_ptr<Vertex>(
new Vertex(p.x - v.getX(), p.y - v.getY()));
183 return (std::sqrt(p.x * p.x + p.y * p.y));
187 inline std::unique_ptr<Vertex>
190 return std::unique_ptr<Vertex>(
new Vertex(p.y, -p.x));
223 return (b.p.x - p.x) * (c.p.y - p.y)
224 > (b.p.y - p.y) * (c.p.x - p.x);
227 bool rightOf(
const QuadEdge& e)
const;
228 bool leftOf(
const QuadEdge& e)
const;
231 static std::unique_ptr<algorithm::HCoordinate> bisector(
const Vertex& a,
const Vertex& b);
236 return std::sqrt(pow(v2.getX() - v1.getX(), 2.0) +
237 pow(v2.getY() - v1.getY(), 2.0));
250 double circumRadiusRatio(
const Vertex& b,
const Vertex& c);
258 std::unique_ptr<Vertex> midPoint(
const Vertex& a);
267 std::unique_ptr<Vertex> circleCenter(
const Vertex& b,
const Vertex& c)
const;
273 double interpolateZValue(
const Vertex& v0,
const Vertex& v1,
const Vertex& v2)
const;
304 operator<(
const Vertex& v1,
const Vertex& v2)
306 return v1.getCoordinate() < v2.getCoordinate();
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
double z
z-coordinate
Definition: Coordinate.h:241
A class that represents the edge data structure which implements the quadedge algebra.
Definition: QuadEdge.h:53
static geom::Location isInCircleRobust(const CoordinateXY &a, const CoordinateXY &b, const CoordinateXY &c, const CoordinateXY &p)
Models a site (node) in a QuadEdgeSubdivision.
Definition: Vertex.h:60
double crossProduct(const Vertex &v) const
Definition: Vertex.h:136
std::unique_ptr< Vertex > times(double c) const
Definition: Vertex.h:160
double dot(Vertex v) const
Definition: Vertex.h:148
bool isCCW(const Vertex &b, const Vertex &c) const
Definition: Vertex.h:220
bool isInCircle(const Vertex &a, const Vertex &b, const Vertex &c) const
Definition: Vertex.h:207
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25