00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __VIEWER_H__
00024 #define __VIEWER_H__
00025
00026 #include <QtGui/QtGui>
00027 #include <boost/shared_ptr.hpp>
00028 #include "segmentationdialog.h"
00029
00030 #include "../lib/mesh/mesh_sequence.h"
00031 #include "../lib/mesh/object.h"
00032
00033
00034 namespace ViewerNS {
00035
00036 class GLViewer;
00037 class SegmentViewer;
00038 class SegmentationTree;
00039
00044 class Viewer: public QWidget {
00045
00046 typedef MeshNS::SimpleFace SimpleFace;
00047 typedef MeshNS::SimpleVertex SimpleVertex;
00048 typedef ParserNS::Parser<SimpleVertex, SimpleFace> Parser;
00049
00050 Q_OBJECT
00051
00052 public:
00053 Viewer(QWidget* parent= 0);
00054
00055 public slots:
00056 void treeItemChanged(QTreeWidgetItem * current,
00057 QTreeWidgetItem * previous);
00058 void toggleAnimation();
00059 void swapSnapshot();
00060 void fileSaved();
00061
00062 private slots:
00063 void _fileChanged();
00064 void invertNormal();
00065 void addRootSegmentation(QTreeWidgetItem* item= NULL);
00066 void addCurrentSegmentation(QTreeWidgetItem* item= NULL);
00067 void swapViewer();
00068 void addSegmentationToTree(const SegmentationDialog& sd, QTreeWidgetItem* root);
00069
00070 private:
00071 GLViewer *_viewer;
00072 SegmentViewer *_segViewer;
00073 QPushButton* _play;
00074 QPushButton *_snapshot;
00075 QPushButton *_save;
00076 QPushButton *_smooth;
00077 QPushButton *_invert;
00078 QPushButton *_addToRoot;
00079 QPushButton *_addToCurrent;
00080 QPushButton *_load;
00081 QPushButton *_help;
00082 QPushButton *_swapVisibleViewer;
00083 MeshNS::MeshSequencePtr _mesh;
00084 SegmentationTree *_tree;
00085 QTreeWidgetItem* _currentItem;
00086 void _createWidget();
00087 void _setConnection();
00088 };
00089 }
00090
00091 #endif