GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net> 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/DirectedEdgeStar.java r428 (JTS-1.12+) 00018 * 00019 **********************************************************************/ 00020 00021 00022 #ifndef GEOS_GEOMGRAPH_DIRECTEDEDGEENDSTAR_H 00023 #define GEOS_GEOMGRAPH_DIRECTEDEDGEENDSTAR_H 00024 00025 #include <geos/export.h> 00026 #include <set> 00027 #include <string> 00028 #include <vector> 00029 00030 #include <geos/geomgraph/EdgeEndStar.h> // for inheritance 00031 #include <geos/geomgraph/Label.h> // for private member 00032 #include <geos/geom/Coordinate.h> // for p0,p1 00033 00034 #include <geos/inline.h> 00035 00036 // Forward declarations 00037 namespace geos { 00038 namespace geomgraph { 00039 class DirectedEdge; 00040 class EdgeRing; 00041 } 00042 } 00043 00044 namespace geos { 00045 namespace geomgraph { // geos.geomgraph 00046 00055 class GEOS_DLL DirectedEdgeStar: public EdgeEndStar { 00056 00057 public: 00058 00059 DirectedEdgeStar() 00060 : 00061 EdgeEndStar(), 00062 resultAreaEdgeList(0), 00063 label() 00064 {} 00065 00066 ~DirectedEdgeStar() { 00067 delete resultAreaEdgeList; 00068 } 00069 00071 void insert(EdgeEnd *ee); 00072 00073 Label &getLabel() { return label; } 00074 00075 int getOutgoingDegree(); 00076 00077 int getOutgoingDegree(EdgeRing *er); 00078 00079 DirectedEdge* getRightmostEdge(); 00080 00085 void computeLabelling(std::vector<GeometryGraph*> *geom); // throw(TopologyException *); 00086 00091 void mergeSymLabels(); 00092 00094 void updateLabelling(const Label& nodeLabel); 00095 00096 00114 void linkResultDirectedEdges(); // throw(TopologyException *); 00115 00116 void linkMinimalDirectedEdges(EdgeRing *er); 00117 00118 void linkAllDirectedEdges(); 00119 00126 void findCoveredLineEdges(); 00127 00133 void computeDepths(DirectedEdge *de); 00134 00135 virtual std::string print() const; 00136 00137 private: 00138 00142 std::vector<DirectedEdge*> *resultAreaEdgeList; 00143 00144 Label label; 00145 00149 std::vector<DirectedEdge*>* getResultAreaEdges(); 00150 00152 enum { 00153 SCANNING_FOR_INCOMING=1, 00154 LINKING_TO_OUTGOING 00155 }; 00156 00157 int computeDepths(EdgeEndStar::iterator startIt, 00158 EdgeEndStar::iterator endIt, int startDepth); 00159 }; 00160 00161 00162 } // namespace geos.geomgraph 00163 } // namespace geos 00164 00165 //#ifdef GEOS_INLINE 00166 //# include "geos/geomgraph/DirectedEdgeEndStar.inl" 00167 //#endif 00168 00169 #endif // ifndef GEOS_GEOMGRAPH_DIRECTEDEDGEENDSTAR_H 00170