GEOS  3.9.1dev
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::noding::OrientedCoordinateArray Class Reference

Allows comparing geom::CoordinateSequences in an orientation-independent way. More...

#include <OrientedCoordinateArray.h>

Collaboration diagram for geos::noding::OrientedCoordinateArray:
[legend]

Classes

struct  HashCode
 

Public Member Functions

 OrientedCoordinateArray (const geom::CoordinateSequence &p_pts)
 
int compareTo (const OrientedCoordinateArray &o1) const
 Compares two OrientedCoordinateArrays for their relative order. More...
 
bool operator== (const OrientedCoordinateArray &other) const
 

Static Private Member Functions

static int compareOriented (const geom::CoordinateSequence &pts1, bool orientation1, const geom::CoordinateSequence &pts2, bool orientation2)
 
static bool orientation (const geom::CoordinateSequence &pts)
 

Private Attributes

const geom::CoordinateSequencepts
 Externally owned. More...
 
bool orientationVar
 

Detailed Description

Allows comparing geom::CoordinateSequences in an orientation-independent way.

Definition at line 43 of file OrientedCoordinateArray.h.

Constructor & Destructor Documentation

geos::noding::OrientedCoordinateArray::OrientedCoordinateArray ( const geom::CoordinateSequence p_pts)
inline

Creates a new OrientedCoordinateArray for the given geom::CoordinateSequence.

Parameters
p_ptsthe coordinates to orient

Definition at line 52 of file OrientedCoordinateArray.h.

References geos::geom::operator==().

Here is the call graph for this function:

Member Function Documentation

static int geos::noding::OrientedCoordinateArray::compareOriented ( const geom::CoordinateSequence pts1,
bool  orientation1,
const geom::CoordinateSequence pts2,
bool  orientation2 
)
staticprivate
int geos::noding::OrientedCoordinateArray::compareTo ( const OrientedCoordinateArray o1) const

Compares two OrientedCoordinateArrays for their relative order.

Returns
-1 this one is smaller
0 the two objects are equal
1 this one is greater

In JTS, this is used automatically by ordered lists. In C++, operator< would be used instead....

Referenced by geos::noding::operator<().

Here is the caller graph for this function:

bool geos::noding::OrientedCoordinateArray::operator== ( const OrientedCoordinateArray other) const
static bool geos::noding::OrientedCoordinateArray::orientation ( const geom::CoordinateSequence pts)
staticprivate

Computes the canonical orientation for a coordinate array.

Parameters
ptsthe array to test
Returns
true if the points are oriented forwards
false if the points are oriented in reverse

Member Data Documentation

bool geos::noding::OrientedCoordinateArray::orientationVar
private

Definition at line 98 of file OrientedCoordinateArray.h.

const geom::CoordinateSequence* geos::noding::OrientedCoordinateArray::pts
private

Externally owned.

Definition at line 96 of file OrientedCoordinateArray.h.


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