GEOS  3.8.0dev
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 
27 #include <vector>
28 #include <string>
29 
30 #ifdef _MSC_VER
31 #pragma warning(push)
32 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
33 #endif
34 
35 namespace geos {
36 namespace geomgraph { // geos.geomgraph
37 
58 class GEOS_DLL TopologyLocation {
59 
60 public:
61 
62  friend std::ostream& operator<< (std::ostream&, const TopologyLocation&);
63 
65 
67 
68  TopologyLocation(const std::vector<int>& newLocation);
69 
81  TopologyLocation(int on, int left, int right);
82 
83  TopologyLocation(int on);
84 
86 
87  TopologyLocation& operator= (const TopologyLocation& gl);
88 
89  int get(std::size_t posIndex) const;
90 
94  bool isNull() const;
95 
99  bool isAnyNull() const;
100 
101  bool isEqualOnSide(const TopologyLocation& le, int locIndex) const;
102 
103  bool isArea() const;
104 
105  bool isLine() const;
106 
107  void flip();
108 
109  void setAllLocations(int locValue);
110 
111  void setAllLocationsIfNull(int locValue);
112 
113  void setLocation(std::size_t locIndex, int locValue);
114 
115  void setLocation(int locValue);
116 
118  const std::vector<int>& getLocations() const;
119 
120  void setLocations(int on, int left, int right);
121 
122  bool allPositionsEqual(int loc) const;
123 
128  void merge(const TopologyLocation& gl);
129 
130  std::string toString() const;
131 
132 private:
133 
134  std::vector<int> location;
135 };
136 
137 std::ostream& operator<< (std::ostream&, const TopologyLocation&);
138 
139 } // namespace geos.geomgraph
140 } // namespace geos
141 
142 //#ifdef GEOS_INLINE
143 //# include "geos/geomgraph/TopologyLocation.inl"
144 //#endif
145 
146 #ifdef _MSC_VER
147 #pragma warning(pop)
148 #endif
149 
150 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
151 
A TopologyLocation is the labelling of a GraphComponent's topological relationship to a single Geomet...
Definition: TopologyLocation.h:58
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25