|
1 |
| -/************************************************************************ |
2 |
| - * This file has been generated automatically from * |
3 |
| - * * |
4 |
| - * src/core/geometry/qgsrectangle.h * |
5 |
| - * * |
6 |
| - * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
7 |
| - ************************************************************************/ |
8 |
| - |
9 |
| - |
10 |
| - |
11 |
| - |
12 |
| - |
13 |
| - |
14 |
| -class QgsRectangle |
15 |
| -{ |
16 |
| -%Docstring |
17 |
| - A rectangle specified with double values. |
18 |
| - |
19 |
| - QgsRectangle is used to store a rectangle when double values are required. |
20 |
| - Examples are storing a layer extent or the current view extent of a map |
21 |
| -.. seealso:: QgsBox3d |
22 |
| -%End |
23 |
| - |
24 |
| -%TypeHeaderCode |
25 |
| -#include "qgsrectangle.h" |
26 |
| -%End |
27 |
| - public: |
28 |
| - QgsRectangle( double xMin = 0, double yMin = 0, double xMax = 0, double yMax = 0 ); |
29 |
| -%Docstring |
30 |
| -Constructor |
31 |
| -%End |
32 |
| - QgsRectangle( const QgsPointXY &p1, const QgsPointXY &p2 ); |
33 |
| -%Docstring |
34 |
| -Construct a rectangle from two points. The rectangle is normalized after construction. |
35 |
| -%End |
36 |
| - QgsRectangle( const QRectF &qRectF ); |
37 |
| -%Docstring |
38 |
| -Construct a rectangle from a QRectF. The rectangle is normalized after construction. |
39 |
| -%End |
40 |
| - QgsRectangle( const QgsRectangle &other ); |
41 |
| -%Docstring |
42 |
| -Copy constructor |
43 |
| -%End |
44 |
| - |
45 |
| - void set( const QgsPointXY &p1, const QgsPointXY &p2 ); |
46 |
| -%Docstring |
47 |
| - Sets the rectangle from two QgsPoints. The rectangle is |
48 |
| - normalised after construction. |
49 |
| -%End |
50 |
| - |
51 |
| - void set( double mXmin, double mYmin, double mXmax, double mYmax ); |
52 |
| -%Docstring |
53 |
| - Sets the rectangle from four points. The rectangle is |
54 |
| - normalised after construction. |
55 |
| -%End |
56 |
| - |
57 |
| - void setXMinimum( double x ); |
58 |
| -%Docstring |
59 |
| - Set the minimum x value. |
60 |
| -%End |
61 |
| - |
62 |
| - void setXMaximum( double x ); |
63 |
| -%Docstring |
64 |
| - Set the maximum x value. |
65 |
| -%End |
66 |
| - |
67 |
| - void setYMinimum( double y ); |
68 |
| -%Docstring |
69 |
| - Set the minimum y value. |
70 |
| -%End |
71 |
| - |
72 |
| - void setYMaximum( double y ); |
73 |
| -%Docstring |
74 |
| - Set the maximum y value. |
75 |
| -%End |
76 |
| - |
77 |
| - void setMinimal(); |
78 |
| -%Docstring |
79 |
| - Set a rectangle so that min corner is at max |
80 |
| - and max corner is at min. It is NOT normalized. |
81 |
| -%End |
82 |
| - |
83 |
| - double xMaximum() const; |
84 |
| -%Docstring |
85 |
| - Returns the x maximum value (right side of rectangle). |
86 |
| - :rtype: float |
87 |
| -%End |
88 |
| - |
89 |
| - double xMinimum() const; |
90 |
| -%Docstring |
91 |
| - Returns the x minimum value (left side of rectangle). |
92 |
| - :rtype: float |
93 |
| -%End |
94 |
| - |
95 |
| - double yMaximum() const; |
96 |
| -%Docstring |
97 |
| - Returns the y maximum value (top side of rectangle). |
98 |
| - :rtype: float |
99 |
| -%End |
100 |
| - |
101 |
| - double yMinimum() const; |
102 |
| -%Docstring |
103 |
| - Returns the y minimum value (bottom side of rectangle). |
104 |
| - :rtype: float |
105 |
| -%End |
106 |
| - |
107 |
| - void normalize(); |
108 |
| -%Docstring |
109 |
| - Normalize the rectangle so it has non-negative width/height. |
110 |
| -%End |
111 |
| - |
112 |
| - double width() const; |
113 |
| -%Docstring |
114 |
| - Returns the width of the rectangle. |
115 |
| -.. seealso:: height() |
116 |
| -.. seealso:: area() |
117 |
| - :rtype: float |
118 |
| -%End |
119 |
| - |
120 |
| - double height() const; |
121 |
| -%Docstring |
122 |
| - Returns the height of the rectangle. |
123 |
| -.. seealso:: width() |
124 |
| -.. seealso:: area() |
125 |
| - :rtype: float |
126 |
| -%End |
127 |
| - |
128 |
| - double area() const; |
129 |
| -%Docstring |
130 |
| - Returns the area of the rectangle. |
131 |
| -.. versionadded:: 3.0 |
132 |
| -.. seealso:: width() |
133 |
| -.. seealso:: height() |
134 |
| -.. seealso:: perimeter() |
135 |
| - :rtype: float |
136 |
| -%End |
137 |
| - |
138 |
| - double perimeter() const; |
139 |
| -%Docstring |
140 |
| - Returns the perimeter of the rectangle. |
141 |
| -.. versionadded:: 3.0 |
142 |
| -.. seealso:: area() |
143 |
| - :rtype: float |
144 |
| -%End |
145 |
| - |
146 |
| - QgsPointXY center() const; |
147 |
| -%Docstring |
148 |
| - Returns the center point of the rectangle. |
149 |
| - :rtype: QgsPointXY |
150 |
| -%End |
151 |
| - |
152 |
| - void scale( double scaleFactor, const QgsPointXY *c = 0 ); |
153 |
| -%Docstring |
154 |
| - Scale the rectangle around its center point. |
155 |
| -%End |
156 |
| - |
157 |
| - void scale( double scaleFactor, double centerX, double centerY ); |
158 |
| -%Docstring |
159 |
| - Scale the rectangle around its center point. |
160 |
| -%End |
161 |
| - |
162 |
| - void grow( double delta ); |
163 |
| -%Docstring |
164 |
| - Grows the rectangle by the specified amount. |
165 |
| -%End |
166 |
| - |
167 |
| - void include( const QgsPointXY &p ); |
168 |
| -%Docstring |
169 |
| - Updates the rectangle to include the specified point. |
170 |
| -%End |
171 |
| - |
172 |
| - QgsRectangle buffer( double width ); |
173 |
| -%Docstring |
174 |
| - Get rectangle enlarged by buffer. |
175 |
| -.. versionadded:: 2.1 |
176 |
| - :rtype: QgsRectangle |
177 |
| -%End |
178 |
| - |
179 |
| - QgsRectangle intersect( const QgsRectangle *rect ) const; |
180 |
| -%Docstring |
181 |
| - Return the intersection with the given rectangle. |
182 |
| - :rtype: QgsRectangle |
183 |
| -%End |
184 |
| - |
185 |
| - bool intersects( const QgsRectangle &rect ) const; |
186 |
| -%Docstring |
187 |
| - Returns true when rectangle intersects with other rectangle. |
188 |
| - :rtype: bool |
189 |
| -%End |
190 |
| - |
191 |
| - bool contains( const QgsRectangle &rect ) const; |
192 |
| -%Docstring |
193 |
| - Return true when rectangle contains other rectangle. |
194 |
| - :rtype: bool |
195 |
| -%End |
196 |
| - |
197 |
| - bool contains( const QgsPointXY &p ) const; |
198 |
| -%Docstring |
199 |
| - Return true when rectangle contains a point. |
200 |
| - :rtype: bool |
201 |
| -%End |
202 |
| - |
203 |
| - void combineExtentWith( const QgsRectangle &rect ); |
204 |
| -%Docstring |
205 |
| - Expand the rectangle so that covers both the original rectangle and the given rectangle. |
206 |
| -%End |
207 |
| - |
208 |
| - void combineExtentWith( double x, double y ); |
209 |
| -%Docstring |
210 |
| - Expand the rectangle so that covers both the original rectangle and the given point. |
211 |
| -%End |
212 |
| - |
213 |
| - QgsRectangle operator-( const QgsVector v ) const; |
214 |
| -%Docstring |
215 |
| - Returns a rectangle offset from this one in the direction of the reversed vector. |
216 |
| -.. versionadded:: 3.0 |
217 |
| - :rtype: QgsRectangle |
218 |
| -%End |
219 |
| - |
220 |
| - QgsRectangle operator+( const QgsVector v ) const; |
221 |
| -%Docstring |
222 |
| - Returns a rectangle offset from this one in the direction of the vector. |
223 |
| -.. versionadded:: 3.0 |
224 |
| - :rtype: QgsRectangle |
225 |
| -%End |
226 |
| - |
227 |
| - QgsRectangle &operator-=( const QgsVector v ); |
228 |
| -%Docstring |
229 |
| - Moves this rectangle in the direction of the reversed vector. |
230 |
| -.. versionadded:: 3.0 |
231 |
| - :rtype: QgsRectangle |
232 |
| -%End |
233 |
| - |
234 |
| - QgsRectangle &operator+=( const QgsVector v ); |
235 |
| -%Docstring |
236 |
| - Moves this rectangle in the direction of the vector. |
237 |
| -.. versionadded:: 3.0 |
238 |
| - :rtype: QgsRectangle |
239 |
| -%End |
240 |
| - |
241 |
| - bool isEmpty() const; |
242 |
| -%Docstring |
243 |
| - Returns true if the rectangle is empty. |
244 |
| - An empty rectangle may still be non-null if it contains valid information (e.g. bounding box of a point). |
245 |
| - :rtype: bool |
246 |
| -%End |
247 |
| - |
248 |
| - bool isNull() const; |
249 |
| -%Docstring |
250 |
| - Test if the rectangle is null (all coordinates zero or after call to setMinimal()). |
251 |
| - A null rectangle is also an empty rectangle. |
252 |
| -.. versionadded:: 2.4 |
253 |
| - :rtype: bool |
254 |
| -%End |
255 |
| - |
256 |
| - QString asWktCoordinates() const; |
257 |
| -%Docstring |
258 |
| - Returns a string representation of the rectangle in WKT format. |
259 |
| - :rtype: str |
260 |
| -%End |
261 |
| - |
262 |
| - QString asWktPolygon() const; |
263 |
| -%Docstring |
264 |
| - Returns a string representation of the rectangle as a WKT Polygon. |
265 |
| - :rtype: str |
266 |
| -%End |
267 |
| - |
268 |
| - QRectF toRectF() const; |
269 |
| -%Docstring |
270 |
| - Returns a QRectF with same coordinates as the rectangle. |
271 |
| - :rtype: QRectF |
272 |
| -%End |
273 |
| - |
274 |
| - QString toString( int precision = 16 ) const; |
275 |
| -%Docstring |
276 |
| - Returns a string representation of form xmin,ymin : xmax,ymax |
277 |
| - Coordinates will be truncated to the specified precision. |
278 |
| - If the specified precision is less than 0, a suitable minimum precision is used. |
279 |
| - :rtype: str |
280 |
| -%End |
281 |
| - |
282 |
| - QString asPolygon() const; |
283 |
| -%Docstring |
284 |
| - Returns the rectangle as a polygon. |
285 |
| - :rtype: str |
286 |
| -%End |
287 |
| - |
288 |
| - bool operator==( const QgsRectangle &r1 ) const; |
289 |
| - |
290 |
| - bool operator!=( const QgsRectangle &r1 ) const; |
291 |
| -%Docstring |
292 |
| - Comparison operator |
293 |
| - :return: False if rectangles are equal |
294 |
| - :rtype: bool |
295 |
| -%End |
296 |
| - |
297 |
| - |
298 |
| - bool isFinite() const; |
299 |
| -%Docstring |
300 |
| - Returns true if the rectangle has finite boundaries. Will |
301 |
| - return false if any of the rectangle boundaries are NaN or Inf. |
302 |
| - :rtype: bool |
303 |
| -%End |
304 |
| - |
305 |
| - void invert(); |
306 |
| -%Docstring |
307 |
| - Swap x/y coordinates in the rectangle. |
308 |
| -%End |
309 |
| - |
310 |
| - QgsBox3d toBox3d( double zMin, double zMax ) const; |
311 |
| -%Docstring |
312 |
| - Converts the rectangle to a 3D box, with the specified |
313 |
| - ``zMin`` and ``zMax`` z values. |
314 |
| -.. versionadded:: 3.0 |
315 |
| - :rtype: QgsBox3d |
316 |
| -%End |
317 |
| - |
318 |
| -}; |
319 |
| - |
320 |
| - |
321 |
| -/************************************************************************ |
322 |
| - * This file has been generated automatically from * |
323 |
| - * * |
324 |
| - * src/core/geometry/qgsrectangle.h * |
325 |
| - * * |
326 |
| - * Do not edit manually ! Edit header and run scripts/sipify.pl again * |
327 |
| - ************************************************************************/ |
0 commit comments