GEOS  3.8.0dev
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/geomgraph/TopologyLocation.h>
26 
27 #include <geos/inline.h>
28 
29 #include <iosfwd> // for operator<<
30 
31 namespace geos {
32 namespace geomgraph { // geos.geomgraph
33 
57 class GEOS_DLL Label {
58 
59 public:
60 
61  friend std::ostream& operator<< (std::ostream&, const Label&);
62 
68  static Label toLineLabel(const Label& label);
69 
73  Label(int onLoc);
74 
82  Label(int geomIndex, int onLoc);
83 
89  Label(int onLoc, int leftLoc, int rightLoc);
90 
92  Label(const Label& l);
93 
94  Label& operator= (const Label& l);
95 
101  Label();
102 
109  Label(int geomIndex, int onLoc, int leftLoc, int rightLoc);
110 
111  void flip();
112 
113  int getLocation(int geomIndex, int posIndex) const;
114 
115  int getLocation(int geomIndex) const;
116 
117  void setLocation(int geomIndex, int posIndex, int location);
118 
119  void setLocation(int geomIndex, int location);
120 
121  void setAllLocations(int geomIndex, int location);
122 
123  void setAllLocationsIfNull(int geomIndex, int location);
124 
125  void setAllLocationsIfNull(int location);
126 
133  void merge(const Label& lbl);
134 
135  int getGeometryCount() const;
136 
137  bool isNull() const;
138 
139  bool isNull(int geomIndex) const;
140 
141  bool isAnyNull(int geomIndex) const;
142 
143  bool isArea() const;
144 
145  bool isArea(int geomIndex) const;
146 
147  bool isLine(int geomIndex) const;
148 
149  bool isEqualOnSide(const Label& lbl, int side) const;
150 
151  bool allPositionsEqual(int geomIndex, int loc) const;
152 
156  void toLine(int geomIndex);
157 
158  std::string toString() const;
159 
160 private:
161 
162  TopologyLocation elt[2];
163 };
164 
165 std::ostream& operator<< (std::ostream&, const Label&);
166 
167 } // namespace geos.geomgraph
168 } // namespace geos
169 
170 
171 //#ifdef GEOS_INLINE
172 //# include "geos/geomgraph/Label.inl"
173 //#endif
174 
175 #endif // ifndef GEOS_GEOMGRAPH_LABEL_H
176 
A TopologyLocation is the labelling of a GraphComponent's topological relationship to a single Geomet...
Definition: TopologyLocation.h:58
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition: Label.h:57
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25