/usr/include/geos/operation/buffer/BufferParameters.h is in libgeos-dev 3.2.2-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | /**********************************************************************
* $Id: BufferParameters.h 2809 2009-12-06 01:05:24Z mloskot $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2009 Sandro Santilli <strk@keybit.net>
*
* 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 rev 1.5 (JTS-1.10)
*
**********************************************************************/
#ifndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
#define GEOS_OP_BUFFER_BUFFERPARAMETERS_H
//#include <vector>
//#include <geos/algorithm/LineIntersector.h> // for composition
//#include <geos/geom/Coordinate.h> // for composition
//#include <geos/geom/LineSegment.h> // for composition
// 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
/** \brief
* Contains the parameters which
* describe how a buffer should be constructed.
*
*/
class BufferParameters
{
public:
/// End cap styles
enum EndCapStyle {
/// Specifies a round line buffer end cap style.
CAP_ROUND=1,
/// Specifies a flat line buffer end cap style.
CAP_FLAT=2,
/// Specifies a square line buffer end cap style.
CAP_SQUARE=3
};
/// Join styles
enum JoinStyle {
/// Specifies a round join style.
JOIN_ROUND=1,
/// Specifies a mitre join style.
JOIN_MITRE=2,
/// Specifies a bevel join style.
JOIN_BEVEL=3
};
/// \brief
/// The default number of facets into which to divide a fillet
/// of 90 degrees.
//
/// A value of 8 gives less than 2% max error in the buffer distance.
/// For a max error of < 1%, use QS = 12.
/// For a max error of < 0.1%, use QS = 18.
///
static const int DEFAULT_QUADRANT_SEGMENTS = 8;
/// The default mitre limit
//
/// Allows fairly pointy mitres.
///
static const double DEFAULT_MITRE_LIMIT; // 5.0 (in .cpp file)
/// Creates a default set of parameters
BufferParameters()
:
quadrantSegments(DEFAULT_QUADRANT_SEGMENTS),
endCapStyle(CAP_ROUND),
joinStyle(JOIN_ROUND),
mitreLimit(DEFAULT_MITRE_LIMIT)
{}
/// Creates a set of parameters with the given quadrantSegments value.
//
/// @param quadrantSegments the number of quadrant segments to use
///
BufferParameters(int quadrantSegments);
/// \brief
/// Creates a set of parameters with the
/// given quadrantSegments and endCapStyle values.
//
/// @param quadrantSegments the number of quadrant segments to use
/// @param endCapStyle the end cap style to use
///
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle);
/// \brief
/// Creates a set of parameters with the
/// given parameter values.
//
/// @param quadrantSegments the number of quadrant segments to use
/// @param endCapStyle the end cap style to use
/// @param joinStyle the join style to use
/// @param mitreLimit the mitre limit to use
///
BufferParameters(int quadrantSegments, EndCapStyle endCapStyle,
JoinStyle joinStyle, double mitreLimit);
/// Gets the number of quadrant segments which will be used
//
/// @return the number of quadrant segments
///
int getQuadrantSegments() const { return quadrantSegments; }
/// \brief
/// Sets the number of line segments used to approximate
/// an angle fillet.
//
/// - If <tt>quadSegs</tt> >= 1, joins are round,
/// and <tt>quadSegs</tt> indicates the number of
/// segments to use to approximate a quarter-circle.
/// - If <tt>quadSegs</tt> = 0, joins are bevelled (flat)
/// - If <tt>quadSegs</tt> < 0, joins are mitred, and the value of qs
/// indicates the mitre ration limit as
/// <pre>
/// mitreLimit = |<tt>quadSegs</tt>|
/// </pre>
///
/// For round joins, <tt>quadSegs</tt> determines the maximum
/// error in the approximation to the true buffer curve.
///
/// The default value of 8 gives less than 2% max error in the
/// buffer distance.
///
/// For a max error of < 1%, use QS = 12.
/// For a max error of < 0.1%, use QS = 18.
/// The error is always less than the buffer distance
/// (in other words, the computed buffer curve is always inside
/// the true curve).
///
/// @param quadrantSegments the number of segments in a
/// fillet for a quadrant
////
void setQuadrantSegments(int quadSegs);
/// \brief
/// Computes the maximum distance error due to a given level
/// of approximation to a true arc.
//
/// @param quadSegs the number of segments used to approximate
/// a quarter-circle
/// @return the error of approximation
///
static double bufferDistanceError(int quadSegs);
/// Gets the end cap style.
//
/// @return the end cap style
///
EndCapStyle getEndCapStyle() const { return endCapStyle; }
/// Specifies the end cap style of the generated buffer.
//
/// The styles supported are CAP_ROUND, CAP_BUTT,
/// and CAP_SQUARE.
///
/// The default is CAP_ROUND.
///
/// @param style the end cap style to specify
///
void setEndCapStyle(EndCapStyle style)
{
endCapStyle = style;
}
/// Gets the join style.
//
/// @return the join style
///
JoinStyle getJoinStyle() const { return joinStyle; }
/// \brief
/// Sets the join style for outside (reflex) corners between
/// line segments.
//
/// Allowable values are JOIN_ROUND (which is the default),
/// JOIN_MITRE and JOIN_BEVEL.
//
/// @param style the code for the join style
///
void setJoinStyle(JoinStyle style)
{
joinStyle = style;
}
/// Gets the mitre ratio limit.
//
/// @return the limit value
///
double getMitreLimit() const { return mitreLimit; }
/// Sets the limit on the mitre ratio used for very sharp corners.
//
/// The mitre ratio is the ratio of the distance from the corner
/// to the end of the mitred offset corner.
/// When two line segments meet at a sharp angle,
/// a miter join will extend far beyond the original geometry.
/// (and in the extreme case will be infinitely far.)
/// To prevent unreasonable geometry, the mitre limit
/// allows controlling the maximum length of the join corner.
/// Corners with a ratio which exceed the limit will be beveled.
///
/// @param limit the mitre ratio limit
///
void setMitreLimit(double limit)
{
mitreLimit = limit;
}
private:
/// Defaults to DEFAULT_QUADRANT_SEGMENTS;
int quadrantSegments;
/// Defaults to CAP_ROUND;
EndCapStyle endCapStyle;
// Defaults to JOIN_ROUND;
JoinStyle joinStyle;
// Defaults to DEFAULT_MITRE_LIMIT;
double mitreLimit;
};
} // namespace geos::operation::buffer
} // namespace geos::operation
} // namespace geos
#endif // ndef GEOS_OP_BUFFER_BUFFERPARAMETERS_H
|