GEOS  3.8.0dev
RightmostEdgeFinder.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: operation/buffer/RightmostEdgeFinder.java r320 (JTS-1.12)
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
20 #define GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
21 
22 #include <geos/export.h>
23 
24 #include <geos/geom/Coordinate.h> // for composition
25 
26 #include <vector>
27 
28 // Forward declarations
29 namespace geos {
30 namespace geom {
31 }
32 namespace geomgraph {
33 class DirectedEdge;
34 }
35 }
36 
37 namespace geos {
38 namespace operation { // geos.operation
39 namespace buffer { // geos.operation.buffer
40 
47 class GEOS_DLL RightmostEdgeFinder {
48 
49 private:
50 
51  int minIndex;
52 
53  geom::Coordinate minCoord;
54 
56 
57  geomgraph::DirectedEdge* orientedDe;
58 
59  void findRightmostEdgeAtNode();
60 
61  void findRightmostEdgeAtVertex();
62 
63  void checkForRightmostCoordinate(geomgraph::DirectedEdge* de);
64 
65  int getRightmostSide(geomgraph::DirectedEdge* de, int index);
66 
67  int getRightmostSideOfSegment(geomgraph::DirectedEdge* de, int i);
68 
69 public:
70 
79 
80  geomgraph::DirectedEdge* getEdge();
81 
82  geom::Coordinate& getCoordinate();
83 
85  void findEdge(std::vector<geomgraph::DirectedEdge*>* dirEdgeList);
86 };
87 
88 /*public*/
90 RightmostEdgeFinder::getEdge()
91 {
92  return orientedDe;
93 }
94 
95 /*public*/
96 inline geom::Coordinate&
97 RightmostEdgeFinder::getCoordinate()
98 {
99  return minCoord;
100 }
101 
102 
103 
104 
105 } // namespace geos::operation::buffer
106 } // namespace geos::operation
107 } // namespace geos
108 
109 #endif // ndef GEOS_OP_BUFFER_RIGHTMOSTEDGEFINDER_H
110 
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:45
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
A RightmostEdgeFinder find the geomgraph::DirectedEdge in a list which has the highest coordinate...
Definition: RightmostEdgeFinder.h:47