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