00001 #ifndef _HMMMODULEGUI_H
00002 #define _HMMMODULEGUI_H
00003
00004 #include "AbstractGtkmmModuleGUI.h"
00005 #include "../modules/HMMModule.h"
00006 #include <gtkmm/box.h>
00007 #include <gtkmm/button.h>
00008 #include <gtkmm/entry.h>
00009 #include <gtkmm/label.h>
00010 #include <gtkmm/liststore.h>
00011 #include <gtkmm/notebook.h>
00012 #include <gtkmm/scrolledwindow.h>
00013 #include <gtkmm/table.h>
00014 #include <gtkmm/togglebutton.h>
00015 #include <gtkmm/treeview.h>
00016 #include <gtkmm/treemodel.h>
00017 #include <gtkmm/filechooserdialog.h>
00018
00021 class HMMModuleGUI : public AbstractGtkmmModuleGUI
00022 {
00023 public:
00027 HMMModuleGUI(HMMModule *module);
00028
00032 virtual void init();
00036 virtual void destroy();
00037
00038 private:
00039
00040 void makeOverviewTab();
00041 void makeGestureTab();
00042 void makeAddGestureTab();
00043 void makeLoadSaveTab();
00044 void makeDialogs();
00045
00046
00047 void delGesture();
00048 void clearGestures();
00049 void toggleTraining();
00050 void addGesture();
00051 void loadFromFile();
00052 void saveToFile();
00053
00054 class GestureDataModel : public Gtk::TreeModel::ColumnRecord
00055 {
00056 public:
00057 GestureDataModel()
00058 { add(m_id); add(m_name); add(m_clusters); add(m_states); }
00059 Gtk::TreeModelColumn<int> m_id;
00060 Gtk::TreeModelColumn<Glib::ustring> m_name;
00061 Gtk::TreeModelColumn<int> m_clusters;
00062 Gtk::TreeModelColumn<int> m_states;
00063 };
00064
00065 class GestureTreeView : public Gtk::TreeView
00066 {
00067 public:
00068 GestureTreeView();
00069 bool hasItemSelected();
00070 int getSelectedGestureID();
00071 void delSelectedGesture();
00072 void clearList();
00073 void addRow(int id, Glib::ustring name, int clusters, int states);
00074 void addRow(Glib::ustring name, int clusters, int states);
00075
00076 const GestureDataModel &getModel() const
00077 { return m_gestureDataModel; }
00078 const Glib::RefPtr<Gtk::ListStore> &getRefPointer() const
00079 { return m_refGestureTreeModel; }
00080
00081 private:
00082 GestureDataModel m_gestureDataModel;
00083 Glib::RefPtr<Gtk::ListStore> m_refGestureTreeModel;
00084 };
00085
00086 Gtk::Notebook m_notebook;
00087
00088
00089 Gtk::VBox m_boxOverview;
00090 Gtk::Label m_lblCountGestures;
00091
00092
00093 Gtk::VBox m_boxGestures;
00094 Gtk::Table m_tblAddGesture;
00095 Gtk::Button m_btnAddGesture;
00096 Gtk::Entry m_entGestureName;
00097 Gtk::Label m_lblGestureName;
00098 Gtk::Entry m_entNClusters;
00099 Gtk::Label m_lblNClusters;
00100 Gtk::Entry m_entNStates;
00101 Gtk::Label m_lblNStates;
00102 Gtk::ScrolledWindow m_srwGestureListWindow;
00103 GestureTreeView m_trwGestureListView;
00104 Gtk::HBox m_boxDelTrainButtons;
00105 Gtk::Button m_btnDelGesture;
00106 Gtk::Button m_btnClearGestures;
00107 Gtk::ToggleButton m_tbtnTrain;
00108
00109
00110 Gtk::VBox m_boxLoadSave;
00111 Gtk::Button m_btnLoadFile;
00112 Gtk::Button m_btnSaveFile;
00113
00114 Gtk::FileChooserDialog m_dlgSave;
00115 Gtk::FileChooserDialog m_dlgLoad;
00116
00117 };
00118
00119 #endif