00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
00022 #define GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
00023
00024 #include <geos/export.h>
00025 #include <geos/inline.h>
00026
00027 #include <vector>
00028 #include <string>
00029
00030 #ifdef _MSC_VER
00031 #pragma warning(push)
00032 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00033 #endif
00034
00035 namespace geos {
00036 namespace geomgraph {
00037
00058 class GEOS_DLL TopologyLocation {
00059
00060 public:
00061
00062 friend std::ostream& operator<< (std::ostream&, const TopologyLocation&);
00063
00064 TopologyLocation();
00065
00066 ~TopologyLocation();
00067
00068 TopologyLocation(const std::vector<int> &newLocation);
00069
00081 TopologyLocation(int on, int left, int right);
00082
00083 TopologyLocation(int on);
00084
00085 TopologyLocation(const TopologyLocation &gl);
00086
00087 TopologyLocation& operator= (const TopologyLocation &gl);
00088
00089 int get(std::size_t posIndex) const;
00090
00094 bool isNull() const;
00095
00099 bool isAnyNull() const;
00100
00101 bool isEqualOnSide(const TopologyLocation &le, int locIndex) const;
00102
00103 bool isArea() const;
00104
00105 bool isLine() const;
00106
00107 void flip();
00108
00109 void setAllLocations(int locValue);
00110
00111 void setAllLocationsIfNull(int locValue);
00112
00113 void setLocation(std::size_t locIndex, int locValue);
00114
00115 void setLocation(int locValue);
00116
00118 const std::vector<int> &getLocations() const;
00119
00120 void setLocations(int on, int left, int right);
00121
00122 bool allPositionsEqual(int loc) const;
00123
00128 void merge(const TopologyLocation &gl);
00129
00130 std::string toString() const;
00131
00132 private:
00133
00134 std::vector<int> location;
00135 };
00136
00137 std::ostream& operator<< (std::ostream&, const TopologyLocation&);
00138
00139 }
00140 }
00141
00142
00143
00144
00145
00146 #ifdef _MSC_VER
00147 #pragma warning(pop)
00148 #endif
00149
00150 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H
00151