aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.h
blob: 33f647fe69ef5039aaf27f5232d6873a979e6304 (plain) (blame)
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
#ifndef DIVEPLANNER_H
#define DIVEPLANNER_H

#include <QGraphicsView>
#include <QGraphicsPathItem>

class DiveHandler : public QGraphicsEllipseItem{
public:
    DiveHandler();

	QGraphicsLineItem *from;
	QGraphicsLineItem *to;
};
class DivePlanner : public QGraphicsView {
	Q_OBJECT
public:
	static DivePlanner *instance();
protected:
    virtual void mouseDoubleClickEvent(QMouseEvent* event);
    virtual void showEvent(QShowEvent* event);
    virtual void resizeEvent(QResizeEvent* event);
    virtual void mouseMoveEvent(QMouseEvent* event);
    void clear_generated_deco();
	void create_deco_stop();
	bool isPointOutOfBoundaries(QPointF point);

private:
    DivePlanner(QWidget* parent = 0);
	QList<QGraphicsLineItem*> lines;
	QList<DiveHandler *> handles;
	QGraphicsLineItem *verticalLine;
	QGraphicsLineItem *horizontalLine;
};
#endif