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 {
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);
82 inline double getX()
const {
86 inline double getY()
const {
90 inline double getZ()
const {
94 inline void setZ(
double _z) {
102 inline bool equals(
const Vertex &_x)
const 104 if (p.
x == _x.getX() && p.
y == _x.getY())
109 inline bool equals(
const Vertex &_x,
double tolerance)
const 111 if (p.
distance(_x.getCoordinate()) < tolerance)
116 virtual int classify(
const Vertex &p0,
const Vertex &p1);
126 return (p.
x * v.getY() - p.
y * v.getX());
137 return (p.
x * v.getX() + p.
y * v.getY());
146 inline std::auto_ptr<Vertex>
times(
double c)
const {
147 return std::auto_ptr<Vertex>(
new Vertex(c * p.
x, c * p.
y));
151 inline std::auto_ptr<Vertex> sum(
Vertex v)
const {
152 return std::auto_ptr<Vertex>(
new Vertex(p.
x + v.getX(), p.
y + v.getY()));
156 inline std::auto_ptr<Vertex> sub(
const Vertex &v)
const {
157 return std::auto_ptr<Vertex>(
new Vertex(p.
x - v.getX(), p.
y - v.getY()));
161 inline double magn()
const {
162 return (sqrt(p.
x * p.
x + p.
y * p.
y));
166 inline std::auto_ptr<Vertex> cross()
const {
167 return std::auto_ptr<Vertex>(
new Vertex(p.
y, -p.
x));
184 virtual bool isInCircle(
const Vertex &a,
const Vertex &b,
const Vertex &c)
const;
198 return (b.p.
x - p.
x) * (c.p.
y - p.
y)
199 - (b.p.
y - p.
y) * (c.p.
x - p.
x) > 0;
202 bool rightOf(
const QuadEdge &e)
const;
203 bool leftOf(
const QuadEdge &e)
const;
206 static std::auto_ptr<algorithm::HCoordinate> bisector(
const Vertex &a,
const Vertex &b);
208 inline double distance(
const Vertex &v1,
const Vertex &v2)
210 return sqrt(pow(v2.getX() - v1.getX(), 2.0)
211 + pow(v2.getY() - v1.getY(), 2.0));
224 virtual double circumRadiusRatio(
const Vertex &b,
const Vertex &c);
232 virtual std::auto_ptr<Vertex> midPoint(
const Vertex &a);
241 virtual std::auto_ptr<Vertex> circleCenter(
const Vertex &b,
const Vertex &c)
const;
247 virtual double interpolateZValue(
const Vertex &v0,
const Vertex &v1,
248 const Vertex &v2)
const;
278 inline bool operator<(
const Vertex& v1,
const Vertex& v2) {
279 return v1.getCoordinate() < v2.getCoordinate();
286 #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:135
double crossProduct(const Vertex &v) const
Definition: Vertex.h:124
std::auto_ptr< Vertex > times(double c) const
Definition: Vertex.h:146
bool isCCW(const Vertex &b, const Vertex &c) const
Definition: Vertex.h:194
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
double distance(const Coordinate &p) const
double x
x-coordinate
Definition: Coordinate.h:80
double z
z-coordinate
Definition: Coordinate.h:86
Definition: QuadEdge.h:51