GEOS  3.3.3
geomgraph/DirectedEdge.h
1 /**********************************************************************
2  * $Id: DirectedEdge.h 2557 2009-06-08 09:30:55Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: geomgraph/DirectedEdge.java rev. 1.5 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 
22 #ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H
23 #define GEOS_GEOMGRAPH_DIRECTEDEDGE_H
24 
25 #include <geos/export.h>
26 #include <string>
27 
28 #include <geos/geomgraph/EdgeEnd.h> // for inheritance
29 
30 #include <geos/inline.h>
31 
32 // Forward declarations
33 namespace geos {
34  namespace geomgraph {
35  class Edge;
36  class EdgeRing;
37  }
38 }
39 
40 namespace geos {
41 namespace geomgraph { // geos.geomgraph
42 
44 class GEOS_DLL DirectedEdge: public EdgeEnd {
45 
46 public:
47 
54  static int depthFactor(int currLocation, int nextLocation);
55 
56  //DirectedEdge();
57  //virtual ~DirectedEdge();
58 
59  DirectedEdge(Edge *newEdge, bool newIsForward);
60 
61  // this is no different from Base class, no need to override
62  //Edge* getEdge();
63 
64  void setInResult(bool newIsInResult);
65 
66  bool isInResult();
67 
68  bool isVisited();
69 
70  void setVisited(bool newIsVisited);
71 
72  void setEdgeRing(EdgeRing *newEdgeRing);
73 
74  EdgeRing* getEdgeRing();
75 
76  void setMinEdgeRing(EdgeRing *newMinEdgeRing);
77 
78  EdgeRing* getMinEdgeRing();
79 
80  int getDepth(int position);
81 
82  void setDepth(int position, int newDepth);
83 
84  int getDepthDelta();
85 
87  //
91  void setVisitedEdge(bool newIsVisited);
92 
93 
101  DirectedEdge* getSym();
102 
103  bool isForward();
104 
105  void setSym(DirectedEdge *de);
106 
107  DirectedEdge* getNext();
108 
109  void setNext(DirectedEdge *newNext);
110 
111  DirectedEdge* getNextMin();
112 
113  void setNextMin(DirectedEdge *newNextMin);
114 
123  bool isLineEdge();
124 
134  bool isInteriorAreaEdge();
135 
143  void setEdgeDepths(int position, int newDepth);
144 
145  std::string print();
146 
147  std::string printEdge();
148 
149 protected:
150 
151  bool isForwardVar;
152 
153 private:
154 
155  bool isInResultVar;
156 
157  bool isVisitedVar;
158 
160  DirectedEdge *sym;
161 
163  DirectedEdge *next;
164 
166  DirectedEdge *nextMin;
167 
169  EdgeRing *edgeRing;
170 
172  EdgeRing *minEdgeRing;
173 
178  int depth[3];
179 
181  void computeDirectedLabel();
182 };
183 
184 } // namespace geos.geomgraph
185 } // namespace geos
186 
187 #ifdef GEOS_INLINE
188 # include "geos/geomgraph/DirectedEdge.inl"
189 #endif
190 
191 #endif // ifndef GEOS_GEOMGRAPH_DIRECTEDEDGE_H
192 
193 /**********************************************************************
194  * $Log$
195  * Revision 1.5 2006/06/14 14:32:20 strk
196  * EdgeEnd::getEdge() made non-virtual and inlined.
197  *
198  * Revision 1.4 2006/05/04 13:38:13 strk
199  * doxygen comments cleanup
200  *
201  * Revision 1.3 2006/03/24 09:52:41 strk
202  * USE_INLINE => GEOS_INLINE
203  *
204  * Revision 1.2 2006/03/15 15:27:23 strk
205  * cleanups
206  *
207  * Revision 1.1 2006/03/09 16:46:49 strk
208  * geos::geom namespace definition, first pass at headers split
209  *
210  **********************************************************************/
211