39 const double QgsClipper::SMALL_NUM = 1e-12;
45 double p0x, p0y, p1x = 0.0, p1y = 0.0;
47 double lastClipX = 0.0, lastClipY = 0.0;
50 line.reserve( nPoints + 1 );
52 for (
int i = 0; i < nPoints; ++i )
71 p0x, p0y, p1x_c, p1y_c ) )
77 connectSeparatedLines( lastClipX, lastClipY, p0x, p0y, clipExtent, line );
79 if ( line.empty() || newLine )
82 line << QPointF( p0x, p0y );
88 line << QPointF( p1x_c, p1y_c );
95 void QgsClipper::connectSeparatedLines(
double x0,
double y0,
double x1,
double y1,
static const double MAX_Y
Maximum Y-coordinate of the rectangular box used for clipping.
A rectangle specified with double values.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
static const double MIN_X
Minimum X-coordinate of the rectangular box used for clipping.
virtual double xAt(int index) const =0
Returns the x-coordinate of the specified node in the line string.
Abstract base class for curved geometry type.
static QPolygonF clippedLine(const QgsCurve &curve, const QgsRectangle &clipExtent)
Takes a linestring and clips it to clipExtent.
double yMinimum() const
Returns the y minimum value (bottom side of rectangle).
double xMaximum() const
Returns the x maximum value (right side of rectangle).
virtual double yAt(int index) const =0
Returns the y-coordinate of the specified node in the line string.
double xMinimum() const
Returns the x minimum value (left side of rectangle).
double yMaximum() const
Returns the y maximum value (top side of rectangle).
static const double MIN_Y
Minimum Y-coordinate of the rectangular box used for clipping.
static const double MAX_X
Maximum X-coordinate of the rectangular box used for clipping.
virtual int numPoints() const =0
Returns the number of points in the curve.