+
+/**
+** Begin of the mirror panel
+**/
+
+interfMirrorPanel::interfMirrorPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ wxButton *mirrorGoBtn = new wxButton(this,-1,_T("Go"), wxDefaultPosition, wxSize(200,35) );
+ _thickness = new wxSlider(this, -1, 4, 1, 10, wxDefaultPosition, wxSize(200,35), wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator);
+
+ Connect( mirrorGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfMirrorPanel::onMirrorGo );
+
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ sizer -> Add( new wxStaticText(this,-1,_T("Thickness")) , 1, wxGROW );
+ sizer -> Add( _thickness, 1, wxGROW );
+ sizer -> Add( mirrorGoBtn, 1, wxGROW );
+
+ this->SetSizer( sizer );
+ this->SetAutoLayout( true );
+ this->Layout();
+}
+
+interfMirrorPanel::~interfMirrorPanel(){
+}
+
+void interfMirrorPanel::onMirrorGo(wxCommandEvent& event)
+{
+ interfMainPanel::getInstance()->onMirror();
+}
+
+void interfMirrorPanel::onChangeWidth(wxScrollEvent& event)
+{
+ int width = _thickness->GetValue();
+ interfMainPanel::getInstance()->onMirrorChangeWidth(width);
+}
+
+
+
+/**
+** Begin of the threshold panel
+**/
+interfThresholdPanel::interfThresholdPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ wxButton *thresholdGoBtn = new wxButton(this,-1,_T("Threshold Go"), wxDefaultPosition, wxSize(200,30) );
+
+ _thresholdGo = false;
+
+ double range[2];
+ interfMainPanel::getInstance()->getImageRange(range);
+
+ _mBarThreshold = new mBarRange(this,70,65);
+ _mBarThreshold->SetMin(0);
+ _mBarThreshold->SetStart(0);
+ _mBarThreshold-> SetOrientation( true );
+ _mBarThreshold-> setActiveStateTo(true);
+ _mBarThreshold-> setVisibleLabels( true );
+ _mBarThreshold-> setDeviceEndMargin(10);
+ _mBarThreshold-> setRepresentedValues( range[0] , range[1] );
+ _mBarThreshold-> setDeviceBlitStart(10,10);
+ _mBarThreshold-> setIfWithActualDrawed( false );
+ _mBarThreshold-> SetStart( range[0] );
+ _mBarThreshold-> SetEnd( range[1] );
+
+ Connect( thresholdGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfThresholdPanel::onThresholdGo );
+
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ sizer -> Add( _mBarThreshold, 1, wxGROW );
+ sizer -> Add( thresholdGoBtn, 1, wxGROW );
+ sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
+ sizer -> Add( new wxStaticText(this,-1,_T(" ")) , 1, wxGROW );
+ //sizer -> Add( new wxStaticText(this,-1,_T("Select the image's range to superpose a Fake Color")) , 1, wxGROW );
+
+
+ this->SetSizer( sizer );
+ this->SetAutoLayout( true );
+ this->Layout();
+}
+
+interfThresholdPanel::~interfThresholdPanel(){
+}
+
+
+
+void interfThresholdPanel::onThresholdChange(wxCommandEvent& event)
+{
+ if (_thresholdGo)
+ {
+ int minVal = _mBarThreshold->GetStart();
+ int maxVal = _mBarThreshold->GetEnd();
+
+ interfMainPanel::getInstance()->onThreshold(minVal, maxVal);
+
+ std::cout<< "Valor Min: " << minVal << " & Valor Max: " << maxVal << std::endl;
+ }
+}
+
+void interfThresholdPanel::onThresholdGo(wxCommandEvent& event)
+{
+ if (!_thresholdGo)
+ {
+ int minVal = _mBarThreshold->GetStart();
+ int maxVal = _mBarThreshold->GetEnd();
+
+ interfMainPanel::getInstance()->onThreshold(minVal, maxVal);
+ _thresholdGo=true;
+ }
+}
+
+void interfThresholdPanel::onThresholdStop()
+{
+ _thresholdGo=false;
+}
+
+
+BEGIN_EVENT_TABLE(interfMirrorPanel, wxPanel)
+ EVT_SCROLL(interfMirrorPanel :: onChangeWidth)
+END_EVENT_TABLE()
+
+BEGIN_EVENT_TABLE(interfThresholdPanel, wxPanel)
+ EVT_COMMAND(wxID_ANY, wxEVT_TSBAR_START, interfThresholdPanel :: onThresholdChange)
+ EVT_COMMAND(wxID_ANY, wxEVT_TSBAR_END, interfThresholdPanel :: onThresholdChange)
+ EVT_COMMAND(wxID_ANY, wxEVT_TSBAR_MOVED, interfThresholdPanel :: onThresholdChange)
+END_EVENT_TABLE()
+
+