GEOS  3.9.1dev
Label.h
Go to the documentation of this file.
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>
27 
28 #include <geos/inline.h>
29 
30 #include <iosfwd> // for operator<<
31 
32 namespace geos {
33 namespace geomgraph { // geos.geomgraph
34 
59 class GEOS_DLL Label {
60 
61 public:
62 
63  friend std::ostream& operator<< (std::ostream&, const Label&);
64 
70  static Label toLineLabel(const Label& label);
71 
75  Label(geom::Location onLoc);
76 
84  Label(uint32_t geomIndex, geom::Location onLoc);
85 
91  Label(geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc);
92 
94  Label(const Label& l);
95 
96  Label& operator= (const Label& l);
97 
103  Label();
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 
162 private:
163 
165 };
166 
167 std::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 
#define GEOS_DLL
Definition: export.h:28
A TopologyLocation is the labelling of a GraphComponent&#39;s topological relationship to a single Geomet...
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:34
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:59
std::ostream & operator<<(std::ostream &os, const Edge &el)
Basic namespace for all GEOS functionalities.