GEOS 3.8.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
58class GEOS_DLL Label {
59
60public:
61
62 friend std::ostream& operator<< (std::ostream&, const Label&);
63
69 static Label toLineLabel(const Label& label);
70
75
83 Label(int geomIndex, geom::Location onLoc);
84
91
93 Label(const Label& l);
94
95 Label& operator= (const Label& l);
96
103
110 Label(int geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc);
111
112 void flip();
113
114 geom::Location getLocation(int geomIndex, int posIndex) const;
115
116 geom::Location getLocation(int geomIndex) const;
117
118 void setLocation(int geomIndex, int posIndex, geom::Location location);
119
120 void setLocation(int geomIndex, geom::Location location);
121
122 void setAllLocations(int geomIndex, geom::Location location);
123
124 void setAllLocationsIfNull(int geomIndex, geom::Location location);
125
126 void setAllLocationsIfNull(geom::Location location);
127
134 void merge(const Label& lbl);
135
136 int getGeometryCount() const;
137
138 bool isNull() const;
139
140 bool isNull(int geomIndex) const;
141
142 bool isAnyNull(int geomIndex) const;
143
144 bool isArea() const;
145
146 bool isArea(int geomIndex) const;
147
148 bool isLine(int geomIndex) const;
149
150 bool isEqualOnSide(const Label& lbl, int side) const;
151
152 bool allPositionsEqual(int geomIndex, geom::Location loc) const;
153
157 void toLine(int geomIndex);
158
159 std::string toString() const;
160
161private:
162
163 TopologyLocation elt[2];
164};
165
166std::ostream& operator<< (std::ostream&, const Label&);
167
168} // namespace geos.geomgraph
169} // namespace geos
170
171
172#ifdef GEOS_INLINE
173# include "geos/geomgraph/Label.inl"
174#endif
175
176#endif // ifndef GEOS_GEOMGRAPH_LABEL_H
177
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:58
void toLine(int geomIndex)
Converts one GeometryLocation to a Line location.
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.
Label(int geomIndex, geom::Location onLoc)
Construct a Label with the location specified for the given Geometry.
void merge(const Label &lbl)
Merge this label with another one.
Label()
Initialize both locations to Location::UNDEF.
Label(int 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...
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.
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:25