GEOS 3.9.1
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.
12 * See the COPYING file for more information.
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
37namespace geos {
38namespace geomgraph { // geos.geomgraph
39
60class GEOS_DLL TopologyLocation {
61
62public:
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, uint32_t 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
130private:
131
132 std::array<geom::Location, 3> location;
133 std::uint8_t locationSize;
134};
135
136std::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
const std::array< geom::Location, 3 > & getLocations() const
Warning: returns reference to owned memory.
void merge(const TopologyLocation &gl)
merge updates only the UNDEF attributes of this object with the attributes of another.
TopologyLocation(geom::Location on, geom::Location left, geom::Location right)
Constructs a TopologyLocation specifying how points on, to the left of, and to the right of some Grap...
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