1
class QgsRubberBand: QgsMapCanvasItem
4
#include <qgsrubberband.h>
8
QgsRubberBand(QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon = false);
11
void setColor(const QColor & color);
12
void setWidth(int width);
14
void reset(bool isPolygon = false);
16
//! Add point to rubberband and update canvas
17
//! If adding more points consider using update=false for better performance
18
//! geometryIndex is the index of the feature part (in case of multipart geometries)
19
void addPoint(const QgsPoint & p, bool update = true, int geometryIndex = 0);
21
//!Removes the last point. Most useful in connection with undo operations
22
void removeLastPoint(int geometryIndex = 0);
24
void movePoint(const QgsPoint & p, int geometryIndex = 0);
25
/**Moves the rubber band point specified by index. Note that if the rubber band is
26
not used to track the last mouse position, the first point of the rubber band has two vertices*/
27
void movePoint(int index, const QgsPoint& p, int geometryIndex = 0);
29
/**Sets this rubber band to the geometry of an existing feature.
30
This is useful for feature highlighting.
31
@param geom the geometry object
32
@param layer the layer containing the feature, used for coord transformation to map
33
crs. In case of 0 pointer, the coordinates are not going to be transformed.
34
@param render the maprender object (used for coord transformation)*/
35
void setToGeometry(QgsGeometry* geom, QgsVectorLayer* layer);
37
/**Adds translation to original coordinates (all in map coordinates)*/
38
void setTranslationOffset(double dx, double dy);
40
/**Returns count of vertices in all lists of mPoint*/
41
int numberOfVertices() const;
44
const QgsPoint *getPoint(int i, int j=0) const;
47
virtual void paint(QPainter* p);
49
//! recalculates needed rectangle