GEOS  3.9.1dev
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::triangulate::quadedge::Vertex Class Reference

Models a site (node) in a QuadEdgeSubdivision. More...

#include <Vertex.h>

Collaboration diagram for geos::triangulate::quadedge::Vertex:
[legend]

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::CoordinategetCoordinate () 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< Vertextimes (double c) const
 
std::unique_ptr< Vertexsum (Vertex v) const
 
std::unique_ptr< Vertexsub (const Vertex &v) const
 
double magn () const
 
std::unique_ptr< Vertexcross () 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< VertexmidPoint (const Vertex &a)
 
std::unique_ptr< VertexcircleCenter (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::HCoordinatebisector (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
 

Detailed Description

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.

Author
JTS: David Skea
JTS: Martin Davis
Benjamin Campbell

Definition at line 60 of file Vertex.h.

Constructor & Destructor Documentation

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 ( )
geos::triangulate::quadedge::Vertex::~Vertex ( )
inline

Definition at line 80 of file Vertex.h.

Member Function Documentation

static std::unique_ptr<algorithm::HCoordinate> geos::triangulate::quadedge::Vertex::bisector ( const Vertex a,
const Vertex b 
)
staticprivate
std::unique_ptr<Vertex> geos::triangulate::quadedge::Vertex::circleCenter ( const Vertex b,
const Vertex c 
) const
private

Computes the centre of the circumcircle of this vertex and two others.

Parameters
b
c
Returns
the Coordinate which is the circumcircle of the 3 points.
double geos::triangulate::quadedge::Vertex::circumRadiusRatio ( const Vertex b,
const Vertex 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)).

Parameters
bsecond vertex of the triangle
cthird vertex of the triangle
Returns
ratio of circumradius to shortest edge.
int geos::triangulate::quadedge::Vertex::classify ( const Vertex p0,
const Vertex p1 
)
std::unique_ptr<Vertex> geos::triangulate::quadedge::Vertex::cross ( ) const
inline

Definition at line 191 of file Vertex.h.

References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

double geos::triangulate::quadedge::Vertex::crossProduct ( const Vertex v) const
inline

Computes the cross product k = u X v.

Parameters
va vertex
Returns
returns the magnitude of u X v

Definition at line 139 of file Vertex.h.

References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Here is the call graph for this function:

double geos::triangulate::quadedge::Vertex::distance ( const Vertex v1,
const Vertex v2 
)
inlineprivate

Definition at line 237 of file Vertex.h.

References getX(), and getY().

Here is the call graph for this function:

double geos::triangulate::quadedge::Vertex::dot ( Vertex  v) const
inline

Computes the inner or dot product

Parameters
va vertex
Returns
returns the dot product u.v

Definition at line 151 of file Vertex.h.

References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Here is the call graph for this function:

bool geos::triangulate::quadedge::Vertex::equals ( const Vertex _x) const
inline

Definition at line 113 of file Vertex.h.

References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Here is the call graph for this function:

bool geos::triangulate::quadedge::Vertex::equals ( const Vertex _x,
double  tolerance 
) const
inline

Definition at line 122 of file Vertex.h.

References geos::geom::Coordinate::distance(), and getCoordinate().

Here is the call graph for this function:

const geom::Coordinate& geos::triangulate::quadedge::Vertex::getCoordinate ( ) const
inline

Definition at line 107 of file Vertex.h.

Referenced by equals(), and geos::triangulate::quadedge::operator<().

Here is the caller graph for this function:

double geos::triangulate::quadedge::Vertex::getX ( ) const
inline

Definition at line 83 of file Vertex.h.

References geos::geom::Coordinate::x.

Referenced by crossProduct(), distance(), dot(), equals(), sub(), and sum().

Here is the caller graph for this function:

double geos::triangulate::quadedge::Vertex::getY ( ) const
inline

Definition at line 89 of file Vertex.h.

References geos::geom::Coordinate::y.

Referenced by crossProduct(), distance(), dot(), equals(), sub(), and sum().

Here is the caller graph for this function:

double geos::triangulate::quadedge::Vertex::getZ ( ) const
inline

Definition at line 95 of file Vertex.h.

References geos::geom::Coordinate::z.

static double geos::triangulate::quadedge::Vertex::interpolateZ ( const geom::Coordinate p,
const geom::Coordinate v0,
const geom::Coordinate v1,
const geom::Coordinate v2 
)
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).

Parameters
pthe point to interpolate the Z value of
v0a vertex of a triangle containing the p
v1a vertex of a triangle containing the p
v2a vertex of a triangle containing the p
Returns
the interpolated Z-value (height) of the point
static double geos::triangulate::quadedge::Vertex::interpolateZ ( const geom::Coordinate p,
const geom::Coordinate p0,
const geom::Coordinate p1 
)
staticprivate

Computes the interpolated Z-value for a point p lying on the segment p0-p1

Parameters
p
p0
p1
Returns
the interpolated Z value
double geos::triangulate::quadedge::Vertex::interpolateZValue ( const Vertex v0,
const Vertex v1,
const Vertex v2 
) const
private

For this vertex enclosed in a triangle defined by three vertices v0, v1 and v2, interpolate a z value from the surrounding vertices.

bool geos::triangulate::quadedge::Vertex::isCCW ( const Vertex b,
const Vertex c 
) const
inline

Tests whether the triangle formed by this vertex and two other vertices is in CCW orientation.

Parameters
ba vertex
ca vertex
Returns
true if the triangle is oriented CCW

Definition at line 223 of file Vertex.h.

References p, geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

bool geos::triangulate::quadedge::Vertex::isInCircle ( const Vertex a,
const Vertex b,
const Vertex c 
) const
inline

Tests if the vertex is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).

Parameters
aa vertex of the triangle
ba vertex of the triangle
ca vertex of the triangle
Returns
true if this vertex is in the circumcircle of (a,b,c)

Definition at line 210 of file Vertex.h.

References geos::geom::TrianglePredicate::isInCircleRobust(), and p.

Here is the call graph for this function:

bool geos::triangulate::quadedge::Vertex::leftOf ( const QuadEdge e) const
double geos::triangulate::quadedge::Vertex::magn ( ) const
inline

Definition at line 184 of file Vertex.h.

References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

std::unique_ptr<Vertex> geos::triangulate::quadedge::Vertex::midPoint ( const Vertex a)
private

returns a new vertex that is mid-way between this vertex and another end point.

Parameters
athe other end point.
Returns
the point mid-way between this and that.
bool geos::triangulate::quadedge::Vertex::rightOf ( const QuadEdge e) const
void geos::triangulate::quadedge::Vertex::setZ ( double  _z)
inline

Definition at line 101 of file Vertex.h.

References geos::geom::Coordinate::z.

std::unique_ptr<Vertex> geos::triangulate::quadedge::Vertex::sub ( const Vertex v) const
inline

Definition at line 177 of file Vertex.h.

References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Here is the call graph for this function:

std::unique_ptr<Vertex> geos::triangulate::quadedge::Vertex::sum ( Vertex  v) const
inline

Definition at line 170 of file Vertex.h.

References getX(), getY(), geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Here is the call graph for this function:

std::unique_ptr<Vertex> geos::triangulate::quadedge::Vertex::times ( double  c) const
inline

Computes the scalar product c(v)

Parameters
cscaling factor
Returns
returns the scaled vector

Definition at line 163 of file Vertex.h.

References geos::geom::Coordinate::x, and geos::geom::Coordinate::y.

Member Data Documentation

const int geos::triangulate::quadedge::Vertex::BEHIND = 3
static

Definition at line 65 of file Vertex.h.

const int geos::triangulate::quadedge::Vertex::BETWEEN = 4
static

Definition at line 66 of file Vertex.h.

const int geos::triangulate::quadedge::Vertex::BEYOND = 2
static

Definition at line 64 of file Vertex.h.

const int geos::triangulate::quadedge::Vertex::DESTINATION = 6
static

Definition at line 68 of file Vertex.h.

const int geos::triangulate::quadedge::Vertex::LEFT = 0
static

Definition at line 62 of file Vertex.h.

const int geos::triangulate::quadedge::Vertex::ORIGIN = 5
static

Definition at line 67 of file Vertex.h.

geom::Coordinate geos::triangulate::quadedge::Vertex::p
private

Definition at line 70 of file Vertex.h.

Referenced by isCCW(), and isInCircle().

const int geos::triangulate::quadedge::Vertex::RIGHT = 1
static

Definition at line 63 of file Vertex.h.


The documentation for this class was generated from the following file: