GEOS 3.9.1
Label.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/Label.java r428 (JTS-1.12+)
17 *
18 **********************************************************************/
19
20
21#ifndef GEOS_GEOMGRAPH_LABEL_H
22#define GEOS_GEOMGRAPH_LABEL_H
23
24#include <geos/export.h>
25#include <geos/geom/Location.h>
26#include <geos/geomgraph/TopologyLocation.h>
27
28#include <geos/inline.h>
29
30#include <iosfwd> // for operator<<
31
32namespace geos {
33namespace geomgraph { // geos.geomgraph
34
59class GEOS_DLL Label {
60
61public:
62
63 friend std::ostream& operator<< (std::ostream&, const Label&);
64
70 static Label toLineLabel(const Label& label);
71
76
84 Label(uint32_t geomIndex, geom::Location onLoc);
85
92
94 Label(const Label& l);
95
96 Label& operator= (const Label& l);
97
104
111 Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc);
112
113 void flip();
114
115 geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const;
116
117 geom::Location getLocation(uint32_t geomIndex) const;
118
119 void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location);
120
121 void setLocation(uint32_t geomIndex, geom::Location location);
122
123 void setAllLocations(uint32_t geomIndex, geom::Location location);
124
125 void setAllLocationsIfNull(uint32_t geomIndex, geom::Location location);
126
127 void setAllLocationsIfNull(geom::Location location);
128
135 void merge(const Label& lbl);
136
137 int getGeometryCount() const;
138
139 bool isNull() const;
140
141 bool isNull(uint32_t geomIndex) const;
142
143 bool isAnyNull(uint32_t geomIndex) const;
144
145 bool isArea() const;
146
147 bool isArea(uint32_t geomIndex) const;
148
149 bool isLine(uint32_t geomIndex) const;
150
151 bool isEqualOnSide(const Label& lbl, uint32_t side) const;
152
153 bool allPositionsEqual(uint32_t geomIndex, geom::Location loc) const;
154
158 void toLine(uint32_t geomIndex);
159
160 std::string toString() const;
161
162private:
163
164 TopologyLocation elt[2];
165};
166
167std::ostream& operator<< (std::ostream&, const Label&);
168
169} // namespace geos.geomgraph
170} // namespace geos
171
172
173#ifdef GEOS_INLINE
174# include "geos/geomgraph/Label.inl"
175#endif
176
177#endif // ifndef GEOS_GEOMGRAPH_LABEL_H
178
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition Label.h:59
Label(geom::Location onLoc)
Construct a Label with a single location for both Geometries.
Label(geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
Construct a Label with On, Left and Right locations for both Geometries.
void merge(const Label &lbl)
Merge this label with another one.
Label(uint32_t geomIndex, geom::Location onLoc)
Construct a Label with the location specified for the given Geometry.
Label()
Initialize both locations to Location::NONE.
static Label toLineLabel(const Label &label)
Converts a Label to a Line label (that is, one with no side Locations)
Label(const Label &l)
Copy ctor.
Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
Construct a Label with On, Left and Right locations for the given Geometries. Initialize the location...
void toLine(uint32_t geomIndex)
Converts one GeometryLocation to a Line location.
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