~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to python/gui/qgsrubberband.sip

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class QgsRubberBand: QgsMapCanvasItem
 
2
{
 
3
%TypeHeaderCode
 
4
#include <qgsrubberband.h>
 
5
%End
 
6
 
 
7
  public:
 
8
    QgsRubberBand(QgsMapCanvas* mapCanvas /TransferThis/, bool isPolygon = false);
 
9
    ~QgsRubberBand();
 
10
 
 
11
    void setColor(const QColor & color);
 
12
    void setWidth(int width);
 
13
 
 
14
    void reset(bool isPolygon = false);
 
15
 
 
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);
 
20
 
 
21
    //!Removes the last point. Most useful in connection with undo operations
 
22
    void removeLastPoint(int geometryIndex = 0);
 
23
 
 
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.
 
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);
 
36
 
 
37
    /**Adds translation to original coordinates (all in map coordinates)*/
 
38
    void setTranslationOffset(double dx, double dy);
 
39
 
 
40
    /**Returns count of vertices in all lists of mPoint*/
 
41
    int numberOfVertices() const;
 
42
 
 
43
    /**Return vertex*/
 
44
    const QgsPoint *getPoint(int i, int j=0) const;
 
45
 
 
46
  protected:
 
47
    virtual void paint(QPainter* p);
 
48
    
 
49
    //! recalculates needed rectangle
 
50
    void updateRect();
 
51
 
 
52
};