~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to src/qgsmeasure.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Halasz
  • Date: 2005-11-05 16:04:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051105160445-l0g4isz5bc9yehet
Tags: 0.7.4-1
* New upstream release
* Build GRASS support in qgis-plugin-grass package (Closes: #248649)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                                qgsmeasure.h 
 
3
                               ------------------
 
4
        begin                : March 2005
 
5
        copyright            : (C) 2005 by Radim Blazek
 
6
        email                : blazek@itc.it 
 
7
 ***************************************************************************/
 
8
/***************************************************************************
 
9
 *                                                                         *
 
10
 *   This program is free software; you can redistribute it and/or modify  *
 
11
 *   it under the terms of the GNU General Public License as published by  *
 
12
 *   the Free Software Foundation; either version 2 of the License, or     *
 
13
 *   (at your option) any later version.                                   *
 
14
 *                                                                         *
 
15
 ***************************************************************************/
 
16
#ifndef QGSMEASURE_H
 
17
#define QGSMEASURE_H
 
18
 
 
19
class QCloseEvent;
 
20
class QPainter;
 
21
class QPixmap;
 
22
 
 
23
class QgsMapCanvas;
 
24
 
 
25
#include <vector>
 
26
#include "qgspoint.h"
 
27
 
 
28
#ifdef WIN32
 
29
#include "qgsmeasurebase.h"
 
30
#else
 
31
#include "qgsmeasurebase.uic.h"
 
32
#endif
 
33
 
 
34
class QgsMeasure:public QgsMeasureBase
 
35
{
 
36
  Q_OBJECT;
 
37
  public:
 
38
 
 
39
  //! Constructor
 
40
  QgsMeasure(QgsMapCanvas *, QWidget *parent = 0, const char * name = 0, WFlags f = Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_Title | Qt::WStyle_Dialog | Qt::WStyle_Tool );
 
41
 
 
42
  ~QgsMeasure();
 
43
 
 
44
  //! Save position
 
45
  void saveWindowLocation(void);
 
46
 
 
47
  //! Restore last window position/size and show the window
 
48
  void restorePosition(void);
 
49
 
 
50
  //! Add new point
 
51
  void addPoint(QgsPoint &point);
 
52
  
 
53
  //! Mose move
 
54
  void mouseMove(QgsPoint &point);
 
55
 
 
56
public slots:
 
57
  //! Close
 
58
  void close ( void);
 
59
 
 
60
  //! Reset and start new
 
61
  void restart ( void);
 
62
 
 
63
  //! Close event
 
64
  void closeEvent(QCloseEvent *e);
 
65
 
 
66
  //! Connected to canvas renderComplete
 
67
  void draw(QPainter *); 
 
68
 
 
69
  //! Show the help for the dialog 
 
70
  void showHelp();
 
71
  
 
72
private:
 
73
  QgsMapCanvas *mMapCanvas;
 
74
 
 
75
  QPixmap *mPixmap;
 
76
 
 
77
  std::vector<QgsPoint> mPoints;
 
78
 
 
79
  double mTotal;
 
80
 
 
81
  //! Dynamic line from last point to current position was drawn
 
82
  bool mDynamic;
 
83
 
 
84
  //! Dynamic line
 
85
  QgsPoint mDynamicPoints[2];
 
86
 
 
87
  //! Draw current points with XOR
 
88
  void drawLine(void); 
 
89
  
 
90
  //! Draw current dynamic line
 
91
  void drawDynamicLine(void); 
 
92
 
 
93
  //! Help context id
 
94
  static const int context_id = 940759457;
 
95
};
 
96
 
 
97
#endif