17 #include <geos/export.h> 19 #include <geos/operation/buffer/BufferParameters.h> 20 #include <geos/geom/GeometryFactory.h> 21 #include <geos/constants.h> 34 class OffsetCurveSection;
98 bool isJoined =
false;
101 double matchDistance;
106 std::unique_ptr<Geometry> computePolygonCurve(
107 const Polygon& polyGeom,
double distance);
109 std::unique_ptr<Geometry> computeCurve(
112 std::vector<std::unique_ptr<OffsetCurveSection>> computeSections(
115 std::unique_ptr<LineString> offsetSegment(
118 static std::unique_ptr<Polygon> getBufferOriented(
132 void computeCurveSections(
135 std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
149 std::size_t matchSegments(
151 std::size_t rawCurveIndex,
152 SegmentMCIndex& bufferSegIndex,
154 std::vector<double>& rawCurvePos);
156 static double segmentMatchFrac(
159 double matchDistance);
172 void extractSections(
174 std::vector<double>& rawCurveLoc,
175 std::size_t startIndex,
176 std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
178 std::size_t findSectionStart(
179 const std::vector<double>& loc,
182 std::size_t findSectionEnd(
183 const std::vector<double>& loc,
185 std::size_t firstStartIndex);
187 static std::size_t nextIndex(std::size_t i, std::size_t size);
188 static std::size_t prevIndex(std::size_t i, std::size_t size);
194 static constexpr
int MATCH_DISTANCE_FACTOR = 10000;
200 static constexpr
int MIN_QUADRANT_SEGMENTS = 8;
215 , matchDistance(
std::abs(dist)/MATCH_DISTANCE_FACTOR)
216 , geomFactory(geom.getFactory())
218 if (!std::isfinite(dist)) {
235 , matchDistance(
std::abs(dist)/MATCH_DISTANCE_FACTOR)
236 , geomFactory(geom.getFactory())
238 if (!std::isfinite(dist)) {
248 if (quadSegs < MIN_QUADRANT_SEGMENTS) {
249 quadSegs = MIN_QUADRANT_SEGMENTS;
264 void setJoined(
bool pIsJoined);
266 static std::unique_ptr<Geometry> getCurve(
273 static std::unique_ptr<Geometry> getCurve(
284 static std::unique_ptr<Geometry> getCurveJoined(
292 std::unique_ptr<Geometry> getCurve();
307 static std::unique_ptr<CoordinateSequence> rawOffsetCurve(
320 static std::unique_ptr<CoordinateSequence> rawOffset(
int getQuadrantSegments() const
Definition: BufferParameters.h:137
JoinStyle getJoinStyle() const
Definition: BufferParameters.h:211
OffsetCurve(const Geometry &geom, double dist)
Definition: OffsetCurve.h:212
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
double getMitreLimit() const
Definition: BufferParameters.h:236
Definition: Coordinate.h:577
Definition: OffsetCurve.h:90
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:197
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
Definition: LineString.h:66
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
void setJoinStyle(JoinStyle style)
Sets the join style for outside (reflex) corners between line segments.
Definition: BufferParameters.h:226
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25
void setMitreLimit(double limit)
Definition: BufferParameters.h:255
Contains the parameters which describe how a buffer should be constructed.
Definition: BufferParameters.h:56
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
OffsetCurve(const Geometry &geom, double dist, BufferParameters &bp)
Definition: OffsetCurve.h:232
JoinStyle
Join styles.
Definition: BufferParameters.h:74