/src/geos/include/geos/noding/DirectionIndependentArcString.h
Line | Count | Source |
1 | | /********************************************************************** |
2 | | * |
3 | | * GEOS - Geometry Engine Open Source |
4 | | * http://geos.osgeo.org |
5 | | * |
6 | | * Copyright (C) 2026 ISciences, LLC |
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 | | #pragma once |
16 | | |
17 | | #include <memory> |
18 | | #include <geos/export.h> |
19 | | |
20 | | |
21 | | namespace geos::noding { |
22 | | class ArcString; |
23 | | } |
24 | | |
25 | | namespace geos::noding { |
26 | | |
27 | | /// The DirectionIndependentArcString is a thin wrapper over an ArcString that provides specialized |
28 | | /// equality-testing and hashing functions. DirectionIndependentArcStrings are considered equal |
29 | | /// if they cover the same path, regardless of direction. The control points of arcs are not required |
30 | | /// to be identical, but must describe the same arc. |
31 | | class GEOS_DLL DirectionIndependentArcString { |
32 | | |
33 | | public: |
34 | | |
35 | 0 | explicit DirectionIndependentArcString(const ArcString& as) : m_as(as) {} |
36 | | |
37 | | const ArcString& getArcString() const |
38 | 0 | { |
39 | 0 | return m_as; |
40 | 0 | } |
41 | | |
42 | | bool operator==(const DirectionIndependentArcString& other) const; |
43 | | |
44 | | private: |
45 | | const ArcString& m_as; |
46 | | }; |
47 | | } |
48 | | |
49 | | template<> |
50 | | struct GEOS_DLL std::hash<geos::noding::DirectionIndependentArcString> { |
51 | | std::size_t operator()(const geos::noding::DirectionIndependentArcString& as) const noexcept; |
52 | | }; |