-
Notifications
You must be signed in to change notification settings - Fork 0
/
fibheapwidget.h
54 lines (41 loc) · 1015 Bytes
/
fibheapwidget.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
50
51
52
53
54
#ifndef FIBHEAPWIDGET_H
#define FIBHEAPWIDGET_H
//#include <QtGui/QGraphicsView>
#include <QGraphicsView>
#include "fibheapgraphics.h"
class FibHeapWidget : public QGraphicsView
{
Q_OBJECT
public:
FibHeapWidget(QWidget *parent = 0);
bool blockComponents();
void nextStep();
void insertNode(int key);
void ExportHeap();
void ImportHeap();
void switchHeap();
void extractMin();
void decreaseKey(int key);
void deleteNode();
void unionOperation();
void clearSelected();
void reset();
public slots:
void zoomIn();
void zoomOut();
protected:
void keyPressEvent(QKeyEvent *event);
void wheelEvent(QWheelEvent *event);
void scaleView(qreal scaleFactor);
private:
void updateMin();
void deSelect();
FibHeapGraphics *selectedHeap;
FibHeapGraphics *firstFibHeap;
FibHeapGraphics *secondFibHeap;
QPointF firstRefPoint;
QPointF secondRefPoint;
bool isDelete;
bool isFirst;
};
#endif // FIBHEAPWIDGET_H