~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/gui/qgsmaptoolcapture.h

  • 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
 
/***************************************************************************
2
 
    qgsmaptoolcapture.h  -  map tool for capturing points, lines, polygons
3
 
    ---------------------
4
 
    begin                : January 2006
5
 
    copyright            : (C) 2006 by Martin Dobias
6
 
    email                : wonder.sk at gmail dot com
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
 
/* $Id$ */
16
 
 
17
 
#ifndef QGSMAPTOOLCAPTURE_H
18
 
#define QGSMAPTOOLCAPTURE_H
19
 
 
20
 
#include "qgsmaptool.h"
21
 
#include "qgspoint.h"
22
 
 
23
 
 
24
 
class QgsRubberBand;
25
 
 
26
 
#include <QPoint>
27
 
#include <list>
28
 
 
29
 
class QgsMapToolCapture : public QgsMapTool
30
 
{
31
 
  public:
32
 
  
33
 
    enum CaptureTool
34
 
    {
35
 
      CapturePoint,
36
 
      CaptureLine,
37
 
      CapturePolygon
38
 
    };
39
 
 
40
 
    //! constructor
41
 
    QgsMapToolCapture(QgsMapCanvas* canvas, enum CaptureTool tool);
42
 
 
43
 
    //! destructor
44
 
    virtual ~QgsMapToolCapture();
45
 
 
46
 
    //! Overridden mouse move event
47
 
    virtual void canvasMoveEvent(QMouseEvent * e);
48
 
  
49
 
    //! Overridden mouse press event
50
 
    virtual void canvasPressEvent(QMouseEvent * e);
51
 
  
52
 
    //! Overridden mouse release event
53
 
    virtual void canvasReleaseEvent(QMouseEvent * e);    
54
 
    
55
 
    //! Resize rubber band
56
 
    virtual void renderComplete();
57
 
    
58
 
 
59
 
    virtual void deactivate();
60
 
 
61
 
    /*
62
 
    // FIXME: is this still actual or something old that's not used anymore?
63
 
  signals:
64
 
    //! emits mouse position when the canvas is clicked
65
 
    void xyClickCoordinates(QgsPoint &p);
66
 
    */
67
 
  
68
 
  protected:
69
 
    
70
 
    /** Helper function to inverse project a point if projections
71
 
        are enabled. Failsafe, returns the sent point if anything fails.
72
 
        @whenmsg is a part fo the error message. */
73
 
    QgsPoint maybeInversePoint(QgsPoint point, const char whenmsg[]);
74
 
 
75
 
    /** which capturing tool is being used */
76
 
    enum CaptureTool mTool;
77
 
    
78
 
    /** Flag to indicate a map canvas capture operation is taking place */
79
 
    bool mCapturing;
80
 
    
81
 
    /** rubber band for polylines and polygons */
82
 
    QgsRubberBand* mRubberBand;
83
 
 
84
 
    /** List to store the points of digitised lines and polygons */
85
 
    std::list<QgsPoint> mCaptureList;
86
 
 
87
 
};
88
 
 
89
 
#endif