X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_Icons_NDimensions%2FinterfToolsPanels.cxx;h=671047dda4d1abd67e819701e4e58df8bb692e59;hb=c86e56d7883a16ec6734f64b61b3d87e49527a43;hp=f5f787192061b92bb8ea37e039be997d0e0c5802;hpb=3e974430e1298c1086c64260db838023d8a72744;p=creaContours.git diff --git a/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx b/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx index f5f7871..671047d 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx +++ b/lib/Interface_Icons_NDimensions/interfToolsPanels.cxx @@ -1,3 +1,28 @@ +/*# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ */ + #include "interfToolsPanels.h" #include "interfMainPanel.h" @@ -26,9 +51,25 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent) _brithtnessWindowLevel = new wxSlider(this, -1, windowlevel , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); _brithtnessColorLevel = new wxSlider(this, -1, colorwindow , min, max, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); - _interpolationCheckBox = new wxCheckBox(this, -1, _T("Image interpolation") ); + _interpolationCheckBox = new wxCheckBox(this, -1, _T("Interpolation") ); _interpolationCheckBox->SetValue(true); + _showTextContourCheckBox = new wxCheckBox(this, -1, _T("Labels") ); + _showTextContourCheckBox->SetValue(true); + + _beforContourCheckBox = new wxCheckBox(this, -1, _T("Befor Contour") ); + _beforContourCheckBox->SetValue(false); + + _afterContourCheckBox = new wxCheckBox(this, -1, _T("After Contour") ); + _afterContourCheckBox->SetValue(false); + + wxButton *jumpBackwareSlice = new wxButton(this,-1,_T("-"),wxDefaultPosition, wxDefaultSize); + wxButton *jumpFordwareSlice = new wxButton(this,-1,_T("+"),wxDefaultPosition, wxDefaultSize); + _jumpSpinCtrl = new wxSpinCtrl(this,-1,wxString("10") ); + _jumpSpinCtrl->SetRange(1,100); + _shiftSpinCtrl = new wxSpinCtrl(this,-1,wxString("0") ); + _shiftSpinCtrl->SetRange(0,99); + Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour); Connect( _withOfContourLine->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onWidthOfContour); @@ -37,20 +78,44 @@ interfConfigurationPanel::interfConfigurationPanel(wxWindow * parent) Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_CHANGED, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); Connect( _brithtnessColorLevel->GetId() , wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) &interfConfigurationPanel::onBrigthnessColorWindowLevel); Connect( _interpolationCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnInterpolation); - - wxFlexGridSizer * sizer = new wxFlexGridSizer(1); - sizer -> Add( new wxStaticText(this,-1, _T("Contour width")) , 1, wxGROW ); - sizer -> Add( _withOfContourLine , 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("Brightness of the image")) , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T("--Window level--")) , 1, wxGROW ); - sizer -> Add( _brithtnessWindowLevel , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T("--Color level--")) , 1, wxGROW ); - sizer -> Add( _brithtnessColorLevel, 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); - sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); - sizer -> Add( _interpolationCheckBox , 1, wxGROW ); + Connect( _showTextContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnShowTextContour); + Connect( _beforContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour); + Connect( _afterContourCheckBox->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &interfConfigurationPanel::OnBeforAfterContour); + Connect( jumpBackwareSlice->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfConfigurationPanel::OnBackwareSlice ); + Connect( jumpFordwareSlice->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfConfigurationPanel::OnFordwareSlice ); + + + wxFlexGridSizer * sizerA = new wxFlexGridSizer(1); + sizerA -> Add( new wxStaticText(this,-1, _T("Contour width")) , 1, wxGROW ); + sizerA -> Add( _withOfContourLine , 1, wxGROW ); + sizerA -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); + sizerA -> Add( new wxStaticText(this,-1, _T("Window level")) , 1, wxGROW ); + sizerA -> Add( _brithtnessWindowLevel , 1, wxGROW ); + sizerA -> Add( new wxStaticText(this,-1, _T("Color level")) , 1, wxGROW ); + sizerA -> Add( _brithtnessColorLevel , 1, wxGROW ); + sizerA -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); + + wxFlexGridSizer * sizerB1 = new wxFlexGridSizer(2); + sizerB1-> Add( jumpBackwareSlice , 1, wxGROW ); + sizerB1 -> Add( jumpFordwareSlice , 1, wxGROW ); + + wxFlexGridSizer * sizerB = new wxFlexGridSizer(1); + sizerB -> Add( _interpolationCheckBox , 1, wxGROW ); + sizerB -> Add( new wxStaticText(this ,-1, _T(" ")) , 1, wxGROW ); + sizerB -> Add( _showTextContourCheckBox , 1, wxGROW ); + sizerB -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); + sizerB -> Add( _beforContourCheckBox , 1, wxGROW ); + sizerB -> Add( _afterContourCheckBox , 1, wxGROW ); + sizerB -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); + sizerB -> Add( sizerB1 , 1, wxGROW ); + sizerB -> Add( _jumpSpinCtrl , 1, wxGROW ); + sizerB -> Add( _shiftSpinCtrl , 1, wxGROW ); + + + wxFlexGridSizer * sizer = new wxFlexGridSizer(3); + sizer -> Add( sizerA , 1, wxGROW ); + sizer -> Add( new wxStaticText(this,-1, _T(" ")) , 1, wxGROW ); + sizer -> Add( sizerB , 1, wxGROW ); this->SetSizer( sizer ); //JCP 13-10-08 @@ -66,8 +131,8 @@ interfConfigurationPanel::~interfConfigurationPanel() { } -void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){ - +void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event) +{ double width = (double)_withOfContourLine->GetValue() / 2.0; interfMainPanel::getInstance()->onWidthOfContour(width); } @@ -75,19 +140,35 @@ void interfConfigurationPanel::onWidthOfContour(wxScrollEvent& event){ void interfConfigurationPanel::onBrigthnessColorWindowLevel(wxScrollEvent& event){ int colorwindow = _brithtnessColorLevel->GetValue(); int windowlevel = _brithtnessWindowLevel->GetValue(); - interfMainPanel::getInstance()->onBrigthnessColorWindowLevel(colorwindow, windowlevel); - } void interfConfigurationPanel::OnInterpolation(wxCommandEvent& event) { - interfMainPanel::getInstance()->onInterpolation(_interpolationCheckBox->GetValue()); +} + +void interfConfigurationPanel::OnBeforAfterContour(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onBeforAfterContour(_beforContourCheckBox->GetValue() , _afterContourCheckBox->GetValue() ); +} +void interfConfigurationPanel::OnShowTextContour(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onShowTextContour(_showTextContourCheckBox->GetValue() ); +} +void interfConfigurationPanel::OnBackwareSlice(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onJumpSlice( -_jumpSpinCtrl->GetValue(), _shiftSpinCtrl->GetValue() ); } +void interfConfigurationPanel::OnFordwareSlice(wxCommandEvent& event) +{ + interfMainPanel::getInstance()->onJumpSlice( _jumpSpinCtrl->GetValue(), _shiftSpinCtrl->GetValue() ); +} + + /** ** Begin of the spread panel **/ @@ -103,7 +184,8 @@ interfSpreadPanel::interfSpreadPanel(wxWindow* parent) //wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString("",wxConvUTF8)); wxButton *spreadResetBtn = new wxButton(this,-1,_T("Reset"),wxDefaultPosition, wxDefaultSize ); - wxButton *spreadAddBtn = new wxButton(this,-1,_T("Add"),wxDefaultPosition, wxDefaultSize); + wxButton *spreadAddBtn = new wxButton(this,-1,_T("Add key contour "),wxDefaultPosition, wxDefaultSize); + wxButton *spreadAddAllBtn = new wxButton(this,-1,_T("Add All to key contour"),wxDefaultPosition, wxDefaultSize); wxString lstOptions[3]; lstOptions[0]=_T("A"); @@ -120,11 +202,13 @@ interfSpreadPanel::interfSpreadPanel(wxWindow* parent) Connect( spreadResetBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadReset ); Connect( spreadAddBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAdd ); + Connect( spreadAddAllBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAddAll ); Connect( spreadGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadGo ); wxFlexGridSizer * sizer = new wxFlexGridSizer(1); sizer -> Add( spreadResetBtn , 1, wxGROW ); sizer -> Add( spreadAddBtn , 1, wxGROW ); + sizer -> Add( spreadAddAllBtn , 1, wxGROW ); sizer -> Add( _spreadMethodRadiobox , 1, wxGROW ); sizer -> Add( spreadGoBtn , 1, wxGROW ); sizer -> Add( _staticTextSpread , 1, wxGROW ); @@ -146,12 +230,16 @@ void interfSpreadPanel::onSpreadReset(wxCommandEvent& event){ _wxtextctrlSpread->SetValue(wxString("",wxConvUTF8)); interfMainPanel::getInstance()->resetAppend(); } + void interfSpreadPanel::onSpreadAdd(wxCommandEvent& event){ interfMainPanel::getInstance()->onSpreadAdd(); } -void interfSpreadPanel::onSpreadGo(wxCommandEvent& event){ +void interfSpreadPanel::onSpreadAddAll(wxCommandEvent& event){ + interfMainPanel::getInstance()->onSpreadAddAll(); +} +void interfSpreadPanel::onSpreadGo(wxCommandEvent& event){ setStringSpread(" "); int typeMethodFindCtrlPoints=_spreadMethodRadiobox->GetSelection(); printf("EED interfSpreadPanel::onSpreadGo %d\n",typeMethodFindCtrlPoints); @@ -163,7 +251,15 @@ void interfSpreadPanel::appendStringSpread(std::string val){ /* // if */ wxString newstring; //newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice ); + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8)); +#else + newstring.append( _wxtextctrlSpread->GetValue() ); +#endif + + newstring.append(wxString(" ",wxConvUTF8)); newstring.append(wxString(val.c_str(),wxConvUTF8)); _wxtextctrlSpread->SetValue(newstring); @@ -181,8 +277,10 @@ void interfSpreadPanel::setStringSpread(std::string stringtemp){ ** Begin of information panel **/ interfInformationPanel::interfInformationPanel(wxWindow * parent) -: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN) +//: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN) +: wxPanel(parent, -1) { +printf("EED interfInformationPanel::interfInformationPanel Start\n"); //wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxTAB_TRAVERSAL); wxString lstOptions[4]; lstOptions[0]=_T("Current Slice"); @@ -190,7 +288,6 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent) // lstOptions[2]=_T("All Slices"); _informationRadiobox = new wxRadioBox(this, -1, _T("Slice analysis"), wxDefaultPosition, wxSize(270,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS); - wxString lstOptContOperation[5]; lstOptContOperation[0]=_T("AND"); lstOptContOperation[1]=_T("OR"); @@ -200,53 +297,73 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent) _radiolstboxContourGroup->SetSelection(1); Connect( _radiolstboxContourGroup->GetId(), wxEVT_COMMAND_RADIOBOX_SELECTED , (wxObjectEventFunction) &interfInformationPanel::onContourGroup ); +printf("EED interfInformationPanel::interfInformationPanel 1\n"); - _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") ); - _XYZValues->SetValue(true); - _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") ); + _XYZValues = new wxCheckBox(this, -1, _T("Save Contour Values") ); + _XYZValues->SetValue(true); + _contourImage = new wxCheckBox(this, -1, _T("Extract Contours as Images") ); _contourImage->SetValue(true); - - _statistics = new wxCheckBox(this, -1, _T("Save Statistics") ); + _statistics = new wxCheckBox(this, -1, _T("Save Statistics") ); _statistics->SetValue(true); + wxButton *informationContourLabelsBtn = new wxButton(this,-1,_T("Contour labels"),wxDefaultPosition, wxSize(140,35) ); +#if wxMAJOR_VERSION <= 2 informationContourLabelsBtn->SetEventHandler( this ); +#else + // informationContourLabelsBtn->SetEventHandler( this ); + printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo informationContourLabelsBtn->SetEventHandler \n"); +#endif Connect( informationContourLabelsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onInformationContourLabels ); wxButton *statisticsContourBtn = new wxButton(this,-1,_T("Contour statistics"),wxDefaultPosition, wxSize(140,35) ); +#if wxMAJOR_VERSION <= 2 statisticsContourBtn->SetEventHandler( this ); +#else + //statisticsContourBtn->SetEventHandler( this ); + printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo statisticsContourBtn->SetEventHandler \n"); +#endif Connect( statisticsContourBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onExtractInformation ); wxButton *showResultImagesBtn = new wxButton(this,-1,_T("Show result images"),wxDefaultPosition, wxSize(140,35) ); +#if wxMAJOR_VERSION <= 2 showResultImagesBtn->SetEventHandler( this ); +#else + //showResultImagesBtn->SetEventHandler( this ); + printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo showResultImagesBtn->SetEventHandler \n"); +#endif Connect( showResultImagesBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onShowResultImages ); - wxButton *saveResultsBtn = new wxButton(this,-1,_T("Save Results"),wxDefaultPosition, wxSize(140,35) ); +#if wxMAJOR_VERSION <= 2 saveResultsBtn->SetEventHandler( this ); - Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults ); +#else +//EED saveResultsBtn->SetEventHandler( this ); +printf("EED interfInformationPanel::interfInformationPanel OOOjjjooooooo saveResultsBtn->SetEventHandler \n"); +#endif + Connect( saveResultsBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfInformationPanel::onSaveResults ); int sizeZ = interfMainPanel::getInstance()->GetImageDataSizeZ(); + //_theViewPanel->getSceneManager()->GetImageDataSizeZ(); _mbarrangeSliceInformation = new mBarRange(this,65,65); _mbarrangeSliceInformation->SetMin(0); _mbarrangeSliceInformation->SetStart(0); - _mbarrangeSliceInformation-> SetOrientation( true ); - _mbarrangeSliceInformation-> setActiveStateTo(true); - _mbarrangeSliceInformation-> setVisibleLabels( true ); - _mbarrangeSliceInformation-> setDeviceEndMargin(10); - _mbarrangeSliceInformation-> setRepresentedValues( 0 , sizeZ-1 ); - _mbarrangeSliceInformation-> setDeviceBlitStart(10,10); - _mbarrangeSliceInformation-> setIfWithActualDrawed( false ); - _mbarrangeSliceInformation-> SetStart( 0 ); - _mbarrangeSliceInformation-> SetEnd( sizeZ-1 ); - - + _mbarrangeSliceInformation->SetOrientation( true ); + _mbarrangeSliceInformation->setActiveStateTo(true); + _mbarrangeSliceInformation->setVisibleLabels( true ); + _mbarrangeSliceInformation->setDeviceEndMargin(10); + _mbarrangeSliceInformation->setRepresentedValues( 0 , sizeZ-1 ); + _mbarrangeSliceInformation->setDeviceBlitStart(10,10); + _mbarrangeSliceInformation->setIfWithActualDrawed( false ); + _mbarrangeSliceInformation->SetStart( 0 ); + _mbarrangeSliceInformation->SetEnd( sizeZ-1 ); double range[2]; interfMainPanel::getInstance()->getImageRange(range); +printf("EED interfInformationPanel::interfInformationPanel 2\n"); int min = (int)floor (range[0]); int max = (int)ceil (range[1]); @@ -273,61 +390,89 @@ interfInformationPanel::interfInformationPanel(wxWindow * parent) Connect(_mbarrangeRangeInformation->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &interfInformationPanel::onRangeSliceInformation ); +printf("EED interfInformationPanel::interfInformationPanel 3\n"); _staticTextInformation = new wxStaticText(this,-1,_T(" ")); - _grid = new wxGrid( this, wxID_ANY, wxPoint( 0, 0 ), - wxSize( 200, 500 ) ); - + wxSize( 200, 250 ) ); int i,gridCol=10,gridRow=sizeZ+2; _grid->CreateGrid( 0, 0 ); _grid->AppendRows(gridRow); _grid->AppendCols(gridCol); - for (i=0;iSetRowLabelValue(i, _T(" ") ); } // _grid->SetColLabelSize(0); - - FillGridWithContoursInformation(); + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2); +#else + wxFlexGridSizer * sizerSave = new wxFlexGridSizer(2,2,0,0); +#endif sizerSave -> Add( new wxStaticText(this,-1,_T("Save Options: ")) , 1, wxGROW ); sizerSave->Add( _XYZValues, 1, wxALL, 2 ); sizerSave->Add( _statistics, 1, wxALL, 2 ); sizerSave->Add( _contourImage, 1, wxALL, 2 ); + +printf("EED interfInformationPanel::interfInformationPanel 4\n"); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer * sizerA = new wxFlexGridSizer(10); +#else + wxFlexGridSizer * sizerA = new wxFlexGridSizer(1,10,0,0); +#endif sizerA->Add( _informationRadiobox, 1, wxALL, 2 ); sizerA->Add( _radiolstboxContourGroup, 1, wxALL, 2 ); sizerA->Add( sizerSave, 1, wxALL, 2 ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer * sizerB = new wxFlexGridSizer(10); +#else + wxFlexGridSizer * sizerB = new wxFlexGridSizer(1,4,0,0); +#endif sizerB->Add( informationContourLabelsBtn, 1, wxALL, 2 ); sizerB->Add( statisticsContourBtn, 1, wxALL, 2 ); sizerB->Add( showResultImagesBtn, 1, wxALL, 2 ); sizerB->Add( saveResultsBtn, 1, wxALL, 2 ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer * sizer = new wxFlexGridSizer(1,8); +#else + wxFlexGridSizer * sizer = new wxFlexGridSizer(20,1,0,0); +#endif +printf("EED interfInformationPanel::interfInformationPanel 5\n"); sizer->Add( sizerA , 1, wxALL , 0 ); - sizer->Add( new wxStaticText(this ,-1,_T("Slice Range")) , 1, wxALL , 0 ); +printf("EED interfInformationPanel::interfInformationPanel 5.1\n"); + sizer->Add( new wxStaticText(this ,1,_T("Slice Range")) , 1, wxALL , 0 ); +printf("EED interfInformationPanel::interfInformationPanel 5.2\n"); sizer->Add( _mbarrangeSliceInformation , 1, wxALL|wxGROW , 2 ); - sizer->Add( new wxStaticText(this ,-1,_T("Gray Range")) , 1, wxALL , 0 ); +printf("EED interfInformationPanel::interfInformationPanel 5.3\n"); + sizer->Add( new wxStaticText(this ,1,_T("Gray Range")) , 1, wxALL , 0 ); +printf("EED interfInformationPanel::interfInformationPanel 5.4\n"); sizer->Add( _mbarrangeRangeInformation , 1, wxALL|wxGROW , 2 ); + + sizer->Add( sizerB , 1, wxEXPAND , 0 ); sizer->Add( _staticTextInformation , 1, wxEXPAND , 0 ); sizer->Add( _grid , 1, wxEXPAND , 0 ); - this->SetSizer( sizer ); this->SetSize( wxSize(1500,1500) ); - //this->SetBackgroundColour( wxColour(100,100,100) ); this->SetAutoLayout( true ); +printf("EED interfInformationPanel::interfInformationPanel 5.10\n"); this->Layout(); //return panel; + +printf("EED interfInformationPanel::interfInformationPanel End\n"); + } interfInformationPanel::~interfInformationPanel() @@ -377,7 +522,12 @@ void interfInformationPanel::onExtractInformation(wxCommandEvent& event){ void interfInformationPanel::onSaveResults(wxCommandEvent& event) { +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxSAVE ); +#else + wxFileDialog dialog(this, _T("Choose a filename"), _T(""), _T(""), wxFileSelectorDefaultWildcardStr, wxFD_SAVE ); +#endif if (dialog.ShowModal() == wxID_OK) { onExtractInformation( event ); @@ -519,3 +669,55 @@ void interfCalibrationPanel::onCalibrate(wxCommandEvent& event) } //------------------------------------------------------------------------------------------------------------ + + +////////////////////////////////////////////////////////////// + +interfFlipPanel::interfFlipPanel(wxWindow* parent) +: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN) +{ + wxButton *buttonFlipX = new wxButton(this,wxID_ANY,_T("Flip Horizontally"), wxDefaultPosition, wxSize(200,35) ); + wxButton *buttonFlipY = new wxButton(this,wxID_ANY,_T("Flip Vertically"), wxDefaultPosition, wxSize(200,35) ); + + wxString lstOptions[3]; + lstOptions[0]=_T("Flip selected contours"); + lstOptions[1]=_T("Flip all contours of actual slice"); + lstOptions[2]=_T("Flip all contours"); + _wichContoursRadioBox = new wxRadioBox(this, -1, _T("Transform"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions, 1, wxRA_SPECIFY_COLS); + _wichContoursRadioBox->SetSelection(2); + + + Connect( buttonFlipX->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipXPressed ); + Connect( buttonFlipY->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipYPressed ); + + wxFlexGridSizer * sizer = new wxFlexGridSizer(1); + sizer -> Add( _wichContoursRadioBox, 1, wxGROW ); + sizer -> Add( buttonFlipX, 1, wxGROW ); + sizer -> Add( buttonFlipY, 1, wxGROW ); + + this->SetSizer( sizer ); + this->SetAutoLayout( true ); + this->Layout(); +} + + + + +interfFlipPanel::~interfFlipPanel(){ +} + +void interfFlipPanel::onFlipXPressed(wxCommandEvent& event) +{ + std::cout << "interfToolsPanels.cxx interfFlipPanel::onFlipXPressed FlipX (btn)" << std::endl; + int typeContoursFlip = _wichContoursRadioBox->GetSelection(); + interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 0 ); // type, direction +} + +void interfFlipPanel::onFlipYPressed(wxCommandEvent& event) +{ + std::cout << "interfToolsPanels.cxx interfFlipPanel::onFlipYPressed FlipY (btn)" << std::endl; + int typeContoursFlip = _wichContoursRadioBox->GetSelection(); + interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 1 ); // type, direction +} + +