|
1 |
| -%Feature ARM |
| 1 | +/************************************************************************ |
| 2 | + * This file has been generated automatically from * |
| 3 | + * * |
| 4 | + * src/core/qgsclipper.h * |
| 5 | + * * |
| 6 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 7 | + ************************************************************************/ |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +%Feature ARM // Some parts are not available in sip bindings on ARM because of qreal double vs. float issues |
2 | 15 |
|
3 | 16 | class QgsClipper
|
4 | 17 | {
|
5 |
| -%TypeHeaderCode |
6 |
| -#include <qgsclipper.h> |
| 18 | +%Docstring |
| 19 | + A class to trim lines and polygons to within a rectangular region. |
| 20 | + The functions in this class are likely to be called from within a |
| 21 | + render loop and hence need to as CPU efficient as possible. |
| 22 | + The main purpose of the functions in this class are to trim lines |
| 23 | + and polygons to lie within a rectangular region. This is necessary |
| 24 | + for drawing items to an X11 display which have a limit on the |
| 25 | + magnitude of the screen coordinates (+/- 32768, i.e. 16 bit integer). |
7 | 26 | %End
|
8 | 27 |
|
| 28 | +%TypeHeaderCode |
| 29 | +#include "qgsclipper.h" |
| 30 | +%End |
9 | 31 | public:
|
10 | 32 |
|
11 |
| - // Coordinates of the rectangular box that we trim to. |
12 |
| - // |
13 |
| - // These are the limits for X11 screen coordinates. The actual |
14 |
| - // values are +/-32767, but we allow a little bit of space for |
15 |
| - // rounding errors. |
16 |
| - |
17 |
| - // You may wonder why the clipping is done to these coordindates |
18 |
| - // rather than the boundaries of the qgis canvas. Reasons include: |
19 |
| - // - making the boundaries static const allows the compiler to |
20 |
| - // optimise the code that uses these values more than if they changed |
21 |
| - // for every call to the trim code. |
22 |
| - // - clipping takes quite a bit of CPU effort, and the less that this is |
23 |
| - // done the better. More stuff would have to be clipped if the |
24 |
| - // boundaries were the qgis canvas (but this may be offset by |
25 |
| - // having less to draw). |
26 |
| - // |
27 |
| - // The limit is set to 30,000 instead of 32768 because that things |
28 |
| - // still go wrong. |
| 33 | + |
29 | 34 |
|
30 | 35 | static const double MAX_X;
|
31 | 36 | static const double MIN_X;
|
32 | 37 | static const double MAX_Y;
|
33 | 38 | static const double MIN_Y;
|
34 | 39 |
|
35 | 40 |
|
36 |
| - //! A handy way to refer to the four boundaries |
37 |
| - enum Boundary {XMax, XMin, YMax, YMin}; |
38 |
| - |
39 |
| -%If (!ARM) |
40 |
| - /** |
41 |
| - * Trims the given feature to a rectangular box. Returns the trimmed |
42 |
| - * feature in x and y. The shapeOpen parameter determines whether |
43 |
| - * the function treats the points as a closed shape (polygon), or as |
44 |
| - * an open shape (linestring). |
45 |
| - * |
46 |
| - * @note not available in python bindings on android |
47 |
| - */ |
48 |
| - static void trimFeature( QVector<double>& x, |
49 |
| - QVector<double>& y, |
| 41 | + enum Boundary |
| 42 | + { |
| 43 | + XMax, |
| 44 | + XMin, |
| 45 | + YMax, |
| 46 | + YMin |
| 47 | + }; |
| 48 | + |
| 49 | +%If (!ARM) // Not available on ARM sip bindings because of qreal issues |
| 50 | + static void trimFeature( QVector<double> &x, |
| 51 | + QVector<double> &y, |
50 | 52 | bool shapeOpen );
|
| 53 | +%Docstring |
| 54 | + Trims the given feature to a rectangular box. Returns the trimmed |
| 55 | + feature in x and y. The shapeOpen parameter determines whether |
| 56 | + the function treats the points as a closed shape (polygon), or as |
| 57 | + an open shape (linestring). |
| 58 | + |
| 59 | +.. note:: |
| 60 | + |
| 61 | + not available in python bindings on android |
51 | 62 | %End
|
52 | 63 |
|
53 |
| - static void trimPolygon( QPolygonF& pts, const QgsRectangle& clipRect ); |
| 64 | +%End |
| 65 | + static void trimPolygon( QPolygonF &pts, const QgsRectangle &clipRect ); |
54 | 66 |
|
55 |
| - /** Takes a linestring and clips it to clipExtent |
56 |
| - * @param curve the linestring |
57 |
| - * @param clipExtent clipping bounds |
58 |
| - * @return clipped line coordinates |
59 |
| - */ |
60 |
| - static QPolygonF clippedLine( const QgsCurve& curve, const QgsRectangle& clipExtent ); |
| 67 | + static QPolygonF clippedLine( const QgsCurve &curve, const QgsRectangle &clipExtent ); |
| 68 | +%Docstring |
| 69 | + Takes a linestring and clips it to clipExtent |
| 70 | + @param curve the linestring |
| 71 | + @param clipExtent clipping bounds |
| 72 | + @return clipped line coordinates |
| 73 | +%End |
61 | 74 |
|
62 | 75 | };
|
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +/************************************************************************ |
| 80 | + * This file has been generated automatically from * |
| 81 | + * * |
| 82 | + * src/core/qgsclipper.h * |
| 83 | + * * |
| 84 | + * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
| 85 | + ************************************************************************/ |
0 commit comments