Vessel-Tree 2D Visualisation
 All Classes Functions Variables
mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 #include "myXmlStreamReader.h"
6 
7 class QAction;
8 class FindDialog;
9 class MyGLFrame;
10 
11 namespace Ui {
12  class MainWindow;
13 }
14 
15 // We define the class MainWindow as a subclass of QMainWindow. It contains the Q_OBJECT
16 // macro since it provides its own signals and slots.
17 class MainWindow : public QMainWindow , public DataStructure
18 {
19  Q_OBJECT // The Q_OBJECT macro at the beginning of the class definition is necessary
20  // for all classes that define signals or slots.
21 
22 public:
23  explicit MainWindow(QWidget *parent = 0);
24  // The MainWindow constructor is typical of Qt widget classes. The parent parameter
25  // specifies the parent widget. The default is a null pointer, meaning that the
26  // dialog has no parent.
27 
28  ~MainWindow();
29 
33  struct Vessel {
34  int id;
35  QList<Segment> *segments;
36  QList<Vessel> *branches;
37  int startPoint;
38  float maxCircumference;
39  };
40 
41  static Vessel v;
45  static QList<Vessel> vList;
46  static int maxVeinWidth;
47  int maxVeinWidth_cur;
48  int ID;
49  float Circumference;
50  int testSegmentCount;
51 
57 
66  Vessel createVessel(Segment start, MyXmlStreamReader &MyReader, int startAt, float Circumference);
67 
74  QList<Segment> getSegmentsBegin(int beginID, MyXmlStreamReader &MyReader);
75 
82  void printVessel(Vessel v, QTextStream &cout, QString s);
83 
90 
91 
92 //protected:
93  /*The closeEvent() function is a virtual function in QWidget that is automatically called
94  *when the user closes the window. It is reimplemented in MainWindow so that we can ask
95  *the user the standard question "Do you want to save your changes?" and to save user
96  *preferences to disk.
97  */
98  // void closeEvent(QCloseEvent *event);
99 
100 private:
101 
102  Ui::MainWindow *ui;
103  MyGLFrame *GLFrame;
104 
105  void init();
106  void createMenus();
107  void createActions();
108  bool okToContinue();
109  bool loadFile(const QString &fileName);
110 
111  QAction *openAction;
112  QAction *exitAction;
113  QAction *helpAction;
114  QAction *aboutQtAction;
115 
116  QMenu *fileMenu;
117  QMenu *helpMenu;
118 
119  // The slots/signals keyword is actually a macro. The C++ preprocessor converts
120  // it into standard C++ before the compiler sees it.
121 
122 private slots:
126  void parseXML();
127  //void about();
128 };
129 
130 #endif // MAINWINDOW_H