@@ -12,25 +12,31 @@ class QgsRubberBand: QgsMapCanvasItem
12
12
void setWidth(int width);
13
13
14
14
void reset(bool isPolygon = false);
15
- void addPoint(const QgsPoint & p, int geometryIndex);
16
15
17
- //!Removes the last point. Most usefull in connection with undo operations
18
- void removeLastPoint(int geometryIndex = 0);
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);
19
20
20
- void movePoint(const QgsPoint & p, int geometryIndex);
21
- void movePoint (int index, const QgsPoint& p, int geometryIndex );
21
+ //!Removes the last point. Most usefull in connection with undo operations
22
+ void removeLastPoint (int geometryIndex = 0 );
22
23
23
- /**Sets this rubber band to the geometry of an existing feature.
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);
28
+
29
+ /**Sets this rubber band to the geometry of an existing feature.
24
30
This is usefull for feature highlighting.
25
31
@param geom the geometry object
26
32
@param layer the layer containing the feature (used for coord transformation)
27
33
@param render the maprender object (used for coord transformation)*/
28
34
void setToGeometry(QgsGeometry* geom, QgsVectorLayer& layer);
29
35
30
- /**Adds translation to original coordinates (all in map coordinates)*/
36
+ /**Adds translation to original coordinates (all in map coordinates)*/
31
37
void setTranslationOffset(double dx, double dy);
32
38
33
- /**Returns count of vertices in all lists of mPoint*/
39
+ /**Returns count of vertices in all lists of mPoint*/
34
40
int numberOfVertices() const;
35
41
36
42
protected:
0 commit comments