• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List

EdgeEndStar.h

00001 /**********************************************************************
00002  * $Id: EdgeEndStar.h 2961 2010-03-29 12:17:37Z 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/EdgeEndStar.java rev. 1.8 (JTS-1.10)
00018  *
00019  **********************************************************************/
00020 
00021 
00022 #ifndef GEOS_GEOMGRAPH_EDGEENDSTAR_H
00023 #define GEOS_GEOMGRAPH_EDGEENDSTAR_H
00024 
00025 #include <geos/export.h>
00026 #include <geos/geomgraph/EdgeEnd.h>  // for EdgeEndLT
00027 #include <geos/geom/Coordinate.h>  // for p0,p1
00028 
00029 #include <geos/inline.h>
00030 
00031 #include <set>
00032 #include <string>
00033 #include <vector>
00034 #include <algorithm> // for inlines (find)
00035 
00036 #ifdef _MSC_VER
00037 #pragma warning(push)
00038 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00039 #endif
00040 
00041 // Forward declarations
00042 namespace geos {
00043         namespace algorithm {
00044                 class BoundaryNodeRule;
00045         }
00046         namespace geomgraph {
00047                 class GeometryGraph;
00048         }
00049 }
00050 
00051 namespace geos {
00052 namespace geomgraph { // geos.geomgraph
00053 
00054 
00063 class GEOS_DLL EdgeEndStar {
00064 public:
00065 
00066         typedef std::set<EdgeEnd *, EdgeEndLT> container;
00067 
00068         typedef container::iterator iterator;
00069         typedef container::reverse_iterator reverse_iterator;
00070 
00071         EdgeEndStar();
00072 
00073         virtual ~EdgeEndStar() {};
00074 
00078         virtual void insert(EdgeEnd *e)=0;
00079 
00087         virtual geom::Coordinate& getCoordinate();
00088 
00089         virtual std::size_t getDegree();
00090 
00091         virtual iterator begin();
00092 
00093         virtual iterator end();
00094 
00095         virtual reverse_iterator rbegin();
00096 
00097         virtual reverse_iterator rend();
00098 
00099         virtual container &getEdges();
00100 
00101 
00102         virtual EdgeEnd* getNextCW(EdgeEnd *ee);
00103 
00104         virtual void computeLabelling(std::vector<GeometryGraph*> *geomGraph);
00105                 // throw(TopologyException *);
00106 
00107         virtual bool isAreaLabelsConsistent(const GeometryGraph& geomGraph);
00108 
00109         virtual void propagateSideLabels(int geomIndex);
00110                 // throw(TopologyException *);
00111 
00112         //virtual int findIndex(EdgeEnd *eSearch);
00113         virtual iterator find(EdgeEnd *eSearch);
00114 
00115         virtual std::string print();
00116 
00117 protected:
00118 
00123         EdgeEndStar::container edgeMap;
00124 
00128         virtual void insertEdgeEnd(EdgeEnd *e) { edgeMap.insert(e); }
00129 
00130 private:
00131 
00132         virtual int getLocation(int geomIndex,
00133                 const geom::Coordinate& p,
00134                 std::vector<GeometryGraph*> *geom); 
00135 
00140         int ptInAreaLocation[2];
00141 
00142         virtual void computeEdgeEndLabels(const algorithm::BoundaryNodeRule&);
00143 
00144         virtual bool checkAreaLabelsConsistent(int geomIndex);
00145 
00146 };
00147 
00148 inline std::size_t
00149 EdgeEndStar::getDegree()
00150 {
00151         return edgeMap.size();
00152 }
00153 
00154 inline EdgeEndStar::iterator
00155 EdgeEndStar::begin()
00156 {
00157         return edgeMap.begin();
00158 }
00159 
00160 inline EdgeEndStar::container&
00161 EdgeEndStar::getEdges()
00162 {
00163         return edgeMap;
00164 }
00165 
00166 inline EdgeEndStar::reverse_iterator
00167 EdgeEndStar::rend()
00168 {
00169         return edgeMap.rend();
00170 }
00171 
00172 inline EdgeEndStar::iterator
00173 EdgeEndStar::end()
00174 {
00175         return edgeMap.end();
00176 }
00177 
00178 inline EdgeEndStar::reverse_iterator
00179 EdgeEndStar::rbegin()
00180 {
00181         return edgeMap.rbegin();
00182 }
00183 
00184 inline EdgeEndStar::iterator
00185 EdgeEndStar::find(EdgeEnd *eSearch)
00186 {
00187         return edgeMap.find(eSearch);
00188 }
00189 
00190 
00191 } // namespace geos.geomgraph
00192 } // namespace geos
00193 
00194 //#ifdef GEOS_INLINE
00195 //# include "geos/geomgraph/EdgeEndStar.inl"
00196 //#endif
00197 
00198 #ifdef _MSC_VER
00199 #pragma warning(pop)
00200 #endif
00201 
00202 #endif // ifndef GEOS_GEOMGRAPH_EDGEENDSTAR_H
00203 
00204 /**********************************************************************
00205  * $Log$
00206  * Revision 1.4  2006/06/12 10:49:43  strk
00207  * unsigned int => size_t
00208  *
00209  * Revision 1.3  2006/04/04 13:35:55  strk
00210  * Port info, assertion checking, indentation
00211  *
00212  * Revision 1.2  2006/03/24 09:52:41  strk
00213  * USE_INLINE => GEOS_INLINE
00214  *
00215  * Revision 1.1  2006/03/09 16:46:49  strk
00216  * geos::geom namespace definition, first pass at headers split
00217  *
00218  **********************************************************************/
00219 

Generated on Thu Aug 2 2012 15:56:03 for GEOS by  doxygen 1.7.2