BufferParameters.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2009 Sandro Santilli <strk@kbt.io>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: operation/buffer/BufferParameters.java r378 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
//#include <vector>
//#include <geos/algorithm/LineIntersector.h> // for composition
//#include <geos/geom/Coordinate.h> // for composition
//#include <geos/geom/LineSegment.h> // for composition
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
#endif
// Forward declarations
namespace geos {
namespace geom {
class CoordinateSequence;
class PrecisionModel;
}
namespace operation {
namespace buffer {
class OffsetCurveVertexList;
}
}
}
namespace geos {
namespace operation { // geos.operation
namespace buffer { // geos.operation.buffer
class GEOS_DLL BufferParameters {
public:
enum EndCapStyle {
CAP_ROUND = 1,
CAP_FLAT = 2,
CAP_SQUARE = 3
};
enum JoinStyle {
JOIN_ROUND = 1,
JOIN_MITRE = 2,
JOIN_BEVEL = 3
};
static const int DEFAULT_QUADRANT_SEGMENTS = 8;
static const double DEFAULT_MITRE_LIMIT; // 5.0 (in .cpp file)
BufferParameters();
BufferParameters(int quadrantSegments);
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle);
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle,
JoinStyle joinStyle, double mitreLimit);
int
getQuadrantSegments() const
{
return quadrantSegments;
}
void setQuadrantSegments(int quadSegs);
static double bufferDistanceError(int quadSegs);
EndCapStyle
getEndCapStyle() const
{
return endCapStyle;
}
void
setEndCapStyle(EndCapStyle style)
{
endCapStyle = style;
}
JoinStyle
getJoinStyle() const
{
return joinStyle;
}
void
setJoinStyle(JoinStyle style)
{
joinStyle = style;
}
double
getMitreLimit() const
{
return mitreLimit;
}
void
setMitreLimit(double limit)
{
mitreLimit = limit;
}
void
setSingleSided(bool p_isSingleSided)
{
_isSingleSided = p_isSingleSided;
}
bool
isSingleSided() const
{
return _isSingleSided;
}
private:
int quadrantSegments;
EndCapStyle endCapStyle;
JoinStyle joinStyle;
double mitreLimit;
bool _isSingleSided;
};
} // namespace geos::operation::buffer
} // namespace geos::operation
} // namespace geos
#ifdef _MSC_VER
#pragma warning(pop)
#endif
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
geos::operation::buffer::BufferParameters::getMitreLimit
double getMitreLimit() const
Definition BufferParameters.h:224
geos::operation::buffer::BufferParameters::setEndCapStyle
void setEndCapStyle(EndCapStyle style)
Definition BufferParameters.h:189
geos::operation::buffer::BufferParameters::setMitreLimit
void setMitreLimit(double limit)
Definition BufferParameters.h:243
geos::operation::buffer::BufferParameters::getJoinStyle
JoinStyle getJoinStyle() const
Definition BufferParameters.h:199
geos::operation::buffer::BufferParameters::BufferParameters
BufferParameters(int quadrantSegments)
geos::operation::buffer::BufferParameters::getEndCapStyle
EndCapStyle getEndCapStyle() const
Definition BufferParameters.h:174
geos::operation::buffer::BufferParameters::EndCapStyle
EndCapStyle
End cap styles.
Definition BufferParameters.h:61
geos::operation::buffer::BufferParameters::CAP_SQUARE
@ CAP_SQUARE
Specifies a square line buffer end cap style.
Definition BufferParameters.h:70
geos::operation::buffer::BufferParameters::CAP_ROUND
@ CAP_ROUND
Specifies a round line buffer end cap style.
Definition BufferParameters.h:64
geos::operation::buffer::BufferParameters::CAP_FLAT
@ CAP_FLAT
Specifies a flat line buffer end cap style.
Definition BufferParameters.h:67
geos::operation::buffer::BufferParameters::DEFAULT_MITRE_LIMIT
static const double DEFAULT_MITRE_LIMIT
Definition BufferParameters.h:100
geos::operation::buffer::BufferParameters::BufferParameters
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle, JoinStyle joinStyle, double mitreLimit)
Creates a set of parameters with the given parameter values.
geos::operation::buffer::BufferParameters::setJoinStyle
void setJoinStyle(JoinStyle style)
Sets the join style for outside (reflex) corners between line segments.
Definition BufferParameters.h:214
geos::operation::buffer::BufferParameters::bufferDistanceError
static double bufferDistanceError(int quadSegs)
Computes the maximum distance error due to a given level of approximation to a true arc.
geos::operation::buffer::BufferParameters::DEFAULT_QUADRANT_SEGMENTS
static const int DEFAULT_QUADRANT_SEGMENTS
The default number of facets into which to divide a fillet of 90 degrees.
Definition BufferParameters.h:94
geos::operation::buffer::BufferParameters::isSingleSided
bool isSingleSided() const
Definition BufferParameters.h:277
geos::operation::buffer::BufferParameters::BufferParameters
BufferParameters()
Creates a default set of parameters.
geos::operation::buffer::BufferParameters::BufferParameters
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle)
Creates a set of parameters with the given quadrantSegments and endCapStyle values.
geos::operation::buffer::BufferParameters::getQuadrantSegments
int getQuadrantSegments() const
Definition BufferParameters.h:137
geos::operation::buffer::BufferParameters::setQuadrantSegments
void setQuadrantSegments(int quadSegs)
Sets the number of line segments used to approximate an angle fillet in round joins.
geos::operation::buffer::BufferParameters::setSingleSided
void setSingleSided(bool p_isSingleSided)
Definition BufferParameters.h:266
geos::operation::buffer::BufferParameters::JoinStyle
JoinStyle
Join styles.
Definition BufferParameters.h:74
geos::operation::buffer::BufferParameters::JOIN_MITRE
@ JOIN_MITRE
Specifies a mitre join style.
Definition BufferParameters.h:80
geos::operation::buffer::BufferParameters::JOIN_ROUND
@ JOIN_ROUND
Specifies a round join style.
Definition BufferParameters.h:77
geos::operation::buffer::BufferParameters::JOIN_BEVEL
@ JOIN_BEVEL
Specifies a bevel join style.
Definition BufferParameters.h:83
geos::geom
Definition Angle.h:26
geos::operation::buffer
Provides classes for computing buffers of geometries.
Definition namespaces.h:182
geos::operation
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38