WordTree
|
00001 /* 00002 * header file for WTTreeVisualizer class 00003 * written by: christian moellinger <ch.moellinger@gmail.com> 00004 * 03/2011 - 06/2011 Project "InfoVis: Word Tree" 00005 */ 00006 00007 #ifndef WTTREEVISUALIZER_H 00008 #define WTTREEVISUALIZER_H 00009 00010 #include <QObject> 00011 #include <QSharedPointer> 00012 #include <QGraphicsScene> 00013 #include <QTimer> 00014 #include "WTBackend.h" 00015 #include "WTVisualizedTree.h" 00016 00017 /*! This class takes a WTVisualizedTree object and redraws it (on a graphics scene / view) 00018 */ 00019 class WTTreeVisualizer : public QObject 00020 { 00021 Q_OBJECT 00022 public: 00023 /*! \name Construction / Destruction */ 00024 //@{ 00025 /// Constructor 00026 explicit WTTreeVisualizer(QObject *parent = 0); 00027 00028 /// Destructor 00029 ~WTTreeVisualizer(); 00030 //@} 00031 00032 00033 /*! \name Public methods */ 00034 //@{ 00035 /// this method sets the graphics view where the output should be drawn 00036 void SetGraphicsView(QGraphicsView *pGraphicsView); 00037 00038 /// this method draws a visualized tree on the output view 00039 void VisualizeWordTree(QSharedPointer<WTVisualizedTree> spWordTree); 00040 //@} 00041 private slots: 00042 void TimerStep(); 00043 00044 private: 00045 /*! \name Private methods */ 00046 //@{ 00047 /// renders a tree transition between two trees 00048 void ItlDrawTreeTransition(QSharedPointer<WTVisualizedTree> spTree1, 00049 QSharedPointer<WTVisualizedTree> spTree2, 00050 float fAlpha); 00051 //@} 00052 00053 /*! \name Private members */ 00054 //@{ 00055 QSharedPointer<WTVisualizedTree> m_spLastVisualizedWordTree; 00056 QSharedPointer<WTVisualizedTree> m_spNewVisualizedWordTree; 00057 QGraphicsView *m_pGraphicsView; 00058 QTimer m_rTimer; 00059 00060 int m_iMillisecondsLeft; 00061 //@} 00062 00063 }; 00064 00065 #endif // WTTREEVISUALIZER_H