GEOS
3.9.1dev
|
Models a site (node) in a QuadEdgeSubdivision. More...
#include <Vertex.h>
Public Member Functions | |
Vertex (double _x, double _y) | |
Vertex (double _x, double _y, double _z) | |
Vertex (const geom::Coordinate &_p) | |
Vertex () | |
~Vertex () | |
double | getX () const |
double | getY () const |
double | getZ () const |
void | setZ (double _z) |
const geom::Coordinate & | getCoordinate () const |
bool | equals (const Vertex &_x) const |
bool | equals (const Vertex &_x, double tolerance) const |
int | classify (const Vertex &p0, const Vertex &p1) |
double | crossProduct (const Vertex &v) const |
double | dot (Vertex v) const |
std::unique_ptr< Vertex > | times (double c) const |
std::unique_ptr< Vertex > | sum (Vertex v) const |
std::unique_ptr< Vertex > | sub (const Vertex &v) const |
double | magn () const |
std::unique_ptr< Vertex > | cross () const |
bool | isInCircle (const Vertex &a, const Vertex &b, const Vertex &c) const |
bool | isCCW (const Vertex &b, const Vertex &c) const |
bool | rightOf (const QuadEdge &e) const |
bool | leftOf (const QuadEdge &e) const |
Static Public Attributes | |
static const int | LEFT = 0 |
static const int | RIGHT = 1 |
static const int | BEYOND = 2 |
static const int | BEHIND = 3 |
static const int | BETWEEN = 4 |
static const int | ORIGIN = 5 |
static const int | DESTINATION = 6 |
Private Member Functions | |
double | distance (const Vertex &v1, const Vertex &v2) |
double | circumRadiusRatio (const Vertex &b, const Vertex &c) |
std::unique_ptr< Vertex > | midPoint (const Vertex &a) |
std::unique_ptr< Vertex > | circleCenter (const Vertex &b, const Vertex &c) const |
double | interpolateZValue (const Vertex &v0, const Vertex &v1, const Vertex &v2) const |
Static Private Member Functions | |
static std::unique_ptr< algorithm::HCoordinate > | bisector (const Vertex &a, const Vertex &b) |
static double | interpolateZ (const geom::Coordinate &p, const geom::Coordinate &v0, const geom::Coordinate &v1, const geom::Coordinate &v2) |
static double | interpolateZ (const geom::Coordinate &p, const geom::Coordinate &p0, const geom::Coordinate &p1) |
Private Attributes | |
geom::Coordinate | p |
Models a site (node) in a QuadEdgeSubdivision.
The sites can be points on a line string representing a linear site.
The vertex can be considered as a vector with a norm, length, inner product, cross product, etc. Additionally, point relations (e.g., is a point to the left of a line, the circle defined by this point and two others, etc.) are also defined in this class.
It is common to want to attach user-defined data to the vertices of a subdivision. One way to do this is to subclass Vertex
to carry any desired information.
geos::triangulate::quadedge::Vertex::Vertex | ( | double | _x, |
double | _y | ||
) |
geos::triangulate::quadedge::Vertex::Vertex | ( | double | _x, |
double | _y, | ||
double | _z | ||
) |
geos::triangulate::quadedge::Vertex::Vertex | ( | const geom::Coordinate & | _p | ) |
geos::triangulate::quadedge::Vertex::Vertex | ( | ) |
|
staticprivate |
|
private |
Computes the centre of the circumcircle of this vertex and two others.
b | |
c |
|
private |
Computes the value of the ratio of the circumradius to shortest edge. If smaller than some given tolerance B, the associated triangle is considered skinny. For an equal lateral triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: circumRadius/shortestEdge = 1/(2sin(theta)).
b | second vertex of the triangle |
c | third vertex of the triangle |
|
inline |
Definition at line 191 of file Vertex.h.
References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inline |
Computes the cross product k = u X v.
v | a vertex |
Definition at line 139 of file Vertex.h.
References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inline |
Computes the inner or dot product
v | a vertex |
Definition at line 151 of file Vertex.h.
References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inline |
Definition at line 113 of file Vertex.h.
References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inline |
Definition at line 122 of file Vertex.h.
References geos::geom::Coordinate::distance(), and getCoordinate().
|
inline |
Definition at line 107 of file Vertex.h.
Referenced by equals(), and geos::triangulate::quadedge::operator<().
|
inline |
Definition at line 83 of file Vertex.h.
References geos::geom::Coordinate::x.
Referenced by crossProduct(), distance(), dot(), equals(), sub(), and sum().
|
inline |
Definition at line 89 of file Vertex.h.
References geos::geom::Coordinate::y.
Referenced by crossProduct(), distance(), dot(), equals(), sub(), and sum().
|
inline |
Definition at line 95 of file Vertex.h.
References geos::geom::Coordinate::z.
|
staticprivate |
Interpolates the Z-value (height) of a point enclosed in a triangle whose vertices all have Z values. The containing triangle must not be degenerate (in other words, the three vertices must enclose a non-zero area).
p | the point to interpolate the Z value of |
v0 | a vertex of a triangle containing the p |
v1 | a vertex of a triangle containing the p |
v2 | a vertex of a triangle containing the p |
|
staticprivate |
Computes the interpolated Z-value for a point p lying on the segment p0-p1
p | |
p0 | |
p1 |
|
private |
For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate a z value from the surrounding vertices.
Tests whether the triangle formed by this vertex and two other vertices is in CCW orientation.
b | a vertex |
c | a vertex |
Definition at line 223 of file Vertex.h.
References p, geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inline |
Tests if the vertex is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).
a | a vertex of the triangle |
b | a vertex of the triangle |
c | a vertex of the triangle |
Definition at line 210 of file Vertex.h.
References geos::geom::TrianglePredicate::isInCircleRobust(), and p.
bool geos::triangulate::quadedge::Vertex::leftOf | ( | const QuadEdge & | e | ) | const |
|
inline |
Definition at line 184 of file Vertex.h.
References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
returns a new vertex that is mid-way between this vertex and another end point.
a | the other end point. |
bool geos::triangulate::quadedge::Vertex::rightOf | ( | const QuadEdge & | e | ) | const |
|
inline |
Definition at line 101 of file Vertex.h.
References geos::geom::Coordinate::z.
Definition at line 177 of file Vertex.h.
References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
Definition at line 170 of file Vertex.h.
References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
inline |
Computes the scalar product c(v)
c | scaling factor |
Definition at line 163 of file Vertex.h.
References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
Definition at line 70 of file Vertex.h.
Referenced by isCCW(), and isInCircle().
|
static |