DirectedEdge.h

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/DirectedEdge.java r428 (JTS-1.12)
00018  *
00019  **********************************************************************/
00020 
00021 
00022 #ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H
00023 #define GEOS_GEOMGRAPH_DIRECTEDEDGE_H
00024 
00025 #include <geos/export.h>
00026 #include <string>
00027 
00028 #include <geos/geomgraph/EdgeEnd.h> // for inheritance
00029 
00030 #include <geos/inline.h>
00031 
00032 // Forward declarations
00033 namespace geos {
00034         namespace geomgraph {
00035                 class Edge;
00036                 class EdgeRing;
00037         }
00038 }
00039 
00040 namespace geos {
00041 namespace geomgraph { // geos.geomgraph
00042 
00044 class GEOS_DLL DirectedEdge: public EdgeEnd {
00045 
00046 public:
00047 
00054         static int depthFactor(int currLocation, int nextLocation);
00055 
00056         //DirectedEdge();       
00057         //virtual ~DirectedEdge();      
00058 
00059         DirectedEdge(Edge *newEdge, bool newIsForward);
00060 
00061         // this is no different from Base class, no need to override
00062         //Edge* getEdge();
00063 
00064         void setInResult(bool newIsInResult);
00065 
00066         bool isInResult();
00067 
00068         bool isVisited();
00069 
00070         void setVisited(bool newIsVisited);
00071 
00072         void setEdgeRing(EdgeRing *newEdgeRing);
00073 
00074         EdgeRing* getEdgeRing();
00075 
00076         void setMinEdgeRing(EdgeRing *newMinEdgeRing);
00077 
00078         EdgeRing* getMinEdgeRing();
00079 
00080         int getDepth(int position);
00081 
00082         void setDepth(int position, int newDepth);
00083 
00084         int getDepthDelta();
00085 
00087         //
00091         void setVisitedEdge(bool newIsVisited);
00092 
00093 
00101         DirectedEdge* getSym();
00102 
00103         bool isForward();
00104 
00105         void setSym(DirectedEdge *de);
00106 
00107         DirectedEdge* getNext();
00108 
00109         void setNext(DirectedEdge *newNext);
00110 
00111         DirectedEdge* getNextMin();
00112 
00113         void setNextMin(DirectedEdge *newNextMin);
00114 
00123         bool isLineEdge();
00124 
00134         bool isInteriorAreaEdge();
00135 
00143         void setEdgeDepths(int position, int newDepth);
00144 
00145         std::string print();
00146 
00147         std::string printEdge();
00148 
00149 protected:
00150 
00151         bool isForwardVar;
00152 
00153 private:
00154 
00155         bool isInResultVar;
00156 
00157         bool isVisitedVar;
00158 
00160         DirectedEdge *sym;
00161 
00163         DirectedEdge *next; 
00164 
00166         DirectedEdge *nextMin; 
00167 
00169         EdgeRing *edgeRing; 
00170 
00172         EdgeRing *minEdgeRing; 
00173 
00178         int depth[3];
00179 
00181         void computeDirectedLabel();
00182 };
00183 
00184 } // namespace geos.geomgraph
00185 } // namespace geos
00186 
00187 #ifdef GEOS_INLINE
00188 # include "geos/geomgraph/DirectedEdge.inl"
00189 #endif
00190 
00191 #endif // ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H

Generated on 23 Sep 2013 for GEOS by  doxygen 1.4.7