GEOS 3.6.2
BufferSubgraph.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/BufferSubgraph.java r378 (JTS-1.12)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_OP_BUFFER_BUFFERSUBGRAPH_H
20#define GEOS_OP_BUFFER_BUFFERSUBGRAPH_H
21
22#include <geos/export.h>
23
24#include <geos/operation/buffer/RightmostEdgeFinder.h> // for composition
25
26#include <vector>
27#include <set>
28
29#ifdef _MSC_VER
30#pragma warning(push)
31#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32#endif
33
34// Forward declarations
35namespace geos {
36 namespace geom {
37 class Coordinate;
38 class Envelope;
39 }
40 namespace algorithm {
41 class CGAlgorithms;
42 }
43 namespace geomgraph {
44 class DirectedEdge;
45 class Node;
46 }
47}
48
49namespace geos {
50namespace operation { // geos.operation
51namespace buffer { // geos.operation.buffer
52
61class GEOS_DLL BufferSubgraph {
62private:
64
65 std::vector<geomgraph::DirectedEdge*> dirEdgeList;
66
67 std::vector<geomgraph::Node*> nodes;
68
69 geom::Coordinate *rightMostCoord;
70
71 geom::Envelope *env;
72
80 void addReachable(geomgraph::Node *startNode);
81
83 //
87 void add(geomgraph::Node* node, std::vector<geomgraph::Node*>* nodeStack);
88
89 void clearVisitedEdges();
90
97 // <FIX> MD - use iteration & queue rather than recursion, for speed and robustness
98 void computeDepths(geomgraph::DirectedEdge *startEdge);
99
100 void computeNodeDepth(geomgraph::Node *n);
101
102 void copySymDepths(geomgraph::DirectedEdge *de);
103
104 bool contains(std::set<geomgraph::Node*>& nodes, geomgraph::Node *node);
105
106public:
107
108 friend std::ostream& operator<< (std::ostream& os, const BufferSubgraph& bs);
109
110 BufferSubgraph();
111
112 ~BufferSubgraph();
113
114 std::vector<geomgraph::DirectedEdge*>* getDirectedEdges();
115
116 std::vector<geomgraph::Node*>* getNodes();
117
122
132
133 void computeDepth(int outsideDepth);
134
147
162 int compareTo(BufferSubgraph *);
163
171};
172
173std::ostream& operator<< (std::ostream& os, const BufferSubgraph& bs);
174
175// INLINES
176inline geom::Coordinate*
178
179inline std::vector<geomgraph::Node*>*
180BufferSubgraph::getNodes() { return &nodes; }
181
182inline std::vector<geomgraph::DirectedEdge*>*
183BufferSubgraph::getDirectedEdges() {
184 return &dirEdgeList;
185}
186
187bool BufferSubgraphGT(BufferSubgraph *first, BufferSubgraph *second);
188
189} // namespace geos::operation::buffer
190} // namespace geos::operation
191} // namespace geos
192
193#ifdef _MSC_VER
194#pragma warning(pop)
195#endif
196
197#endif // ndef GEOS_OP_BUFFER_BUFFERSUBGRAPH_H
198
Specifies and implements various fundamental Computational Geometric algorithms. The algorithms suppl...
Definition CGAlgorithms.h:47
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:53
A directed EdgeEnd.
Definition geomgraph/DirectedEdge.h:44
Definition geomgraph/Node.h:62
A connected subset of the graph of DirectedEdge and geomgraph::Node.
Definition BufferSubgraph.h:61
geom::Envelope * getEnvelope()
Computes the envelope of the edges in the subgraph. The envelope is cached after being computed.
void findResultEdges()
Find all edges whose depths indicates that they are in the result area(s).
int compareTo(BufferSubgraph *)
BufferSubgraphs are compared on the x-value of their rightmost Coordinate.
void create(geomgraph::Node *node)
Creates the subgraph consisting of all edges reachable from this node.
geom::Coordinate * getRightmostCoordinate()
Gets the rightmost coordinate in the edges of the subgraph.
Definition BufferSubgraph.h:177
A RightmostEdgeFinder find the geomgraph::DirectedEdge in a list which has the highest coordinate,...
Definition RightmostEdgeFinder.h:47
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Provides classes for computing buffers of geometries.
Definition opBuffer.h:23
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25