-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWTTreeVisualizer.h
More file actions
70 lines (56 loc) · 1.69 KB
/
WTTreeVisualizer.h
File metadata and controls
70 lines (56 loc) · 1.69 KB
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
60
61
62
63
64
65
66
67
68
69
70
/*
* header file for WTTreeVisualizer class
* Original by: christian moellinger <ch.moellinger@gmail.com>
* Modified by: Chung-Yeon Lee <cylee@bi.snu.ac.kr> and Beom-Jin Lee <bjlee@bi.snu.ac.kr>
* 03/2011 - 06/2011 Project "InfoVis: Word Tree"
* 11/2013 - 12/2013 Project "InfoVis: Word Tree ++"
*/
#ifndef WTTREEVISUALIZER_H
#define WTTREEVISUALIZER_H
#include <QObject>
#include <QSharedPointer>
#include <QGraphicsScene>
#include <QTimer>
#include "WTBackend.h"
#include "WTVisualizedTree.h"
/*! This class takes a WTVisualizedTree object and redraws it (on a graphics scene / view)
*/
class WTTreeVisualizer : public QObject
{
Q_OBJECT
public:
/*! \name Construction / Destruction */
//@{
/// Constructor
explicit WTTreeVisualizer(QObject *parent = 0);
/// Destructor
~WTTreeVisualizer();
//@}
/*! \name Public methods */
//@{
/// this method sets the graphics view where the output should be drawn
void SetGraphicsView(QGraphicsView *pGraphicsView);
/// this method draws a visualized tree on the output view
void VisualizeWordTree(QSharedPointer<WTVisualizedTree> spWordTree);
//@}
QString firstWord;
private slots:
void TimerStep();
private:
/*! \name Private methods */
//@{
/// renders a tree transition between two trees
void ItlDrawTreeTransition(QSharedPointer<WTVisualizedTree> spTree1,
QSharedPointer<WTVisualizedTree> spTree2,
float fAlpha);
//@}
/*! \name Private members */
//@{
QSharedPointer<WTVisualizedTree> m_spLastVisualizedWordTree;
QSharedPointer<WTVisualizedTree> m_spNewVisualizedWordTree;
QGraphicsView *m_pGraphicsView;
QTimer m_rTimer;
int m_iMillisecondsLeft;
//@}
};
#endif // WTTREEVISUALIZER_H