00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MAINWINDOW_H_
00009 #define MAINWINDOW_H_
00010
00011 #include <QtGui/QtGui>
00012 #include <boost/shared_ptr.hpp>
00013 #include "segmentationdialog.h"
00014 #include "../lib/mesh/mesh_sequence.h"
00015 #include "../lib/mesh/object.h"
00016
00017
00018 namespace ViewerNS {
00019
00020 class GLViewer;
00021 class SegmentViewer;
00022 class SegmentationTree;
00023 }
00024
00030 class MainWindow: public QMainWindow {
00031
00032 Q_OBJECT
00033 typedef MeshNS::SimpleFace SimpleFace;
00034 typedef MeshNS::SimpleVertex SimpleVertex;
00035 typedef ParserNS::Parser<SimpleVertex, SimpleFace> Parser;
00036
00037 public:
00038 MainWindow(QWidget *parent = 0);
00039 virtual ~MainWindow();
00040
00041 private slots:
00042 void treeItemChanged(QTreeWidgetItem * current, QTreeWidgetItem * previous);
00043 void toggleSmoothGLViewer();
00044 void toggleSmoothSegViewer();
00045 void fileSave();
00046 void fileOpen();
00047 void invertNormal();
00048 void addRootSegmentation(QTreeWidgetItem* item = NULL);
00049 void addCurrentSegmentation(QTreeWidgetItem* item = NULL);
00050 void about();
00051 void addSegmentationToTree(const ViewerNS::SegmentationDialog& sd,
00052 QTreeWidgetItem* root);
00053 void setLogInfo();
00054 void setLogLow();
00055 void setLogHigh();
00056 void setLogCritic();
00057 void addLog();
00058 void configLog();
00059
00060 private:
00061
00062 void createMenu();
00063 void createAction();
00064 void createConnection();
00065 void createStatusBar();
00066 void createToolBar();
00067
00068 QToolBar *toolBar;
00069
00070 ViewerNS::GLViewer *_viewer;
00071 ViewerNS::SegmentViewer *_segViewer;
00072 QPushButton* _play;
00073 QPushButton *_snapshot;
00074 QPushButton *_save;
00075 QPushButton *_smooth;
00076 QPushButton *_invert;
00077 QPushButton *_addToRoot;
00078 QPushButton *_addToCurrent;
00079 QPushButton *_load;
00080 QPushButton *_help;
00081 QPushButton *_swapVisibleViewer;
00082 MeshNS::MeshSequencePtr _mesh;
00083 ViewerNS::SegmentationTree *_tree;
00084 QTreeWidgetItem* _currentItem;
00085 void _createWidget();
00086 void _setConnection();
00087 };
00088
00089 #endif