TopologyLocation.h

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

Generated on Fri Mar 27 04:53:03 2009 for GEOS by  doxygen 1.5.4