-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathview.h
47 lines (38 loc) · 1.19 KB
/
view.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef VIEW_H
#define VIEW_H
#include "point.h"
#include <list>
#include <QtGui>
#include <QGraphicsView>
#include <iostream>
class View : public QGraphicsView
{
//Q_OBJECT
public:
View(QWidget *parent = 0);
~View();
private:
//QGraphicsScene* scene;
QString imageFile;
QImage image;
protected:
//Holds the current centerpoint for the view, used for panning and zooming
QPointF CurrentCenterPoint;
//From panning the view
QPoint LastPanPoint;
//Set the current centerpoint in the
void SetCenter(const QPointF& centerPoint);
QPointF GetCenter() { return CurrentCenterPoint; }
//Take over the interaction
/*virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void mouseMoveEvent(QMouseEvent* event);*/
virtual void wheelEvent(QWheelEvent* event);
virtual void resizeEvent(QResizeEvent* event);
virtual void drawBackground ( QPainter * painter, const QRectF & rect );
public:
//void setNumOfPoints2(int n){numOfPoints=n;}
void setImageFile(QString f){ imageFile=f; }
void setImage(QImage im){ image=im; }
};
#endif // VIEW_H