QGIS API Documentation
2.0.1-Dufour
|
A class to trim lines and polygons to within a rectangular region. More...
#include <qgsclipper.h>
Public Types | |
enum | Boundary { XMax, XMin, YMax, YMin } |
Static Public Member Functions | |
static void | trimFeature (QVector< double > &x, QVector< double > &y, bool shapeOpen) |
static void | trimPolygon (QPolygonF &pts, const QgsRectangle &clipRect) |
static const unsigned char * | clippedLineWKB (const unsigned char *wkb, const QgsRectangle &clipExtent, QPolygonF &line) |
Reads a polyline from WKB and clips it to clipExtent. |
Static Public Attributes | |
static const double | MAX_X = 16000 |
static const double | MIN_X = -16000 |
static const double | MAX_Y = 16000 |
static const double | MIN_Y = -16000 |
Static Private Member Functions | |
static void | trimFeatureToBoundary (const QVector< double > &inX, const QVector< double > &inY, QVector< double > &outX, QVector< double > &outY, Boundary b, bool shapeOpen) |
static void | trimPolygonToBoundary (const QPolygonF &inPts, QPolygonF &outPts, const QgsRectangle &rect, Boundary b, double boundaryValue) |
static bool | inside (const double x, const double y, Boundary b) |
static bool | inside (const QPointF &pt, Boundary b, double val) |
static QgsPoint | intersect (const double x1, const double y1, const double x2, const double y2, Boundary b) |
static QPointF | intersectRect (const QPointF &pt1, const QPointF &pt2, Boundary b, const QgsRectangle &rect) |
static bool | clipLineSegment (double xLeft, double xRight, double yBottom, double yTop, double &x0, double &y0, double &x1, double &y1) |
static void | connectSeparatedLines (double x0, double y0, double x1, double y1, const QgsRectangle &clipRect, QPolygonF &pts) |
Connects two lines split by the clip (by inserting points on the clip border) | |
static void | clipStartTop (double &x0, double &y0, const double &x1, const double &y1, double yMax) |
static void | clipStartBottom (double &x0, double &y0, const double &x1, const double &y1, double yMin) |
static void | clipStartRight (double &x0, double &y0, const double &x1, const double &y1, double xMax) |
static void | clipStartLeft (double &x0, double &y0, const double &x1, const double &y1, double xMin) |
static void | clipEndTop (const double &x0, const double &y0, double &x1, double &y1, double yMax) |
static void | clipEndBottom (const double &x0, const double &y0, double &x1, double &y1, double yMin) |
static void | clipEndRight (const double &x0, const double &y0, double &x1, double &y1, double xMax) |
static void | clipEndLeft (const double &x0, const double &y0, double &x1, double &y1, double xMin) |
Static Private Attributes | |
static const double | SMALL_NUM = 1e-12 |
A class to trim lines and polygons to within a rectangular region.
The functions in this class are likely to be called from within a render loop and hence need to as CPU efficient as possible. The main purpose of the functions in this class are to trim lines and polygons to lie within a rectangular region. This is necessary for drawing items to an X11 display which have a limit on the magnitude of the screen coordinates (+/- 32768, i.e. 16 bit integer).
Definition at line 39 of file qgsclipper.h.
enum QgsClipper::Boundary |
Definition at line 69 of file qgsclipper.h.
|
inlinestaticprivate |
Definition at line 459 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 471 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 465 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 453 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 478 of file qgsclipper.h.
References clipEndBottom(), clipEndLeft(), clipEndRight(), clipEndTop(), clipStartBottom(), clipStartLeft(), clipStartRight(), and clipStartTop().
Referenced by clippedLineWKB().
|
static |
Reads a polyline from WKB and clips it to clipExtent.
wkb | pointer to the start of the line wkb |
clipExtent | clipping bounds |
line | out: clipped line coordinates |
Definition at line 38 of file qgsclipper.cpp.
References clipLineSegment(), connectSeparatedLines(), QGis::WKBLineString25D, QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsFeatureRendererV2::_getLineString().
|
inlinestaticprivate |
Definition at line 435 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 447 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 441 of file qgsclipper.h.
Referenced by clipLineSegment().
|
inlinestaticprivate |
Definition at line 429 of file qgsclipper.h.
Referenced by clipLineSegment().
|
staticprivate |
Connects two lines split by the clip (by inserting points on the clip border)
x0 | x-coordinate of the first line end |
y0 | y-coordinate of the first line end |
x1 | x-coordinate of the second line start |
y1 | y-coordinate of the second line start |
clipRect | clip rectangle |
pts,: | in/out array of clipped points |
Definition at line 108 of file qgsclipper.cpp.
References qgsDoubleNear(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by clippedLineWKB().
|
inlinestaticprivate |
Definition at line 297 of file qgsclipper.h.
References MAX_X, MAX_Y, MIN_X, MIN_Y, XMax, XMin, YMax, and YMin.
Referenced by trimFeatureToBoundary(), and trimPolygonToBoundary().
|
inlinestaticprivate |
|
inlinestaticprivate |
Definition at line 342 of file qgsclipper.h.
References MAX_X, MAX_Y, MIN_X, MIN_Y, QgsPoint::set(), SMALL_NUM, XMax, XMin, YMax, and YMin.
Referenced by trimFeatureToBoundary().
|
inlinestaticprivate |
Definition at line 389 of file qgsclipper.h.
References qgsDoubleNear(), SMALL_NUM, XMax, QgsRectangle::xMaximum(), XMin, QgsRectangle::xMinimum(), YMax, QgsRectangle::yMaximum(), YMin, and QgsRectangle::yMinimum().
Referenced by trimPolygonToBoundary().
|
inlinestatic |
Definition at line 155 of file qgsclipper.h.
References trimFeatureToBoundary(), XMax, XMin, YMax, and YMin.
|
inlinestaticprivate |
Definition at line 195 of file qgsclipper.h.
References inside(), intersect(), QgsPoint::x(), and QgsPoint::y().
Referenced by trimFeature().
|
inlinestatic |
Definition at line 176 of file qgsclipper.h.
References trimPolygonToBoundary(), XMax, QgsRectangle::xMaximum(), XMin, QgsRectangle::xMinimum(), YMax, QgsRectangle::yMaximum(), YMin, and QgsRectangle::yMinimum().
Referenced by QgsFeatureRendererV2::_getPolygon().
|
inlinestaticprivate |
Definition at line 261 of file qgsclipper.h.
References inside(), and intersectRect().
Referenced by trimPolygon().
|
static |
Definition at line 62 of file qgsclipper.h.
Referenced by inside(), and intersect().
|
static |
Definition at line 64 of file qgsclipper.h.
Referenced by inside(), and intersect().
|
static |
Definition at line 63 of file qgsclipper.h.
Referenced by inside(), and intersect().
|
static |
Definition at line 65 of file qgsclipper.h.
Referenced by inside(), and intersect().
|
staticprivate |
Definition at line 90 of file qgsclipper.h.
Referenced by intersect(), and intersectRect().