26#include <geos/export.h>
27#include <geos/operation/buffer/BufferParameters.h>
28#include <geos/geom/Geometry.h>
30#include <geos/util/TopologyException.h>
34#pragma warning(disable: 4251)
92 static constexpr int MAX_PRECISION_DIGITS = 12;
102 std::unique_ptr<geom::Geometry> resultGeometry;
104 bool isInvertOrientation =
false;
123 double distance,
int maxPrecisionDigits);
126 void computeGeometry();
128 void bufferOriginalPrecision();
130 void bufferReducedPrecision(
int precisionDigits);
132 void bufferReducedPrecision();
136 static void extractPolygons(
138 std::vector<std::unique_ptr<geom::Geometry>>& polys);
145 CAP_ROUND = BufferParameters::CAP_ROUND,
149 CAP_BUTT = BufferParameters::CAP_FLAT,
153 CAP_SQUARE = BufferParameters::CAP_SQUARE
171 int quadrantSegments = BufferParameters::DEFAULT_QUADRANT_SEGMENTS,
172 int endCapStyle = BufferParameters::CAP_ROUND);
174 static std::unique_ptr<geom::Geometry> bufferOp(
188 resultGeometry(nullptr),
189 isInvertOrientation(false)
205 resultGeometry(nullptr),
206 isInvertOrientation(false)
218 inline void setEndCapStyle(
int nEndCapStyle);
225 inline void setQuadrantSegments(
int nQuadrantSegments);
247 inline void setSingleSided(
bool isSingleSided);
277 bool isBothOrientations);
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:88
Computes the buffer of a geometry, for both positive and negative buffer distances.
Definition BufferOp.h:81
void setQuadrantSegments(int nQuadrantSegments)
Sets the number of segments used to approximate a angle fillet.
Definition BufferOp.h:283
std::unique_ptr< geom::Geometry > getResultGeometry(double nDistance)
Returns the buffer computed for a geometry for a given buffer distance.
void setEndCapStyle(int nEndCapStyle)
Specifies the end cap style of the generated buffer.
Definition BufferOp.h:289
static std::unique_ptr< geom::Geometry > bufferOp(const geom::Geometry *g, double distance, int quadrantSegments=BufferParameters::DEFAULT_QUADRANT_SEGMENTS, int endCapStyle=BufferParameters::CAP_ROUND)
Computes the buffer for a geometry for a given buffer distance and accuracy of approximation.
void setSingleSided(bool isSingleSided)
Sets whether the computed buffer should be single-sided.
Definition BufferOp.h:295
BufferOp(const geom::Geometry *g, const BufferParameters ¶ms)
Initializes a buffer computation for the given geometry with the given set of parameters.
Definition BufferOp.h:201
BufferOp(const geom::Geometry *g)
Initializes a buffer computation for the given geometry.
Definition BufferOp.h:184
static std::unique_ptr< geom::Geometry > bufferByZero(const geom::Geometry *geom, bool isBothOrientations)
Contains the parameters which describe how a buffer should be constructed.
Definition BufferParameters.h:56
void setEndCapStyle(EndCapStyle style)
Definition BufferParameters.h:189
EndCapStyle
End cap styles.
Definition BufferParameters.h:61
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet in round joins.
void setSingleSided(bool p_isSingleSided)
Definition BufferParameters.h:266
Indicates an invalid or inconsistent topological situation encountered during processing.
Definition TopologyException.h:34
Basic namespace for all GEOS functionalities.
Definition geos.h:39