00001 #include "DirectionFilterGUI.h"
00002
00003 DirectionFilterGUI::DirectionFilterGUI(DirectionFilter *module) :
00004 AbstractGtkmmModuleGUI(module, "Direction Filter"),
00005 m_graph(200, 5, 60),
00006 m_spinnerBox(false, 5),
00007 m_box(false, 0),
00008 m_lblThreshold("Threshold: "),
00009 m_adjThreshold(0.0, 0.0, 2.0, .01, .1, 0.0),
00010 m_spbThreshold(m_adjThreshold, 0.0, 2)
00011 {
00012 m_spbThreshold.signal_value_changed().connect(sigc::mem_fun(*this, &DirectionFilterGUI::setThreshold));
00013
00014 m_spinnerBox.pack_start(m_lblThreshold, Gtk::PACK_SHRINK, 0);
00015 m_spinnerBox.pack_start(m_spbThreshold, Gtk::PACK_SHRINK, 0);
00016
00017 m_box.pack_start(m_spinnerBox, Gtk::PACK_SHRINK, 0);
00018 m_box.pack_start(m_graph, Gtk::PACK_SHRINK, 0);
00019
00020 add(m_box);
00021 }
00022
00023 void DirectionFilterGUI::init()
00024 {
00025 m_spbThreshold.set_value(static_cast<DirectionFilter*>(getModule())->getThreshold());
00026 show_all();
00027 }
00028
00029 void DirectionFilterGUI::destroy()
00030 {
00031 hide_all();
00032 }
00033
00034 void DirectionFilterGUI::addData(const Vector3d &v)
00035 {
00036 m_graph.addData(v);
00037 }
00038
00039 void DirectionFilterGUI::setThreshold()
00040 {
00041 static_cast<DirectionFilter*>(getModule())->setThreshold(m_spbThreshold.get_value());
00042 }