source: ntrip/trunk/BNC/bncmapview.h@ 3385

Last change on this file since 3385 was 3291, checked in by weber, 14 years ago

Scaling site distribution map from caster sourcetable contents

File size: 1.1 KB
Line 
1
2#ifndef BNCMAPVIEW_H
3#define BNCMAPVIEW_H
4
5#include <QGraphicsView>
6#include <QGraphicsRectItem>
7#include <iostream>
8
9class BncMapView : public QGraphicsView
10{
11 Q_OBJECT;
12
13 public:
14 BncMapView(QWidget* parent = NULL);
15
16 virtual void resetScale();
17 virtual void zoom(qreal scale);
18
19 double scale(){ return _scale; }
20 double scale_curr(){ return _scCur; }
21 double scale_rate(){ return _scale/_scCur; }
22
23
24 protected:
25 QPointF _currentCenterPoint; // centerpoint for for panning and zooming
26 QPoint _lastPanPoint; // from panning the view
27 void SetCenter(const QPointF& centerPoint); // set the current centerpoint in the
28
29 QPointF GetCenter(){ return _currentCenterPoint; }
30
31 virtual void mousePressEvent(QMouseEvent* event);
32 virtual void mouseReleaseEvent(QMouseEvent* event);
33 virtual void mouseMoveEvent(QMouseEvent* event);
34 virtual void wheelEvent(QWheelEvent* event);
35 virtual void resizeEvent(QResizeEvent* event);
36
37 private:
38 double _scale; // scale
39 double _scCur; // current relative scale
40};
41
42#endif
Note: See TracBrowser for help on using the repository browser.