GEOS 3.11.1
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#pragma once
20
21#include <geos/export.h>
22
23#include <geos/geom/Coordinate.h> // for composition
24
25#include <vector>
26
27// Forward declarations
28namespace geos {
29namespace geom {
30}
31namespace geomgraph {
32class DirectedEdge;
33}
34}
35
36namespace geos {
37namespace operation { // geos.operation
38namespace buffer { // geos.operation.buffer
39
46class GEOS_DLL RightmostEdgeFinder {
47
48private:
49
50 int minIndex;
51
52 geom::Coordinate minCoord;
53
55
56 geomgraph::DirectedEdge* orientedDe;
57
58 void findRightmostEdgeAtNode();
59
60 void findRightmostEdgeAtVertex();
61
62 void checkForRightmostCoordinate(geomgraph::DirectedEdge* de);
63
64 int getRightmostSide(geomgraph::DirectedEdge* de, int index);
65
66 static int getRightmostSideOfSegment(geomgraph::DirectedEdge* de, int i);
67
68public:
69
78
79 geomgraph::DirectedEdge* getEdge();
80
81 geom::Coordinate& getCoordinate();
82
84 void findEdge(std::vector<geomgraph::DirectedEdge*>* dirEdgeList);
85};
86
87/*public*/
89RightmostEdgeFinder::getEdge()
90{
91 return orientedDe;
92}
93
94/*public*/
95inline geom::Coordinate&
96RightmostEdgeFinder::getCoordinate()
97{
98 return minCoord;
99}
100
101
102} // namespace geos::operation::buffer
103} // namespace geos::operation
104} // namespace geos
105
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:42
A RightmostEdgeFinder find the geomgraph::DirectedEdge in a list which has the highest coordinate,...
Definition: RightmostEdgeFinder.h:46
void findEdge(std::vector< geomgraph::DirectedEdge * > *dirEdgeList)
Note that only Forward DirectedEdges will be checked.
RightmostEdgeFinder()
A RightmostEdgeFinder finds the geomgraph::DirectedEdge with the rightmost coordinate.
Basic namespace for all GEOS functionalities.
Definition: geos.h:39