QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
A class to trim lines and polygons to within a rectangular region. More...
#include <qgsclipper.h>
Public Types | |
enum | Boundary { XMax , XMin , YMax , YMin } |
A handy way to refer to the four boundaries. More... | |
Static Public Member Functions | |
static QPolygonF | clippedLine (const QgsCurve &curve, const QgsRectangle &clipExtent) |
Takes a linestring and clips it to clipExtent. More... | |
static QPolygonF | clippedLine (const QPolygonF &curve, const QgsRectangle &clipExtent) |
Takes a curve and clips it to clipExtent. More... | |
static void | trimFeature (QVector< double > &x, QVector< double > &y, bool shapeOpen) |
Trims the given feature to a rectangular box. More... | |
static void | trimPolygon (QPolygonF &pts, const QgsRectangle &clipRect) |
Static Public Attributes | |
static const double | MAX_X = 16000 |
Maximum X-coordinate of the rectangular box used for clipping. More... | |
static const double | MAX_Y = 16000 |
Maximum Y-coordinate of the rectangular box used for clipping. More... | |
static const double | MIN_X = -16000 |
Minimum X-coordinate of the rectangular box used for clipping. More... | |
static const double | MIN_Y = -16000 |
Minimum Y-coordinate of the rectangular box used for clipping. More... | |
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 46 of file qgsclipper.h.
enum QgsClipper::Boundary |
A handy way to refer to the four boundaries.
Enumerator | |
---|---|
XMax | |
XMin | |
YMax | |
YMin |
Definition at line 78 of file qgsclipper.h.
|
static |
Takes a linestring and clips it to clipExtent.
curve | the linestring |
clipExtent | clipping bounds |
Definition at line 41 of file qgsclipper.cpp.
|
static |
Takes a curve and clips it to clipExtent.
Definition at line 46 of file qgsclipper.cpp.
|
inlinestatic |
Trims the given feature to a rectangular box.
Returns the trimmed feature in x and y. The shapeOpen parameter determines whether the function treats the points as a closed shape (polygon), or as an open shape (linestring).
Definition at line 189 of file qgsclipper.h.
|
inlinestatic |
Definition at line 210 of file qgsclipper.h.
|
static |
Maximum X-coordinate of the rectangular box used for clipping.
Definition at line 68 of file qgsclipper.h.
|
static |
Maximum Y-coordinate of the rectangular box used for clipping.
Definition at line 72 of file qgsclipper.h.
|
static |
Minimum X-coordinate of the rectangular box used for clipping.
Definition at line 70 of file qgsclipper.h.
|
static |
Minimum Y-coordinate of the rectangular box used for clipping.
Definition at line 74 of file qgsclipper.h.