GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2005-2006 Refractions Research Inc. 00007 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 ********************************************************************** 00015 * 00016 * Last port: geomgraph/TopologyLocation.java r428 (JTS-1.12+) 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 { // geos.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 } // namespace geos.geomgraph 00140 } // namespace geos 00141 00142 //#ifdef GEOS_INLINE 00143 //# include "geos/geomgraph/TopologyLocation.inl" 00144 //#endif 00145 00146 #ifdef _MSC_VER 00147 #pragma warning(pop) 00148 #endif 00149 00150 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H 00151