GEOS 3.9.1
OrientedCoordinateArray.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2009 Sandro Santilli <strk@kbt.io>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: noding/OrientedCoordinateArray.java rev. 1.1 (JTS-1.9)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
20#define GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
21
22#include <geos/export.h>
23
24#include <cstddef>
25
26// Forward declarations
27namespace geos {
28namespace geom {
29class CoordinateSequence;
30}
31namespace noding {
32//class SegmentString;
33}
34}
35
36namespace geos {
37namespace noding { // geos.noding
38
44public:
45
53 :
54 pts(&p_pts),
55 orientationVar(orientation(p_pts))
56 {
57 }
58
70 int compareTo(const OrientedCoordinateArray& o1) const;
71
72 bool operator==(const OrientedCoordinateArray& other) const;
73
74 struct GEOS_DLL HashCode {
75 size_t operator()(const OrientedCoordinateArray & oca) const;
76 };
77
78private:
79
80 static int compareOriented(const geom::CoordinateSequence& pts1,
81 bool orientation1,
82 const geom::CoordinateSequence& pts2,
83 bool orientation2);
84
85
93 static bool orientation(const geom::CoordinateSequence& pts);
94
96 const geom::CoordinateSequence* pts;
97
98 bool orientationVar;
99
100};
101
105inline bool
107 const OrientedCoordinateArray& oca2)
108{
109 return oca1.compareTo(oca2) < 0;
110}
111
112} // namespace geos.noding
113} // namespace geos
114
115
116#endif // GEOS_NODING_ORIENTEDCOORDINATEARRAY_H
117
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:58
Allows comparing geom::CoordinateSequences in an orientation-independent way.
Definition OrientedCoordinateArray.h:43
int compareTo(const OrientedCoordinateArray &o1) const
Compares two OrientedCoordinateArrays for their relative order.
OrientedCoordinateArray(const geom::CoordinateSequence &p_pts)
Definition OrientedCoordinateArray.h:52
bool operator<(const OrientedCoordinateArray &oca1, const OrientedCoordinateArray &oca2)
Definition OrientedCoordinateArray.h:106
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26