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> computeCurve(
109 std::vector<std::unique_ptr<OffsetCurveSection>> computeSections(
112 std::unique_ptr<LineString> offsetSegment(
115 static std::unique_ptr<Polygon> getBufferOriented(
129 void computeCurveSections(
132 std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
146 std::size_t matchSegments(
148 std::size_t rawCurveIndex,
149 SegmentMCIndex& bufferSegIndex,
151 std::vector<double>& rawCurvePos);
153 static double segmentMatchFrac(
156 double matchDistance);
169 void extractSections(
171 std::vector<double>& rawCurveLoc,
172 std::size_t startIndex,
173 std::vector<std::unique_ptr<OffsetCurveSection>>& sections);
175 std::size_t findSectionStart(
176 const std::vector<double>& loc,
179 std::size_t findSectionEnd(
180 const std::vector<double>& loc,
182 std::size_t firstStartIndex);
184 static std::size_t nextIndex(std::size_t i, std::size_t size);
185 static std::size_t prevIndex(std::size_t i, std::size_t size);
191 static constexpr
int MATCH_DISTANCE_FACTOR = 10000;
197 static constexpr
int MIN_QUADRANT_SEGMENTS = 8;
212 , matchDistance(std::abs(dist)/MATCH_DISTANCE_FACTOR)
213 , geomFactory(geom.getFactory())
215 if (!std::isfinite(dist)) {
232 , matchDistance(std::abs(dist)/MATCH_DISTANCE_FACTOR)
233 , geomFactory(geom.getFactory())
235 if (!std::isfinite(dist)) {
245 if (quadSegs < MIN_QUADRANT_SEGMENTS) {
246 quadSegs = MIN_QUADRANT_SEGMENTS;
263 static std::unique_ptr<Geometry> getCurve(
270 static std::unique_ptr<Geometry> getCurve(
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:216
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:70
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:196
Definition: LineString.h:66
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Contains the parameters which describe how a buffer should be constructed.
Definition: BufferParameters.h:56
double getMitreLimit() const
Definition: BufferParameters.h:236
void setMitreLimit(double limit)
Definition: BufferParameters.h:255
JoinStyle getJoinStyle() const
Definition: BufferParameters.h:211
void setJoinStyle(JoinStyle style)
Sets the join style for outside (reflex) corners between line segments.
Definition: BufferParameters.h:226
int getQuadrantSegments() const
Definition: BufferParameters.h:137
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet.
JoinStyle
Join styles.
Definition: BufferParameters.h:74
Definition: OffsetCurve.h:90
OffsetCurve(const Geometry &geom, double dist, BufferParameters &bp)
Definition: OffsetCurve.h:229
std::unique_ptr< Geometry > getCurve()
static std::unique_ptr< CoordinateSequence > rawOffset(const LineString &line, double distance)
void setJoined(bool pIsJoined)
static std::unique_ptr< CoordinateSequence > rawOffsetCurve(const LineString &line, double distance, BufferParameters &bufParams)
static std::unique_ptr< Geometry > getCurveJoined(const Geometry &geom, double dist)
OffsetCurve(const Geometry &geom, double dist)
Definition: OffsetCurve.h:209
Indicates one or more illegal arguments.
Definition: IllegalArgumentException.h:33
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25