1
/***************************************************************************
2
qgsmaptoolcapture.h - map tool for capturing points, lines, polygons
5
copyright : (C) 2006 by Martin Dobias
6
email : wonder.sk at gmail dot com
7
***************************************************************************
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. *
14
***************************************************************************/
17
#ifndef QGSMAPTOOLCAPTURE_H
18
#define QGSMAPTOOLCAPTURE_H
20
#include "qgsmaptool.h"
29
class QgsMapToolCapture : public QgsMapTool
41
QgsMapToolCapture(QgsMapCanvas* canvas, enum CaptureTool tool);
44
virtual ~QgsMapToolCapture();
46
//! Overridden mouse move event
47
virtual void canvasMoveEvent(QMouseEvent * e);
49
//! Overridden mouse press event
50
virtual void canvasPressEvent(QMouseEvent * e);
52
//! Overridden mouse release event
53
virtual void canvasReleaseEvent(QMouseEvent * e);
55
//! Resize rubber band
56
virtual void renderComplete();
59
virtual void deactivate();
62
// FIXME: is this still actual or something old that's not used anymore?
64
//! emits mouse position when the canvas is clicked
65
void xyClickCoordinates(QgsPoint &p);
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[]);
75
/** which capturing tool is being used */
76
enum CaptureTool mTool;
78
/** Flag to indicate a map canvas capture operation is taking place */
81
/** rubber band for polylines and polygons */
82
QgsRubberBand* mRubberBand;
84
/** List to store the points of digitised lines and polygons */
85
std::list<QgsPoint> mCaptureList;