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> 31 namespace triangulate {
39 namespace triangulate {
61 static const int LEFT = 0;
62 static const int RIGHT = 1;
63 static const int BEYOND = 2;
64 static const int BEHIND = 3;
65 static const int BETWEEN = 4;
66 static const int ORIGIN = 5;
67 static const int DESTINATION = 6;
72 Vertex(
double _x,
double _y);
74 Vertex(
double _x,
double _y,
double _z);
106 getCoordinate()
const 112 equals(
const Vertex& _x)
const 114 if(p.
x == _x.getX() && p.
y == _x.getY()) {
121 equals(
const Vertex& _x,
double tolerance)
const 123 if(p.
distance(_x.getCoordinate()) < tolerance) {
129 virtual int classify(
const Vertex& p0,
const Vertex& p1);
140 return (p.
x * v.getY() - p.
y * v.getX());
152 return (p.
x * v.getX() + p.
y * v.getY());
161 inline std::unique_ptr<Vertex>
164 return std::unique_ptr<Vertex>(
new Vertex(c * p.
x, c * p.
y));
168 inline std::unique_ptr<Vertex>
171 return std::unique_ptr<Vertex>(
new Vertex(p.
x + v.getX(), p.
y + v.getY()));
175 inline std::unique_ptr<Vertex>
176 sub(
const Vertex& v)
const 178 return std::unique_ptr<Vertex>(
new Vertex(p.
x - v.getX(), p.
y - v.getY()));
185 return (sqrt(p.
x * p.
x + p.
y * p.
y));
189 inline std::unique_ptr<Vertex>
192 return std::unique_ptr<Vertex>(
new Vertex(p.
y, -p.
x));
209 virtual bool isInCircle(
const Vertex& a,
const Vertex& b,
const Vertex& c)
const;
224 return (b.p.
x - p.
x) * (c.p.
y - p.
y)
225 - (b.p.
y - p.
y) * (c.p.
x - p.
x) > 0;
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 virtual double circumRadiusRatio(
const Vertex& b,
const Vertex& c);
259 virtual std::unique_ptr<Vertex> midPoint(
const Vertex& a);
268 virtual std::unique_ptr<Vertex> circleCenter(
const Vertex& b,
const Vertex& c)
const;
274 virtual double interpolateZValue(
const Vertex& v0,
const Vertex& v1,
275 const Vertex& v2)
const;
306 operator<(
const Vertex& v1,
const Vertex& v2)
308 return v1.getCoordinate() < v2.getCoordinate();
315 #endif //GEOS_TRIANGULATE_QUADEDGE_VERTEX_H double y
y-coordinate
Definition: Coordinate.h:83
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
double dot(Vertex v) const
Definition: Vertex.h:150
Models a site (node) in a QuadEdgeSubdivision.
Definition: Vertex.h:59
double crossProduct(const Vertex &v) const
Definition: Vertex.h:138
bool isCCW(const Vertex &b, const Vertex &c) const
Definition: Vertex.h:220
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
std::unique_ptr< Vertex > times(double c) const
Definition: Vertex.h:162
double distance(const Coordinate &p) const
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:51