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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsclipper.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
%Feature ARM // Some parts are not available in sip bindings on ARM because of qreal double vs. float issues
class QgsClipper
{
%Docstring(signature="appended")
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).
%End
%TypeHeaderCode
#include "qgsclipper.h"
%End
public:
static const double MAX_X;
static const double MIN_X;
static const double MAX_Y;
static const double MIN_Y;
enum Boundary /BaseType=IntEnum/
{
XMax,
XMin,
YMax,
YMin,
ZMax,
ZMin,
};
static void trimFeature( QVector<double> &x,
QVector<double> &y,
bool shapeOpen );
%Docstring
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).
.. note::
not available in Python bindings on android
%End
static void trimPolygon( QPolygonF &pts, const QgsRectangle &clipRect );
%Docstring
Trims the given polygon to a rectangular box, by modifying the given
polygon in place.
:param pts: polygon as 2D coordinates
:param clipRect: clipping rectangle
%End
static QPolygonF clippedLine( const QgsCurve &curve, const QgsRectangle &clipExtent );
%Docstring
Takes a linestring and clips it to clipExtent
:param curve: the linestring
:param clipExtent: clipping bounds
:return: clipped line coordinates
%End
static QPolygonF clippedLine( const QPolygonF &curve, const QgsRectangle &clipExtent );
%Docstring
Takes a 2D ``curve`` and clips it to clipExtent.
:param curve: the linestring
:param clipExtent: clipping bounds
:return: clipped line coordinates
.. versionadded:: 3.16
%End
static bool clipLineSegment( double left, double right, double bottom, double top, double &x0 /In,Out/, double &y0 /In,Out/, double &x1 /In,Out/, double &y1 /In,Out/ );
%Docstring
Clips a line segment to a rectangle.
An implementation of the 'Fast clipping' algorithm (Sobkow et al. 1987,
Computers & Graphics Vol.11, 4, p.459-467).
:param left: x-coordinate of left side of rectangle
:param right: x-coordinate of right side of rectangle
:param bottom: y-coordinate of bottom side of rectangle
:param top: y-coordinate of top side of rectangle
:param x0: x-coordinate of start of line
:param y0: y-coordinate of start of line
:param x1: x-coordinate of end of line
:param y1: y-coordinate of end of line
:return: ``True`` if line was clipped.
.. versionadded:: 3.26
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsclipper.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|