39 const double QgsClipper::SMALL_NUM = 1e-12;
50 if ( static_cast<int>( nPoints * ( 2 *
sizeof(
double ) + skipZM ) ) > wkbPtr.
remaining() )
52 QgsDebugMsg(
QString(
"%1 points exceed wkb length (%2>%3)" ).arg( nPoints ).arg( nPoints * ( 2 *
sizeof(
double ) + skipZM ) ).arg( wkbPtr.
remaining() ) );
56 double p0x, p0y, p1x = 0.0, p1y = 0.0;
58 double lastClipX = 0.0, lastClipY = 0.0;
61 wkbPtr -=
sizeof(
unsigned int );
70 for (
int i = 0; i < nPoints; ++i, ++ptr )
89 p0x, p0y, p1x_c, p1y_c ) )
95 connectSeparatedLines( lastClipX, lastClipY, p0x, p0y, clipExtent, line );
97 if ( line.
size() < 1 || newLine )
106 line <<
QPointF( p1x_c, p1y_c );
113 void QgsClipper::connectSeparatedLines(
double x0,
double y0,
double x1,
double y1,
static int coordDimensions(Type type)
Returns the coordinate dimension of the geometry type as an integer.
static const double MAX_Y
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 QgsConstWkbPtr clippedLineWKB(QgsConstWkbPtr &wkb, const QgsRectangle &clipExtent, QPolygonF &line)
Reads a polyline from WKB and clips it to clipExtent.
static const double MIN_X
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
double xMaximum() const
Get the x maximum value (right side of rectangle)
double xMinimum() const
Get the x minimum value (left side of rectangle)
double yMaximum() const
Get the y maximum value (top side of rectangle)
static const double MIN_Y
QgsWKBTypes::Type readHeader() const
static const double MAX_X