-
Notifications
You must be signed in to change notification settings - Fork 0
/
fibheapgraphics.h
59 lines (46 loc) · 1.46 KB
/
fibheapgraphics.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
55
56
57
58
59
#ifndef FIBHEAPGRAPHICS_H
#define FIBHEAPGRAPHICS_H
#include "fibheapbasetemplate.h"
#include "graphicsfibnode.h"
#include "graphicsfibedge.h"
class FibHeapGraphics : public FibHeapBase<GraphicsFibNode>
{
public:
FibHeapGraphics();
~FibHeapGraphics();
void Insert(int key, QGraphicsScene *scene);
GraphicsFibNode *ExtractMin();
FibHeapGraphics *Union(FibHeapGraphics *H2);
void DecreaseKey(GraphicsFibNode *x, int k);
void ImportHeap(QString &fileName, QGraphicsScene *scene);
void setStates();
void clear();
void animate(int timemil);
void animateInsert();
void setFirstPositions();
void saveCurrentPositions();
void clearPositions();
bool blockComponents();
bool oneStatesLeft();
bool decreaseKeyTmpNode() const;
QPointF referencePoint;
QList<GraphicsFibEdge *> edges() const;
QList<GraphicsFibNode *> nodes() const;
private:
QList<GraphicsFibEdge *> Edges;
QList<GraphicsFibNode *> Nodes;
void importNodes(GraphicsFibNode *node, QGraphicsScene *scene);
void unlinkEdges();
void linkEdges();
void linkEdgesNew(QGraphicsScene *scene);
void updateEdges();
bool isRoot(const GraphicsFibNode *node);
bool isRoot(int y);
//decrease key graphics
void DecreaseKeyGraphics(GraphicsFibNode *x, int k);
GraphicsFibNode *decreaseKeyTempNode;
//19.3
void Cut(GraphicsFibNode *x);
void CascadingCut(GraphicsFibNode *y);
};
#endif // FIBHEAPGRAPHICS_H