GEOS
3.3.6
|
00001 /********************************************************************** 00002 * $Id: TopologyLocation.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: geomgraph/TopologyLocation.java rev. 1.6 (JTS-1.10) 00018 * 00019 **********************************************************************/ 00020 00021 00022 #ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H 00023 #define GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H 00024 00025 #include <geos/export.h> 00026 #include <geos/inline.h> 00027 00028 #include <vector> 00029 #include <string> 00030 00031 #ifdef _MSC_VER 00032 #pragma warning(push) 00033 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00034 #endif 00035 00036 namespace geos { 00037 namespace geomgraph { // geos.geomgraph 00038 00059 class GEOS_DLL TopologyLocation { 00060 00061 public: 00062 00063 friend std::ostream& operator<< (std::ostream&, const TopologyLocation&); 00064 00065 TopologyLocation(); 00066 00067 ~TopologyLocation(); 00068 00069 TopologyLocation(const std::vector<int> &newLocation); 00070 00082 TopologyLocation(int on, int left, int right); 00083 00084 TopologyLocation(int on); 00085 00086 TopologyLocation(const TopologyLocation &gl); 00087 00088 int get(std::size_t posIndex) const; 00089 00093 bool isNull() const; 00094 00098 bool isAnyNull() const; 00099 00100 bool isEqualOnSide(const TopologyLocation &le, int locIndex) const; 00101 00102 bool isArea() const; 00103 00104 bool isLine() const; 00105 00106 void flip(); 00107 00108 void setAllLocations(int locValue); 00109 00110 void setAllLocationsIfNull(int locValue); 00111 00112 void setLocation(std::size_t locIndex, int locValue); 00113 00114 void setLocation(int locValue); 00115 00117 const std::vector<int> &getLocations() const; 00118 00119 void setLocations(int on, int left, int right); 00120 00121 bool allPositionsEqual(int loc) const; 00122 00127 void merge(const TopologyLocation &gl); 00128 00129 std::string toString() const; 00130 00131 private: 00132 00133 std::vector<int> location; 00134 }; 00135 00136 std::ostream& operator<< (std::ostream&, const TopologyLocation&); 00137 00138 } // namespace geos.geomgraph 00139 } // namespace geos 00140 00141 //#ifdef GEOS_INLINE 00142 //# include "geos/geomgraph/TopologyLocation.inl" 00143 //#endif 00144 00145 #ifdef _MSC_VER 00146 #pragma warning(pop) 00147 #endif 00148 00149 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H 00150 00151 /********************************************************************** 00152 * $Log$ 00153 * Revision 1.4 2006/06/12 11:29:23 strk 00154 * unsigned int => size_t 00155 * 00156 * Revision 1.3 2006/04/06 09:01:11 strk 00157 * Doxygen comments, port info, operator<<, assertion checking 00158 * 00159 * Revision 1.2 2006/03/24 09:52:41 strk 00160 * USE_INLINE => GEOS_INLINE 00161 * 00162 * Revision 1.1 2006/03/09 16:46:49 strk 00163 * geos::geom namespace definition, first pass at headers split 00164 * 00165 **********************************************************************/ 00166