GEOS 3.2.1
|
00001 /********************************************************************** 00002 * $Id: TopologyLocation.h 2557 2009-06-08 09:30:55Z strk $ 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 namespace geos { 00032 namespace geomgraph { // geos.geomgraph 00033 00054 class GEOS_DLL TopologyLocation { 00055 00056 public: 00057 00058 friend std::ostream& operator<< (std::ostream&, const TopologyLocation&); 00059 00060 TopologyLocation(); 00061 00062 ~TopologyLocation(); 00063 00064 TopologyLocation(const std::vector<int> &newLocation); 00065 00077 TopologyLocation(int on, int left, int right); 00078 00079 TopologyLocation(int on); 00080 00081 TopologyLocation(const TopologyLocation &gl); 00082 00083 int get(size_t posIndex) const; 00084 00088 bool isNull() const; 00089 00093 bool isAnyNull() const; 00094 00095 bool isEqualOnSide(const TopologyLocation &le, int locIndex) const; 00096 00097 bool isArea() const; 00098 00099 bool isLine() const; 00100 00101 void flip(); 00102 00103 void setAllLocations(int locValue); 00104 00105 void setAllLocationsIfNull(int locValue); 00106 00107 void setLocation(size_t locIndex, int locValue); 00108 00109 void setLocation(int locValue); 00110 00112 const std::vector<int> &getLocations() const; 00113 00114 void setLocations(int on, int left, int right); 00115 00116 bool allPositionsEqual(int loc) const; 00117 00122 void merge(const TopologyLocation &gl); 00123 00124 std::string toString() const; 00125 00126 private: 00127 00128 std::vector<int> location; 00129 }; 00130 00131 std::ostream& operator<< (std::ostream&, const TopologyLocation&); 00132 00133 } // namespace geos.geomgraph 00134 } // namespace geos 00135 00136 //#ifdef GEOS_INLINE 00137 //# include "geos/geomgraph/TopologyLocation.inl" 00138 //#endif 00139 00140 #endif // ifndef GEOS_GEOMGRAPH_TOPOLOGYLOCATION_H 00141 00142 /********************************************************************** 00143 * $Log$ 00144 * Revision 1.4 2006/06/12 11:29:23 strk 00145 * unsigned int => size_t 00146 * 00147 * Revision 1.3 2006/04/06 09:01:11 strk 00148 * Doxygen comments, port info, operator<<, assertion checking 00149 * 00150 * Revision 1.2 2006/03/24 09:52:41 strk 00151 * USE_INLINE => GEOS_INLINE 00152 * 00153 * Revision 1.1 2006/03/09 16:46:49 strk 00154 * geos::geom namespace definition, first pass at headers split 00155 * 00156 **********************************************************************/ 00157