GEOS  3.3.3
RightmostEdgeFinder.h
1 /**********************************************************************
2  * $Id: RightmostEdgeFinder.h 3245 2011-02-23 16:46:10Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2006 Refractions Research Inc.
8  *
9  * This is free software; you can redistribute and/or modify it under
10  * the terms of the GNU Lesser General Public Licence as published
11  * by the Free Software Foundation.
12  * See the COPYING file for more information.
13  *
14  **********************************************************************
15  *
16  * Last port: operation/buffer/RightmostEdgeFinder.java r320 (JTS-1.12)
17  *
18  **********************************************************************/
19 
20 #ifndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
21 #define GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
22 
23 #include <geos/export.h>
24 
25 #include <geos/geom/Coordinate.h> // for composition
26 
27 #include <vector>
28 
29 // Forward declarations
30 namespace geos {
31  namespace geom {
32  }
33  namespace geomgraph {
34  class DirectedEdge;
35  }
36 }
37 
38 namespace geos {
39 namespace operation { // geos.operation
40 namespace buffer { // geos.operation.buffer
41 
48 class GEOS_DLL RightmostEdgeFinder {
49 
50 private:
51 
52  int minIndex;
53 
54  geom::Coordinate minCoord;
55 
57 
58  geomgraph::DirectedEdge *orientedDe;
59 
60  void findRightmostEdgeAtNode();
61 
62  void findRightmostEdgeAtVertex();
63 
64  void checkForRightmostCoordinate(geomgraph::DirectedEdge *de);
65 
66  int getRightmostSide(geomgraph::DirectedEdge *de, int index);
67 
68  int getRightmostSideOfSegment(geomgraph::DirectedEdge *de, int i);
69 
70 public:
71 
80 
81  geomgraph::DirectedEdge* getEdge();
82 
83  geom::Coordinate& getCoordinate();
84 
86  void findEdge(std::vector<geomgraph::DirectedEdge*>* dirEdgeList);
87 };
88 
89 /*public*/
91 RightmostEdgeFinder::getEdge()
92 {
93  return orientedDe;
94 }
95 
96 /*public*/
97 inline geom::Coordinate&
98 RightmostEdgeFinder::getCoordinate()
99 {
100  return minCoord;
101 }
102 
103 
104 
105 
106 } // namespace geos::operation::buffer
107 } // namespace geos::operation
108 } // namespace geos
109 
110 #endif // ndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
111 
112 /**********************************************************************
113  * $Log$
114  * Revision 1.3 2006/05/04 12:19:59 strk
115  * Added note about findEdge() only scanning for forward DirectedEdges
116  *
117  * Revision 1.2 2006/04/05 09:20:25 strk
118  * Added port informations and many assertion checking.
119  * Fixed bug in getRightmostSide() method ( a "testing-only" corner case )
120  *
121  * Revision 1.1 2006/03/14 00:19:40 strk
122  * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/
123  *
124  **********************************************************************/
125