-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
54 lines (43 loc) · 1.16 KB
/
mainwindow.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 MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "RedBlackTree.h"
#include "SplayTree.h"
#include "AVLTree.h"
#include "Vertex.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
template<class T> void presketch(T *p);
void copyTree(Node *p, Tree *targetTree);
void toAnother(Tree *targetTree);
QPair<int, int> sketch(AVLNode *p, int h, int y);
QPair<int, int> sketch(RBNode *p, int h, int y);
QPair<int, int> sketch(SNode *p, int h, int y);
int v(int x);
private slots:
void on_btn_add_clicked();
void on_btn_del_clicked();
void on_btn_z_plus_clicked();
void on_btn_z_minus_clicked();
void on_rbtn_AVL_clicked();
void on_rbtn_RB_clicked();
void on_rbtn_S_clicked();
void on_btnClear_clicked();
void on_btnTest_clicked();
private:
//constants
const int R = 25;
const int TestSize = 100;
const int TestDelay = 25; //ms
int RightEnd = 0;
Ui::MainWindow *ui;
QGraphicsScene *Scene;
Tree *tree;
};
#endif // MAINWINDOW_H