OrientedCoordinateArray.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2009 Sandro Santilli <strk@kbt.io>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <cstddef>
// Forward declarations
namespace geos {
namespace geom {
class CoordinateSequence;
}
namespace noding {
//class SegmentString;
}
}
namespace geos {
namespace noding { // geos.noding
class GEOS_DLL OrientedCoordinateArray {
public:
OrientedCoordinateArray(const geom::CoordinateSequence& p_pts)
:
pts(&p_pts),
orientationVar(orientation(p_pts))
{
}
int compareTo(const OrientedCoordinateArray& o1) const;
bool operator==(const OrientedCoordinateArray& other) const;
struct GEOS_DLL HashCode {
std::size_t operator()(const OrientedCoordinateArray & oca) const;
};
private:
static int compareOriented(const geom::CoordinateSequence& pts1,
bool orientation1,
const geom::CoordinateSequence& pts2,
bool orientation2);
static bool orientation(const geom::CoordinateSequence& pts);
const geom::CoordinateSequence* pts;
bool orientationVar;
};
inline bool
operator< (const OrientedCoordinateArray& oca1,
const OrientedCoordinateArray& oca2)
{
return oca1.compareTo(oca2) < 0;
}
} // namespace geos.noding
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::noding::OrientedCoordinateArray
Allows comparing geom::CoordinateSequences in an orientation-independent way.
Definition OrientedCoordinateArray.h:42
geos::noding::OrientedCoordinateArray::compareTo
int compareTo(const OrientedCoordinateArray &o1) const
Compares two OrientedCoordinateArrays for their relative order.
geos::noding::OrientedCoordinateArray::OrientedCoordinateArray
OrientedCoordinateArray(const geom::CoordinateSequence &p_pts)
Definition OrientedCoordinateArray.h:51
geos::geom
Definition Angle.h:26
geos::noding
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
geos::noding::operator<
bool operator<(const OrientedCoordinateArray &oca1, const OrientedCoordinateArray &oca2)
Definition OrientedCoordinateArray.h:105
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38