-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscene.h
49 lines (44 loc) · 1.37 KB
/
scene.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
48
49
#ifndef SCENE_H
#define SCENE_H
#include "point.h"
#include <list>
#include <QtGui>
#include <iostream>
//#include "/media/Khue/Dev. Software/C++libraries/boost/boost/utility.hpp"
#include <boost/utility.hpp>
#include <boost/fusion/iterator/prior.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/include/prior.hpp>
#include <boost/fusion/include/next.hpp>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
typedef std::list<Point> PointList;
class Scene : public QGraphicsScene
{
Q_OBJECT
public:
Scene(QObject *parent = 0);
~Scene();
private:
//QGraphicsScene* scene;
int numOfPoints;
Point first;
Point last;
PointList points;
bool mouseInteraction;
private slots:
void mouseMoveEvent(QGraphicsSceneMouseEvent * e);
void mousePressEvent(QGraphicsSceneMouseEvent * e);
void mouseReleaseEvent(QGraphicsSceneMouseEvent* e);
public:
void setNumOfPoints(int n){ numOfPoints = n; }
void enableMouseIteration(bool b){ mouseInteraction = b ;}
void draw(PointList points, QPen pen);
void drawLine(PointList points);
void drawLineWithSP(PointList points);
//void drawLine(PointList points, bool displayIndex);
void drawLine(PointList points,QColor color);
inline PointList getPoints(){ return points; }
inline void setPoints(PointList l){ points = l; }
};
#endif // SCENE_H