#include <CGAlgorithms.h>
Public Types | |
enum | { CLOCKWISE = -1, COLLINEAR, COUNTERCLOCKWISE } |
enum | { RIGHT = -1, LEFT, STRAIGHT } |
Static Public Member Functions | |
bool | isPointInRing (const geom::Coordinate &p, const geom::CoordinateSequence *ring) |
Tests whether a point lies inside a ring. | |
bool | isPointInRing (const geom::Coordinate &p, const std::vector< const geom::Coordinate * > &ring) |
Same as above, but taking a vector of const Coordinates (faster). | |
int | locatePointInRing (const geom::Coordinate &p, const geom::CoordinateSequence &ring) |
Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. | |
int | locatePointInRing (const geom::Coordinate &p, const std::vector< const geom::Coordinate * > &ring) |
Same as above, but taking a vector of const Coordinates. | |
bool | isOnLine (const geom::Coordinate &p, const geom::CoordinateSequence *pt) |
Test whether a point lies on the given line segment. | |
bool | isCCW (const geom::CoordinateSequence *ring) |
Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise. | |
int | computeOrientation (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q) |
Computes the orientation of a point q to the directed line segment p1-p2. | |
double | distancePointLine (const geom::Coordinate &p, const geom::Coordinate &A, const geom::Coordinate &B) |
Computes the distance from a point p to a line segment AB. | |
double | distancePointLinePerpendicular (const geom::Coordinate &p, const geom::Coordinate &A, const geom::Coordinate &B) |
Computes the perpendicular distance from a point p to the (infinite) line containing the points AB. | |
double | distanceLineLine (const geom::Coordinate &A, const geom::Coordinate &B, const geom::Coordinate &C, const geom::Coordinate &D) |
Computes the distance from a line segment AB to a line segment CD. | |
double | signedArea (const geom::CoordinateSequence *ring) |
Returns the signed area for a ring. The area is positive if the ring is oriented CW. | |
double | length (const geom::CoordinateSequence *pts) |
Computes the length of a linestring specified by a sequence of points. | |
int | orientationIndex (const geom::Coordinate &p1, const geom::Coordinate &p2, const geom::Coordinate &q) |
Returns the index of the direction of the point q relative to a vector specified by p1-p2 . |
|
Computes the orientation of a point q to the directed line segment p1-p2. The orientation of a point relative to a directed line segment indicates which way you turn to get to q after travelling from p1 to p2.
|
|
Computes the distance from a line segment AB to a line segment CD. Note: NON-ROBUST!
|
|
Computes the distance from a point p to a line segment AB. Note: NON-ROBUST!
|
|
Computes the perpendicular distance from a point p to the (infinite) line containing the points AB.
|
|
Computes whether a ring defined by an array of Coordinate is oriented counter-clockwise.
This algorithm is only guaranteed to work with valid rings. If the ring is invalid (e.g. self-crosses or touches), the computed result may not be correct.
|
|
Test whether a point lies on the given line segment.
|
|
Tests whether a point lies inside a ring. The ring may be oriented in either direction. A point lying exactly on the ring boundary is considered to be inside the ring. This algorithm does not first check the point against the envelope of the ring.
|
|
Computes the length of a linestring specified by a sequence of points.
|
|
Determines whether a point lies in the interior, on the boundary, or in the exterior of a ring. The ring may be oriented in either direction. This method does not first check the point against the envelope of the ring.
|
|
Returns the index of the direction of the point
|