GEOS 3.6.2
BufferBuilder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2009-2011 Sandro Santilli <strk@keybit.net>
7 * Copyright (C) 2008-2010 Safe Software Inc.
8 * Copyright (C) 2006-2007 Refractions Research 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: operation/buffer/BufferBuilder.java r378 (JTS-1.12)
18 *
19 **********************************************************************/
20
21#ifndef GEOS_OP_BUFFER_BUFFERBUILDER_H
22#define GEOS_OP_BUFFER_BUFFERBUILDER_H
23
24#include <geos/export.h>
25
26#include <vector>
27
28#include <geos/operation/buffer/BufferOp.h> // for inlines (BufferOp enums)
29#include <geos/operation/buffer/OffsetCurveBuilder.h> // for inline (OffsetCurveBuilder enums)
30#include <geos/geomgraph/EdgeList.h> // for composition
31
32#ifdef _MSC_VER
33#pragma warning(push)
34#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
35#endif
36
37// Forward declarations
38namespace geos {
39 namespace geom {
40 class PrecisionModel;
41 class Geometry;
42 class GeometryFactory;
43 }
44 namespace algorithm {
45 class CGAlgorithms;
46 class LineIntersector;
47 }
48 namespace noding {
49 class Noder;
50 class SegmentString;
52 }
53 namespace geomgraph {
54 class Edge;
55 class Label;
56 class PlanarGraph;
57 }
58 namespace operation {
59 namespace buffer {
60 class BufferSubgraph;
61 }
62 namespace overlay {
63 class PolygonBuilder;
64 }
65 }
66}
67
68namespace geos {
69namespace operation { // geos.operation
70namespace buffer { // geos.operation.buffer
71
89class GEOS_DLL BufferBuilder {
90
91public:
102 :
103 bufParams(nBufParams),
104 workingPrecisionModel(NULL),
105 li(NULL),
106 intersectionAdder(NULL),
107 workingNoder(NULL),
108 geomFact(NULL),
109 edgeList()
110 {}
111
113
114
126 workingPrecisionModel=pm;
127 }
128
136 void setNoder(noding::Noder* newNoder) { workingNoder = newNoder; }
137
138 geom::Geometry* buffer(const geom::Geometry *g, double distance);
139 // throw (GEOSException);
140
160 double distance, bool leftSide ) ;
161 // throw (GEOSException);
162
163private:
164
168 static int depthDelta(const geomgraph::Label& label);
169
170 const BufferParameters& bufParams;
171
172 const geom::PrecisionModel* workingPrecisionModel;
173
175
176 noding::IntersectionAdder* intersectionAdder;
177
178 noding::Noder* workingNoder;
179
180 const geom::GeometryFactory* geomFact;
181
182 geomgraph::EdgeList edgeList;
183
184 std::vector<geomgraph::Label *> newLabels;
185
186 void computeNodedEdges(std::vector<noding::SegmentString*>& bufSegStr,
187 const geom::PrecisionModel *precisionModel);
188 // throw(GEOSException);
189
199 void insertUniqueEdge(geomgraph::Edge *e);
200
201 void createSubgraphs(geomgraph::PlanarGraph *graph,
202 std::vector<BufferSubgraph*>& list);
203
214 void buildSubgraphs(const std::vector<BufferSubgraph*>& subgraphList,
215 overlay::PolygonBuilder& polyBuilder);
216
220 //
225 noding::Noder* getNoder(const geom::PrecisionModel* precisionModel);
226
227
235 geom::Geometry* createEmptyResultGeometry() const;
236
237 // Declare type as noncopyable
238 BufferBuilder(const BufferBuilder& other);
239 BufferBuilder& operator=(const BufferBuilder& rhs);
240};
241
242} // namespace geos::operation::buffer
243} // namespace geos::operation
244} // namespace geos
245
246#ifdef _MSC_VER
247#pragma warning(pop)
248#endif
249
250#endif // ndef GEOS_OP_BUFFER_BUFFERBUILDER_H
Specifies and implements various fundamental Computational Geometric algorithms. The algorithms suppl...
Definition CGAlgorithms.h:47
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:49
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:67
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
Definition EdgeList.h:58
Definition geomgraph/Edge.h:66
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition Label.h:57
Represents a directed graph which is embeddable in a planar surface.
Definition geomgraph/PlanarGraph.h:75
Definition IntersectionAdder.h:58
Computes all intersections between segments in a set of SegmentString.
Definition Noder.h:49
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Builds the buffer geometry for a given input geometry and precision model.
Definition BufferBuilder.h:89
BufferBuilder(const BufferParameters &nBufParams)
Definition BufferBuilder.h:101
void setNoder(noding::Noder *newNoder)
Definition BufferBuilder.h:136
void setWorkingPrecisionModel(const geom::PrecisionModel *pm)
Definition BufferBuilder.h:125
geom::Geometry * bufferLineSingleSided(const geom::Geometry *g, double distance, bool leftSide)
Contains the parameters which describe how a buffer should be constructed.
Definition BufferParameters.h:58
A connected subset of the graph of DirectedEdge and geomgraph::Node.
Definition BufferSubgraph.h:61
Forms Polygon out of a graph of geomgraph::DirectedEdge.
Definition PolygonBuilder.h:61
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
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition PreparedLineString.h:27
Provides classes for computing buffers of geometries.
Definition opBuffer.h:23
Provides classes for computing the distance between geometries.
Definition opDistance.h:23
Contains classes that perform a topological overlay to compute boolean spatial functions.
Definition BufferBuilder.h:62
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25