QGIS API Documentation  2.9.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgsrubberband.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrubberband.cpp - Rubberband widget for drawing multilines and polygons
3  --------------------------------------
4  Date : 07-Jan-2006
5  Copyright : (C) 2006 by Tom Elwertowski
6  Email : telwertowski at users dot sourceforge dot net
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgsrubberband.h"
17 #include "qgsfeature.h"
18 #include "qgsgeometry.h"
19 #include "qgslogger.h"
20 #include "qgsmapcanvas.h"
21 #include "qgsmaprenderer.h"
22 #include "qgsvectorlayer.h"
23 #include <QPainter>
24 
31  : QgsMapCanvasItem( mapCanvas )
32  , mIconSize( 5 )
33  , mIconType( ICON_CIRCLE )
34  , mGeometryType( geometryType )
35  , mTranslationOffsetX( 0.0 )
36  , mTranslationOffsetY( 0.0 )
37 {
38  reset( geometryType );
39  QColor color( Qt::lightGray );
40  color.setAlpha( 63 );
41  setColor( color );
42  setWidth( 1 );
43  setLineStyle( Qt::SolidLine );
44  setBrushStyle( Qt::SolidPattern );
45 }
46 
47 QgsRubberBand::QgsRubberBand( QgsMapCanvas* mapCanvas, bool isPolygon )
48  : QgsMapCanvasItem( mapCanvas )
49  , mIconSize( 5 )
50  , mIconType( ICON_CIRCLE )
51  , mTranslationOffsetX( 0.0 )
52  , mTranslationOffsetY( 0.0 )
53 {
54  reset( isPolygon ? QGis::Polygon : QGis::Line );
55  QColor color( Qt::lightGray );
56  color.setAlpha( 63 );
57  setColor( color );
58  setWidth( 1 );
59  setLineStyle( Qt::SolidLine );
60  setBrushStyle( Qt::SolidPattern );
61 }
62 
63 QgsRubberBand::QgsRubberBand()
64  : QgsMapCanvasItem( 0 )
65  , mIconSize( 5 )
66  , mIconType( ICON_CIRCLE )
67  , mGeometryType( QGis::Polygon )
68  , mTranslationOffsetX( 0.0 )
69  , mTranslationOffsetY( 0.0 )
70 {
71 }
72 
74 {
75 }
76 
80 void QgsRubberBand::setColor( const QColor & color )
81 {
82  setBorderColor( color );
83  setFillColor( color );
84 }
85 
89 void QgsRubberBand::setFillColor( const QColor & color )
90 {
91  QColor fillColor( color.red(), color.green(), color.blue(), color.alpha() );
92  mBrush.setColor( fillColor );
93 }
94 
98 void QgsRubberBand::setBorderColor( const QColor & color )
99 {
100  QColor penColor( color.red(), color.green(), color.blue(), color.alpha() );
101  mPen.setColor( penColor );
102 }
103 
104 
108 void QgsRubberBand::setWidth( int width )
109 {
110  mPen.setWidth( width );
111 }
112 
114 {
115  mIconType = icon;
116 }
117 
118 void QgsRubberBand::setIconSize( int iconSize )
119 {
120  mIconSize = iconSize;
121 }
122 
123 void QgsRubberBand::setLineStyle( Qt::PenStyle penStyle )
124 {
125  mPen.setStyle( penStyle );
126 }
127 
128 void QgsRubberBand::setBrushStyle( Qt::BrushStyle brushStyle )
129 {
130  mBrush.setStyle( brushStyle );
131 }
132 
137 {
138  mPoints.clear();
139  mGeometryType = geometryType;
140  updateRect();
141  update();
142 }
143 
144 void QgsRubberBand::reset( bool isPolygon )
145 {
146  mPoints.clear();
147  mGeometryType = isPolygon ? QGis::Polygon : QGis::Line;
148  updateRect();
149  update();
150 }
151 
155 void QgsRubberBand::addPoint( const QgsPoint & p, bool doUpdate /* = true */, int geometryIndex )
156 {
157  if ( geometryIndex < 0 )
158  {
159  geometryIndex = mPoints.size() - 1;
160  }
161 
162  if ( geometryIndex < 0 || geometryIndex > mPoints.size() )
163  {
164  return;
165  }
166 
167  if ( geometryIndex == mPoints.size() )
168  {
169  mPoints.push_back( QList<QgsPoint>() << p );
170  }
171 
172  if ( mPoints[geometryIndex].size() == 2 &&
173  mPoints[geometryIndex][0] == mPoints[geometryIndex][1] )
174  {
175  mPoints[geometryIndex].last() = p;
176  }
177  else
178  {
179  mPoints[geometryIndex] << p;
180  }
181 
182 
183  if ( doUpdate )
184  {
185  updateRect();
186  update();
187  }
188 }
189 
190 
191 void QgsRubberBand::removePoint( int index, bool doUpdate/* = true*/, int geometryIndex/* = 0*/ )
192 {
193 
194  if ( mPoints.size() < geometryIndex + 1 )
195  {
196  return;
197  }
198 
199 
200  if ( mPoints[geometryIndex].size() > 0 )
201  {
202  // negative index removes from end, eg -1 removes last one
203  if ( index < 0 )
204  {
205  index = mPoints[geometryIndex].size() + index;
206  }
207  mPoints[geometryIndex].removeAt( index );
208  }
209 
210  if ( doUpdate )
211  {
212  updateRect();
213  update();
214  }
215 }
216 
217 void QgsRubberBand::removeLastPoint( int geometryIndex, bool doUpdate/* = true*/ )
218 {
219  removePoint( -1, doUpdate, geometryIndex );
220 }
221 
225 void QgsRubberBand::movePoint( const QgsPoint & p, int geometryIndex )
226 {
227  if ( mPoints.size() < geometryIndex + 1 )
228  {
229  return;
230  }
231 
232  if ( mPoints.at( geometryIndex ).size() < 1 )
233  {
234  return;
235  }
236 
237  mPoints[geometryIndex].last() = p;
238 
239  updateRect();
240  update();
241 }
242 
243 void QgsRubberBand::movePoint( int index, const QgsPoint& p, int geometryIndex )
244 {
245  if ( mPoints.size() < geometryIndex + 1 )
246  {
247  return;
248  }
249 
250  if ( mPoints.at( geometryIndex ).size() < index )
251  {
252  return;
253  }
254 
255  mPoints[geometryIndex][index] = p;
256 
257  updateRect();
258  update();
259 }
260 
262 {
263  if ( !geom )
264  {
265  reset( mGeometryType );
266  return;
267  }
268 
269  reset( geom->type() );
270  addGeometry( geom, layer );
271 }
272 
274 {
275  if ( !geom )
276  {
277  return;
278  }
279 
280  //maprender object of canvas
281  const QgsMapSettings& ms = mMapCanvas->mapSettings();
282 
283  int idx = mPoints.size();
284 
285  switch ( geom->wkbType() )
286  {
287 
288  case QGis::WKBPoint:
289  case QGis::WKBPoint25D:
290  {
291  QgsPoint pt;
292  if ( layer )
293  {
294  pt = ms.layerToMapCoordinates( layer, geom->asPoint() );
295  }
296  else
297  {
298  pt = geom->asPoint();
299  }
300  addPoint( pt, false, idx );
301  removeLastPoint( idx, false );
302  }
303  break;
304 
305  case QGis::WKBMultiPoint:
307  {
308  QgsMultiPoint mpt = geom->asMultiPoint();
309  for ( int i = 0; i < mpt.size(); ++i, ++idx )
310  {
311  QgsPoint pt = mpt[i];
312  if ( layer )
313  {
314  addPoint( ms.layerToMapCoordinates( layer, pt ), false, idx );
315  removeLastPoint( idx, false );
316  }
317  else
318  {
319  addPoint( pt, false, idx );
320  removeLastPoint( idx, false );
321  }
322  }
323  }
324  break;
325 
326  case QGis::WKBLineString:
328  {
329  QgsPolyline line = geom->asPolyline();
330  for ( int i = 0; i < line.count(); i++ )
331  {
332  if ( layer )
333  {
334  addPoint( ms.layerToMapCoordinates( layer, line[i] ), false, idx );
335  }
336  else
337  {
338  addPoint( line[i], false, idx );
339  }
340  }
341  }
342  break;
343 
346  {
347 
348  QgsMultiPolyline mline = geom->asMultiPolyline();
349  for ( int i = 0; i < mline.size(); ++i, ++idx )
350  {
351  QgsPolyline line = mline[i];
352 
353  if ( line.size() == 0 )
354  {
355  --idx;
356  }
357 
358  for ( int j = 0; j < line.size(); ++j )
359  {
360  if ( layer )
361  {
362  addPoint( ms.layerToMapCoordinates( layer, line[j] ), false, idx );
363  }
364  else
365  {
366  addPoint( line[j], false, idx );
367  }
368  }
369  }
370  }
371  break;
372 
373  case QGis::WKBPolygon:
374  case QGis::WKBPolygon25D:
375  {
376  QgsPolygon poly = geom->asPolygon();
377  QgsPolyline line = poly[0];
378  for ( int i = 0; i < line.count(); i++ )
379  {
380  if ( layer )
381  {
382  addPoint( ms.layerToMapCoordinates( layer, line[i] ), false, idx );
383  }
384  else
385  {
386  addPoint( line[i], false, idx );
387  }
388  }
389  }
390  break;
391 
394  {
395 
396  QgsMultiPolygon multipoly = geom->asMultiPolygon();
397  for ( int i = 0; i < multipoly.size(); ++i, ++idx )
398  {
399  QgsPolygon poly = multipoly[i];
400  QgsPolyline line = poly[0];
401  for ( int j = 0; j < line.count(); ++j )
402  {
403  if ( layer )
404  {
405  addPoint( ms.layerToMapCoordinates( layer, line[j] ), false, idx );
406  }
407  else
408  {
409  addPoint( line[j], false, idx );
410  }
411  }
412  }
413  }
414  break;
415 
416  case QGis::WKBUnknown:
417  default:
418  return;
419  }
420 
421  updateRect();
422  update();
423 }
424 
425 void QgsRubberBand::setToCanvasRectangle( const QRect& rect )
426 {
427  if ( !mMapCanvas )
428  {
429  return;
430  }
431 
432  const QgsMapToPixel* transform = mMapCanvas->getCoordinateTransform();
433  QgsPoint ll = transform->toMapCoordinates( rect.left(), rect.bottom() );
434  QgsPoint lr = transform->toMapCoordinates( rect.right(), rect.bottom() );
435  QgsPoint ul = transform->toMapCoordinates( rect.left(), rect.top() );
436  QgsPoint ur = transform->toMapCoordinates( rect.right(), rect.top() );
437 
438  reset( QGis::Polygon );
439  addPoint( ll, false );
440  addPoint( lr, false );
441  addPoint( ur, false );
442  addPoint( ul, true );
443 }
444 
448 void QgsRubberBand::paint( QPainter* p )
449 {
450  if ( mPoints.size() > 0 )
451  {
452  p->setBrush( mBrush );
453  p->setPen( mPen );
454 
455  Q_FOREACH ( const QList<QgsPoint>& line, mPoints )
456  {
457  QVector<QPointF> pts;
458  Q_FOREACH ( const QgsPoint& pt, line )
459  {
460  const QPointF cur = toCanvasCoordinates( QgsPoint( pt.x() + mTranslationOffsetX, pt.y() + mTranslationOffsetY ) ) - pos();
461  if ( pts.empty() || std::abs( pts.back().x() - cur.x() ) > 1 || std::abs( pts.back().y() - cur.y() ) > 1 )
462  pts.append( cur );
463  }
464 
465  switch ( mGeometryType )
466  {
467  case QGis::Polygon:
468  {
469  p->drawPolygon( pts );
470  }
471  break;
472 
473  case QGis::Point:
474  {
475  Q_FOREACH ( const QPointF& pt, pts )
476  {
477  double x = pt.x();
478  double y = pt.y();
479 
480  qreal s = ( mIconSize - 1 ) / 2.0;
481 
482  switch ( mIconType )
483  {
484  case ICON_NONE:
485  break;
486 
487  case ICON_CROSS:
488  p->drawLine( QLineF( x - s, y, x + s, y ) );
489  p->drawLine( QLineF( x, y - s, x, y + s ) );
490  break;
491 
492  case ICON_X:
493  p->drawLine( QLineF( x - s, y - s, x + s, y + s ) );
494  p->drawLine( QLineF( x - s, y + s, x + s, y - s ) );
495  break;
496 
497  case ICON_BOX:
498  p->drawLine( QLineF( x - s, y - s, x + s, y - s ) );
499  p->drawLine( QLineF( x + s, y - s, x + s, y + s ) );
500  p->drawLine( QLineF( x + s, y + s, x - s, y + s ) );
501  p->drawLine( QLineF( x - s, y + s, x - s, y - s ) );
502  break;
503 
504  case ICON_FULL_BOX:
505  p->drawRect( x - s, y - s, mIconSize, mIconSize );
506  break;
507 
508  case ICON_CIRCLE:
509  p->drawEllipse( x - s, y - s, mIconSize, mIconSize );
510  break;
511  }
512  }
513  }
514  break;
515 
516  case QGis::Line:
517  default:
518  {
519  p->drawPolyline( pts );
520  }
521  break;
522  }
523  }
524  }
525 }
526 
528 {
529  if ( mPoints.empty() )
530  {
531  setRect( QgsRectangle() );
532  setVisible( false );
533  return;
534  }
535 
536  const QgsMapToPixel& m2p = *( mMapCanvas->getCoordinateTransform() );
537 
538  qreal w = ( mIconSize - 1 ) / 2 + mPen.width();
539 
540  QgsRectangle r;
541  for ( int i = 0; i < mPoints.size(); ++i )
542  {
543  QList<QgsPoint>::const_iterator it = mPoints.at( i ).constBegin(),
544  itE = mPoints.at( i ).constEnd();
545  for ( ; it != itE; ++it )
546  {
547  QgsPoint p( it->x() + mTranslationOffsetX, it->y() + mTranslationOffsetY );
548  p = m2p.transform( p );
549  QgsRectangle rect( p.x() - w, p.y() - w, p.x() + w, p.y() + w );
550  r.combineExtentWith( &rect );
551  }
552  }
553 
554  // This is an hack to pass QgsMapCanvasItem::setRect what it
555  // expects (encoding of position and size of the item)
556  QgsPoint topLeft = m2p.toMapPoint( r.xMinimum(), r.yMinimum() );
557  double res = m2p.mapUnitsPerPixel();
558  QgsRectangle rect( topLeft.x(), topLeft.y(), topLeft.x() + r.width()*res, topLeft.y() - r.height()*res );
559 
560  setRect( rect );
561  setVisible( true );
562 }
563 
565 {
566  // nothing to do here...
567 }
568 
569 void QgsRubberBand::setTranslationOffset( double dx, double dy )
570 {
571  mTranslationOffsetX = dx;
572  mTranslationOffsetY = dy;
573  updateRect();
574 }
575 
577 {
578  return mPoints.size();
579 }
580 
581 int QgsRubberBand::partSize( int geometryIndex ) const
582 {
583  if ( geometryIndex < 0 || geometryIndex >= mPoints.size() ) return 0;
584  return mPoints[geometryIndex].size();
585 }
586 
588 {
589  int count = 0;
590  QList<QList<QgsPoint> >::const_iterator it = mPoints.constBegin();
591  for ( ; it != mPoints.constEnd(); ++it )
592  {
593  QList<QgsPoint>::const_iterator iter = it->constBegin();
594  for ( ; iter != it->constEnd(); ++iter )
595  {
596  ++count;
597  }
598  }
599  return count;
600 }
601 
602 const QgsPoint *QgsRubberBand::getPoint( int i, int j ) const
603 {
604  if ( i < mPoints.size() && j < mPoints[i].size() )
605  return &mPoints[i][j];
606  else
607  return 0;
608 }
609 
611 {
612  QgsGeometry *geom = NULL;
613 
614  switch ( mGeometryType )
615  {
616  case QGis::Polygon:
617  {
618  QgsPolygon polygon;
619  QList< QList<QgsPoint> >::const_iterator it = mPoints.constBegin();
620  for ( ; it != mPoints.constEnd(); ++it )
621  {
622  polygon.append( getPolyline( *it ) );
623  }
624  geom = QgsGeometry::fromPolygon( polygon );
625  break;
626  }
627 
628  case QGis::Point:
629  {
630  QgsMultiPoint multiPoint;
631 
632  QList< QList<QgsPoint> >::const_iterator it = mPoints.constBegin();
633  for ( ; it != mPoints.constEnd(); ++it )
634  {
635  multiPoint += getPolyline( *it );
636  }
637  geom = QgsGeometry::fromMultiPoint( multiPoint );
638  break;
639  }
640 
641  case QGis::Line:
642  default:
643  {
644  if ( mPoints.size() > 0 )
645  {
646  if ( mPoints.size() > 1 )
647  {
648  QgsMultiPolyline multiPolyline;
649  QList< QList<QgsPoint> >::const_iterator it = mPoints.constBegin();
650  for ( ; it != mPoints.constEnd(); ++it )
651  {
652  multiPolyline.append( getPolyline( *it ) );
653  }
654  geom = QgsGeometry::fromMultiPolyline( multiPolyline );
655  }
656  else
657  {
658  geom = QgsGeometry::fromPolyline( getPolyline( mPoints[0] ) );
659  }
660  }
661  break;
662  }
663  }
664  return geom;
665 }
666 
667 QgsPolyline QgsRubberBand::getPolyline( const QList<QgsPoint> & points )
668 {
669  QgsPolyline polyline;
670  QList<QgsPoint>::const_iterator iter = points.constBegin();
671  for ( ; iter != points.constEnd(); ++iter )
672  {
673  polyline.append( *iter );
674  }
675  return polyline;
676 }
void setIconSize(int iconSize)
Set the size of the point icons.
void setWidth(int width)
Set the width of the line.
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsPoint layerToMapCoordinates(QgsMapLayer *theLayer, QgsPoint point) const
transform point coordinates from layer's CRS to output CRS
void setBorderColor(const QColor &color)
Set the border color for the rubberband.
QPointF toCanvasCoordinates(const QgsPoint &point) const
transformation from map coordinates to screen coordinates
void setTranslationOffset(double dx, double dy)
Adds translation to original coordinates (all in map coordinates)
void setLineStyle(Qt::PenStyle penStyle)
Set the style of the line.
QgsMultiPolyline asMultiPolyline() const
return contents of the geometry as a multi linestring if wkbType is WKBMultiLineString, otherwise an empty list
void movePoint(const QgsPoint &p, int geometryIndex=0)
Moves the rubber band point specified by index.
QVector< QgsPoint > QgsPolyline
polyline is represented as a vector of points
Definition: qgsgeometry.h:33
A box is used to highlight points (□)
Definition: qgsrubberband.h:54
QgsPolygon asPolygon() const
return contents of the geometry as a polygon if wkbType is WKBPolygon, otherwise an empty list ...
QgsPoint transform(const QgsPoint &p) const
const QgsPoint * getPoint(int i, int j=0) const
Return vertex.
An abstract class for items that can be placed on the map canvas.
QGis::GeometryType type() const
Returns type of the vector.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
GeometryType
Definition: qgis.h:155
virtual void updatePosition() override
called on changed extent or resize event to update position of the item
The QGis class provides global constants for use throughout the application.
Definition: qgis.h:34
int numberOfVertices() const
Returns count of vertices in all lists of mPoint.
QgsRectangle rect() const
returns canvas item rectangle in map units
QgsGeometry * asGeometry()
Returns the rubberband as a Geometry.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:105
double x() const
Definition: qgspoint.h:126
virtual void paint(QPainter *p) override
QgsMultiPolygon asMultiPolygon() const
return contents of the geometry as a multi polygon if wkbType is WKBMultiPolygon, otherwise an empty ...
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:34
void combineExtentWith(QgsRectangle *rect)
expand the rectangle so that covers both the original rectangle and the given rectangle ...
double yMinimum() const
Get the y minimum value (bottom side of rectangle)
Definition: qgsrectangle.h:193
A circle is used to highlight points (○)
Definition: qgsrubberband.h:58
void removePoint(int index=0, bool doUpdate=true, int geometryIndex=0)
Remove a vertex from the rubberband and (optionally) update canvas.
void setRect(const QgsRectangle &r, bool resetRotation=true)
sets canvas item rectangle in map units
QVector< QgsPolygon > QgsMultiPolygon
a collection of QgsPolygons that share a common collection of attributes
Definition: qgsgeometry.h:48
void addPoint(const QgsPoint &p, bool doUpdate=true, int geometryIndex=0)
Add a vertex to the rubberband and update canvas.
QVector< QgsPoint > QgsMultiPoint
a collection of QgsPoints that share a common collection of attributes
Definition: qgsgeometry.h:42
void reset(QGis::GeometryType geometryType=QGis::Line)
Clears all the geometries in this rubberband.
QGis::WkbType wkbType() const
Returns type of wkb (point / linestring / polygon etc.)
double mapUnitsPerPixel() const
Return current map units per pixel.
void setFillColor(const QColor &color)
Set the fill color for the rubberband.
QVector< QgsPolyline > QgsPolygon
polygon: first item of the list is outer ring, inner rings (if any) start from second item ...
Definition: qgsgeometry.h:39
void setToGeometry(QgsGeometry *geom, QgsVectorLayer *layer)
Sets this rubber band to the geometry of an existing feature.
A cross is used to highlight points (x)
Definition: qgsrubberband.h:50
A class to represent a point.
Definition: qgspoint.h:63
A full box is used to highlight points (■)
Definition: qgsrubberband.h:62
void setBrushStyle(Qt::BrushStyle brushStyle)
Set the style of the brush.
QVector< QgsPolyline > QgsMultiPolyline
a collection of QgsPolylines that share a common collection of attributes
Definition: qgsgeometry.h:45
static QgsGeometry * fromMultiPolyline(const QgsMultiPolyline &multiline)
construct geometry from a multipolyline
QgsPoint toMapCoordinates(int x, int y) const
void setIcon(IconType icon)
Set the icon type to highlight point geometries.
QgsPolyline asPolyline() const
return contents of the geometry as a polyline if wkbType is WKBLineString, otherwise an empty list ...
int size() const
Returns number of geometries.
void setToCanvasRectangle(const QRect &rect)
Sets this rubber band to a map canvas rectangle.
QgsRubberBand(QgsMapCanvas *mapCanvas, QGis::GeometryType geometryType=QGis::Line)
Creates a new RubberBand.
QgsMultiPoint asMultiPoint() const
return contents of the geometry as a multi point if wkbType is WKBMultiPoint, otherwise an empty list...
QgsMapCanvas * mMapCanvas
pointer to map canvas
int partSize(int geometryIndex) const
Returns number of vertices in feature part.
A cross is used to highlight points (+)
Definition: qgsrubberband.h:46
const QgsMapToPixel * getCoordinateTransform()
Get the current coordinate transform.
static QgsGeometry * fromMultiPoint(const QgsMultiPoint &multipoint)
construct geometry from a multipoint
static QgsGeometry * fromPolyline(const QgsPolyline &polyline)
construct geometry from a polyline
double y() const
Definition: qgspoint.h:134
No icon is used.
Definition: qgsrubberband.h:42
void setColor(const QColor &color)
Set the color for the rubberband.
static QgsGeometry * fromPolygon(const QgsPolygon &polygon)
construct geometry from a polygon
void addGeometry(QgsGeometry *geom, QgsVectorLayer *layer)
Add the geometry of an existing feature to a rubberband This is useful for multi feature highlighting...
double width() const
Width of the rectangle.
Definition: qgsrectangle.h:198
QgsPoint asPoint() const
return contents of the geometry as a point if wkbType is WKBPoint, otherwise returns [0...
Represents a vector layer which manages a vector based data sets.
void removeLastPoint(int geometryIndex=0, bool doUpdate=true)
Removes the last point.
double xMinimum() const
Get the x minimum value (left side of rectangle)
Definition: qgsrectangle.h:183
QgsPoint toMapPoint(qreal x, qreal y) const
void updateRect()
recalculates needed rectangle
double height() const
Height of the rectangle.
Definition: qgsrectangle.h:203