GEOS 3.11.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#pragma once
20
21#include <geos/export.h>
22
23#include <cstddef>
24
25// Forward declarations
26namespace geos {
27namespace geom {
28class CoordinateSequence;
29}
30namespace noding {
31//class SegmentString;
32}
33}
34
35namespace geos {
36namespace noding { // geos.noding
37
43public:
44
52 :
53 pts(&p_pts),
54 orientationVar(orientation(p_pts))
55 {
56 }
57
69 int compareTo(const OrientedCoordinateArray& o1) const;
70
71 bool operator==(const OrientedCoordinateArray& other) const;
72
73 struct GEOS_DLL HashCode {
74 std::size_t operator()(const OrientedCoordinateArray & oca) const;
75 };
76
77private:
78
79 static int compareOriented(const geom::CoordinateSequence& pts1,
80 bool orientation1,
81 const geom::CoordinateSequence& pts2,
82 bool orientation2);
83
84
92 static bool orientation(const geom::CoordinateSequence& pts);
93
95 const geom::CoordinateSequence* pts;
96
97 bool orientationVar;
98
99};
100
104inline bool
106 const OrientedCoordinateArray& oca2)
107{
108 return oca1.compareTo(oca2) < 0;
109}
110
111} // namespace geos.noding
112} // namespace geos
113
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Allows comparing geom::CoordinateSequences in an orientation-independent way.
Definition: OrientedCoordinateArray.h:42
int compareTo(const OrientedCoordinateArray &o1) const
Compares two OrientedCoordinateArrays for their relative order.
OrientedCoordinateArray(const geom::CoordinateSequence &p_pts)
Definition: OrientedCoordinateArray.h:51
bool operator<(const OrientedCoordinateArray &oca1, const OrientedCoordinateArray &oca2)
Definition: OrientedCoordinateArray.h:105
Basic namespace for all GEOS functionalities.
Definition: geos.h:39