GEOS  3.9.0dev
TopologyLocation.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2005-2006 Refractions Research Inc.
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
13  *
14  **********************************************************************
15  *
16  * Last port: geomgraph/TopologyLocation.java r428 (JTS-1.12+)
17  *
18  **********************************************************************/
19
20
21 #ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
22 #define GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
23
24 #include <geos/export.h>
25 #include <geos/inline.h>
26 #include <geos/geom/Location.h>
27
28 #include <vector>
29 #include <array>
30 #include <string>
31
32 #ifdef _MSC_VER
33 #pragma warning(push)
34 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
35 #endif
36
37 namespace geos {
38 namespace geomgraph { // geos.geomgraph
39
60 class GEOS_DLL TopologyLocation {
61
62 public:
63
64  friend std::ostream& operator<< (std::ostream&, const TopologyLocation&);
65
66  TopologyLocation() = default;
67
80
82
84
85  TopologyLocation& operator= (const TopologyLocation& gl);
86
87  geom::Location get(std::size_t posIndex) const;
88
92  bool isNull() const;
93
97  bool isAnyNull() const;
98
99  bool isEqualOnSide(const TopologyLocation& le, int locIndex) const;
100
101  bool isArea() const;
102
103  bool isLine() const;
104
105  void flip();
106
107  void setAllLocations(geom::Location locValue);
108
109  void setAllLocationsIfNull(geom::Location locValue);
110
111  void setLocation(std::size_t locIndex, geom::Location locValue);
112
113  void setLocation(geom::Location locValue);
114
116  const std::array<geom::Location, 3>& getLocations() const;
117
118  void setLocations(geom::Location on, geom::Location left, geom::Location right);
119
120  bool allPositionsEqual(geom::Location loc) const;
121
126  void merge(const TopologyLocation& gl);
127
128  std::string toString() const;
129
130 private:
131
132  std::array<geom::Location, 3> location;
133  std::uint8_t locationSize;
134 };
135
136 std::ostream& operator<< (std::ostream&, const TopologyLocation&);
137
138 } // namespace geos.geomgraph
139 } // namespace geos
140
141 #ifdef GEOS_INLINE
142 # include "geos/geomgraph/TopologyLocation.inl"
143 #endif
144
145 #ifdef _MSC_VER
146 #pragma warning(pop)
147 #endif
148
149 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
150
A TopologyLocation is the labelling of a GraphComponent's topological relationship to a single Geomet...
Definition: TopologyLocation.h:60
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:34
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26