GEOS 3.6.2
OffsetCurveSetBuilder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
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/OffsetCurveSetBuilder.java r378 (JTS-1.12)
17 *
18 **********************************************************************/
19
20#ifndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
21#define GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
22
23#include <geos/export.h>
24
25#include <vector>
26
27#ifdef _MSC_VER
28#pragma warning(push)
29#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
30#endif
31
32// Forward declarations
33namespace geos {
34 namespace geom {
35 class Geometry;
38 class Point;
39 class LineString;
40 class LinearRing;
41 class Polygon;
42 }
43 namespace geomgraph {
44 class Label;
45 }
46 namespace noding {
47 class SegmentString;
48 }
49 namespace operation {
50 namespace buffer {
52 }
53 }
54}
55
56namespace geos {
57namespace operation { // geos.operation
58namespace buffer { // geos.operation.buffer
59
70class GEOS_DLL OffsetCurveSetBuilder {
71
72private:
73
74 // To keep track of newly-created Labels.
75 // Labels will be relesed by object dtor
76 std::vector<geomgraph::Label*> newLabels;
77
78 const geom::Geometry& inputGeom;
79
80 double distance;
81
82 OffsetCurveBuilder& curveBuilder;
83
87 std::vector<noding::SegmentString*> curveList;
88
101 void addCurve(geom::CoordinateSequence *coord, int leftLoc,
102 int rightLoc);
103
104 void add(const geom::Geometry& g);
105
106 void addCollection(const geom::GeometryCollection *gc);
107
111 void addPoint(const geom::Point *p);
112
113 void addLineString(const geom::LineString *line);
114
115 void addPolygon(const geom::Polygon *p);
116
135 void addPolygonRing(const geom::CoordinateSequence *coord,
136 double offsetDistance, int side, int cwLeftLoc,
137 int cwRightLoc);
138
148 bool isErodedCompletely(const geom::LinearRing* ringCoord,
149 double bufferDistance);
150
169 bool isTriangleErodedCompletely(const geom::CoordinateSequence *triCoords,
170 double bufferDistance);
171
172 // Declare type as noncopyable
173 OffsetCurveSetBuilder(const OffsetCurveSetBuilder& other);
174 OffsetCurveSetBuilder& operator=(const OffsetCurveSetBuilder& rhs);
175
176public:
177
180 double newDistance, OffsetCurveBuilder& newCurveBuilder);
181
184
194 std::vector<noding::SegmentString*>& getCurves();
195
197 //
201 void addCurves(const std::vector<geom::CoordinateSequence*>& lineList,
202 int leftLoc, int rightLoc);
203
204};
205
206} // namespace geos::operation::buffer
207} // namespace geos::operation
208} // namespace geos
209
210#ifdef _MSC_VER
211#pragma warning(pop)
212#endif
213
214#endif // ndef GEOS_OP_BUFFER_OFFSETCURVESETBUILDER_H
215
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:59
Represents a collection of heterogeneous Geometry objects.
Definition GeometryCollection.h:56
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:167
Definition LineString.h:70
Models an OGC SFS LinearRing.
Definition LinearRing.h:57
Definition Point.h:68
Represents a linear polygon, which may include holes.
Definition Polygon.h:67
A Label indicates the topological relationship of a component of a topology graph to a given Geometry...
Definition Label.h:57
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Computes the raw offset curve for a single Geometry component (ring, line or point).
Definition OffsetCurveBuilder.h:62
void addCurves(const std::vector< geom::CoordinateSequence * > &lineList, int leftLoc, int rightLoc)
Add raw curves for a set of CoordinateSequences.
OffsetCurveSetBuilder(const geom::Geometry &newInputGeom, double newDistance, OffsetCurveBuilder &newCurveBuilder)
Constructor.
std::vector< noding::SegmentString * > & getCurves()
Computes the set of raw offset curves for the buffer.
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 implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25