]> Creatis software - creaContours.git/blobdiff - lib/Interface_Icons_NDimensions/interfMainPanel.cxx
#3216 creaContours Feature New Normal - vtk8itk4wx3-mingw64
[creaContours.git] / lib / Interface_Icons_NDimensions / interfMainPanel.cxx
index c1179ebc2b43ef97db6898fd80178767d046bf42..3f17f76490f9f79ed8a07c08aac7487e6f1e8d9b 100644 (file)
@@ -1,13 +1,37 @@
+/*# ---------------------------------------------------------------------
+#
+# 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 "interfMainPanel.h"
 
 
-interfMainPanel* interfMainPanel::interfmainpanel=NULL;
-wxFrame* interfMainPanel::_newframe=NULL;
+interfMainPanel        *interfMainPanel::interfmainpanel       = NULL;
+wxFrame                        *interfMainPanel::_newframe                     = NULL;
 
 interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtHandler * evtHandler, std::string datadir)
 : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN)
 {
-
        PANEL                                   = "New Contour";
        PANEL1                                  = "I/O";
        PANEL2                                  = "Edit";
@@ -30,22 +54,19 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        colorImageLayerPanel    = NULL;
        currentWindow                   = NULL;
        testPanel                               = NULL;
+       flipPanel                               = NULL;
 
 //CMRU 17-08-09 ------------------------------------------------------------------
        infoPanelCalibration = NULL;
        panelAux = NULL;
 //--------------------------------------------------------------------------------
        splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T("")));
-
        splitterwindow->SetMinimumPaneSize( 10 );
        sizey = sizey/8;
-
        wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
-
-       wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1);
+       wxFlexGridSizer* flexsizer = new wxFlexGridSizer(20,2,1,1);
        toolpanel->SetSizer(flexsizer, true);
        toolpanel->SetAutoLayout( true );
-
        wxButton* b = getButton(toolpanel);
        b->SetClientData(&PANEL);
        wxButton* b1 = getButton(toolpanel);
@@ -61,8 +82,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
 //EED 07/07/2010
        wxButton* b6 = getButton(toolpanel);
        b6->SetClientData(&PANEL6);
-
-
        wxPanel* mentex  = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
        wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
        wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
@@ -71,7 +90,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
 //EED 07/07/2010
        wxPanel* mentex6 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
-
        menubar  = new interfNewContourMenu  (mentex,  sizex, sizey, evtHandler, datadir);
        menubar1 = new interfIOMenu          (mentex1, sizex, sizey, evtHandler, datadir);
        menubar2 = new interfEditMenu        (mentex2, sizex, sizey, evtHandler, datadir);
@@ -79,7 +97,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        menubar4 = new interfToolsMenu       (mentex4, sizex ,sizey, evtHandler, datadir);
        menubar5 = new interfSegmentationMenu(mentex5, sizex, sizey, evtHandler, datadir);
        menubar6 = new interfImageToolsMenu(mentex6, sizex, sizey, evtHandler, datadir);
-
        statictext  = getText(mentex,  PANEL);
        statictext1 = getText(mentex1, PANEL1);
        statictext2 = getText(mentex2, PANEL2);
@@ -87,41 +104,31 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        statictext4 = getText(mentex4, PANEL4);
        statictext5 = getText(mentex5, PANEL5);
        statictext6 = getText(mentex6, PANEL6);
-
        flexsizer->Add(b, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex, menubar,statictext), wxFIXED_MINSIZE);
-
        flexsizer->Add(b1, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex1, menubar1,statictext1), wxFIXED_MINSIZE);
-
        flexsizer->Add(b2, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex2, menubar2,statictext2), wxFIXED_MINSIZE);
-
        flexsizer->Add(b3, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex3, menubar3,statictext3), wxFIXED_MINSIZE);
-
        flexsizer->Add(b4, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex4, menubar4,statictext4), wxFIXED_MINSIZE);
-
        flexsizer->Add(b5, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex5, menubar5,statictext5), wxFIXED_MINSIZE);
        flexsizer->Add(b6, wxFIXED_MINSIZE);
        flexsizer->Add(setMenuTextSizer(mentex6, menubar6,statictext6), wxFIXED_MINSIZE);
-
        toolpanel->Update();
        toolpanel->Layout();
-
        infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T("")));
        wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2);
        infoPanel->SetSizer(infosizer, true);
        infoPanel->SetAutoLayout( true );
-
        splitterwindow->Initialize(toolpanel);
        splitterwindow->SetSashGravity(1);
 //EED  splitterwindow->SetSashPosition(600);
        splitterwindow->SetSashSize(5);
        splitterwindow->SplitHorizontally(toolpanel, infoPanel,8*73);
-
        Connect(b->GetId(),  wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
        Connect(b1->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
        Connect(b2->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
@@ -129,8 +136,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH
        Connect(b4->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
        Connect(b5->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
        Connect(b6->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&interfMainPanel::onActionButtonPressed1);
-
-       this->Layout();
+       this->Layout(); 
 }
 
 interfMainPanel::~interfMainPanel(void)
@@ -141,8 +147,8 @@ interfMainPanel::~interfMainPanel(void)
 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string datadir, wxEvtHandler * evtHandler)
 {
        _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT);
-
-       if(interfmainpanel == NULL){
+       if(interfmainpanel == NULL)
+       {
                interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler, datadir);
        }
        _newframe->Show(TRUE);
@@ -151,10 +157,9 @@ interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, std::string data
 
 interfMainPanel* interfMainPanel::getInstance(wxWindow* parent, wxEvtHandler * evtHandler)
 {
-
        _newframe = new wxFrame(parent, -1, wxT(" Contour Tools "), wxPoint(25,50), wxSize(350,900),wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT );
-
-       if(interfmainpanel == NULL){
+       if(interfmainpanel == NULL)
+       {
                interfmainpanel = new interfMainPanel(_newframe, 350, 900, evtHandler);
        }
        _newframe->Show(TRUE);
@@ -181,19 +186,14 @@ void interfMainPanel :: resetInstance()
 wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler)
 {
        wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread")));
-
        wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2)       ;
        panel->SetSizer(flexsizer, true);
        panel->SetAutoLayout( true );
-
-       interfToolsMenu* menu = new interfToolsMenu(panel, sizex, sizey, evtHandler);
-       toolspread = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
-
+       interfToolsMenu *menu           = new interfToolsMenu(panel, sizex, sizey, evtHandler);
+                                       toolspread      = new interfToolsSpreadPanel(panel, sizex, 300, evtHandler);
        flexsizer->Add(menu, wxFIXED_MINSIZE);
        flexsizer->Add(toolspread, wxFIXED_MINSIZE);
-
        panel->Layout();
-
        return panel;
 }
 
@@ -281,14 +281,11 @@ wxButton* interfMainPanel::getButton(wxWindow* parent)
 
 wxPanel* interfMainPanel::setMenuTextSizer(wxWindow* parent, wxPanel* panel, wxStaticText* text)
 {
-
        wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2);
        parent->SetSizer(flexsizer, true);
        parent->SetAutoLayout( true );
-
        flexsizer->Add(text, wxFLEX_GROWMODE_ALL);
        flexsizer->Add(panel, wxFLEX_GROWMODE_ALL);
-
        parent->Layout();
        return (wxPanel*)parent;
 }
@@ -300,18 +297,22 @@ void interfMainPanel::showPanel(wxWindow* panel)
 {
        wxContourMainFrame::getInstance()->showAxis(false);
        wxSizer* sizer = infoPanel->GetSizer();
-
-       if(currentWindow != NULL){
+       if(currentWindow != NULL)
+       {
                currentWindow->Hide();
+               /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                sizer->Remove(currentWindow);
-       }
+#else
+               sizer->Detach(currentWindow);
+#endif
+       } // if currentWindow
        sizer->Add(panel);
        currentWindow = panel;
        currentWindow->Show(true);
-
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
-
        infoPanel->Layout();
        infoPanel->Refresh();
        this->Layout();
@@ -325,19 +326,24 @@ void interfMainPanel::hidePanel( )
 {
        wxContourMainFrame::getInstance()->showAxis(false);
        wxSizer* sizer = infoPanel->GetSizer();
-
-       if(currentWindow != NULL){
+       if(currentWindow != NULL)
+       {
                currentWindow->Hide();
+               /// \TODO fix warning: virtual bool wxSizer::Remove(wxWindow*) is deprecated 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                sizer->Remove(currentWindow);
+#else
+               sizer->Detach(currentWindow);
+#endif
+
        }
        wxPanel * emptyPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
        sizer->Add(emptyPanel);
        currentWindow = emptyPanel;
        currentWindow->Show(true);
-
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()+1);
        splitterwindow->SetSashPosition(splitterwindow->GetSashPosition()-1);
-
        infoPanel->Layout();
        infoPanel->Refresh();
        this->Layout();
@@ -445,11 +451,14 @@ void interfMainPanel::onSave()
        wxContourMainFrame::getInstance()->onSave();
 }
 
-void interfMainPanel::onImport(){
+void interfMainPanel::onImport()
+{
        wxContourMainFrame::getInstance()->onImport();
 }
 
-void interfMainPanel::onTest(){
+void interfMainPanel::onTest()
+{
+       printf("EED interfMainPanel::onTest \n");
        if(testPanel==NULL)
        {
                testPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition,
@@ -458,17 +467,15 @@ void interfMainPanel::onTest(){
                testPanel->SetSizer(flexsizer, true);
                testPanel->SetAutoLayout( true );
                panelTest = new interfTestPanel(testPanel);
-
-               wxStaticText* stattext = new wxStaticText(mirrorPanel,  -1,
+               wxStaticText* stattext = new wxStaticText(testPanel,  -1,
                        wxString(_T("   Test Panel   ")),
                        wxDefaultPosition, wxDefaultSize,
                        wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panelTest, wxEXPAND);
                testPanel->Layout();
-               showPanel(testPanel);
        }
+       showPanel(testPanel);
 }
 
 void interfMainPanel::RefreshInterface()
@@ -511,26 +518,25 @@ void interfMainPanel::setLabelSegmentationPanelVTK(wxString tmpString)
 {
     ((interfSegmentationPanelVTK*)segmentationPanel)->setLabel(tmpString);
 }
+
 void interfMainPanel::onSegmentationPressed()
 {
-       if(segmentPanel == NULL){
+       if(segmentPanel == NULL)
+       {
                segmentPanel = new wxPanel(getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                segmentPanel->SetSizer(flexsizer, true);
                segmentPanel->SetAutoLayout(true);
                segmentPanel->SetEventHandler(this);
-
                //wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel);
                segmentationPanel = new interfSegmentationPanelVTK(segmentPanel);
-
-
                wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T("   Automatic Segmentation   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
 
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(segmentationPanel, wxEXPAND);
                segmentPanel->Layout();
-       }
+       }// if segmentPanel
        showPanel(segmentPanel);
        wxContourMainFrame::getInstance()->showAxis(true);
        axisshown = true;
@@ -538,10 +544,9 @@ void interfMainPanel::onSegmentationPressed()
 
 void interfMainPanel::onSegmentationPressedITK()
 {
-    if(segmentPanelITK == NULL){
+    if(segmentPanelITK == NULL)
+       {
                segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
-
-
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                segmentPanelITK->SetSizer(flexsizer, true);
                segmentPanelITK->SetAutoLayout( true );
@@ -556,7 +561,7 @@ void interfMainPanel::onSegmentationPressedITK()
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panel, wxEXPAND);
                segmentPanelITK->Layout();
-       }
+       }// if segmentPanelITK
        showPanel(segmentPanelITK);
        wxContourMainFrame::getInstance()->showAxis(true);
        axisshown = true;
@@ -593,7 +598,8 @@ void interfMainPanel::onInterpolation(bool interpolate)
 
 void interfMainPanel::onConfigurationPressed()
 {
-       if(configPanel == NULL){
+       if(configPanel == NULL)
+       {
                configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                configPanel->SetSizer(flexsizer, true);
@@ -605,31 +611,27 @@ void interfMainPanel::onConfigurationPressed()
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panel, wxEXPAND);
                configPanel->Layout();
-       }
+       }// if configPanel
        showPanel(configPanel);
 }
 
 void interfMainPanel::onSpreadPressed()
 {
-    if(spreadPanel==NULL){
-
+    if(spreadPanel==NULL)
+       {
                spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                spreadPanel->SetSizer(flexsizer, true);
                spreadPanel->SetAutoLayout( true );
                //spreadPanel->SetEventHandler(this->contourevent);
-
                //wxPanel* panel = contourevent->getSpreadPanel(spreadPanel);
                panelSpread = new interfSpreadPanel(spreadPanel);
-
-
                wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T("   Automatic Spread   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
-
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panelSpread, wxEXPAND);
                spreadPanel->Layout();
-       }
+       } // spreadPanel
        showPanel(spreadPanel);
        //hideAxis();
 }
@@ -667,39 +669,53 @@ void interfMainPanel::setStringSpread(std::string stringtemp)
 
 void interfMainPanel::onInformationPressed()
 {
-
        // Statistics frame
-       if(infoWin ==NULL){
+       if(infoWin ==NULL)
+       {
+printf("EED interfMainPanel::onInformationPressed 0.1\n");
                infoWin                 = new wxFrame (this, -1,_T("  Statistics  "), wxDefaultPosition, wxDefaultSize, wxFRAME_TOOL_WINDOW|wxSYSTEM_MENU | wxCAPTION |  wxCLIP_CHILDREN |wxFRAME_FLOAT_ON_PARENT | wxRESIZE_BORDER  );
+printf("EED interfMainPanel::onInformationPressed 0.2\n");
                infoWin->SetSize( wxSize(825,650) );
 
                wxSize sizepanel(825,675);
+printf("EED interfMainPanel::onInformationPressed 0.3\n");
                informationPanel        = new interfInformationPanel(infoWin);//contourevent->getInformationPanel(infoWin);
+printf("EED interfMainPanel::onInformationPressed 0.3a\n");
+
+// Borrame             wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
+               wxFlexGridSizer * sizerPanel            = new wxFlexGridSizer(1);
 
-               wxBoxSizer * sizerPanel = new wxBoxSizer(wxHORIZONTAL);
                sizerPanel -> Add( informationPanel, 1, wxEXPAND ,0);
+printf("EED interfMainPanel::onInformationPressed 0.4\n");
 
                infoWin->SetSizer( sizerPanel );
                infoWin->SetAutoLayout( true );
                infoWin->Layout();
+printf("EED interfMainPanel::onInformationPressed 0.43\n");
                infoWin->Show();
        }else {
+printf("EED interfMainPanel::onInformationPressed 0.5\n");
 
                if (infoWin->IsShown()==true)
                {
+printf("EED interfMainPanel::onInformationPressed 0.6\n");
                        infoWin->Show(false);
                } else  {
                        //contourevent->FillGridWithContoursInformation();
+printf("EED interfMainPanel::onInformationPressed 0.7\n");
                        infoWin->Show(true);
                }
        }
 
+printf("EED interfMainPanel::onInformationPressed 1\n");
+
 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
        if(panelAux == NULL)
        {
                panelAux = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T("")));
        }
 //------------------------------------------------------------------------------------------------------------
+printf("EED interfMainPanel::onInformationPressed 2\n");
 
        // mask view control panel
        if(infoPanelMask == NULL){
@@ -719,6 +735,7 @@ void interfMainPanel::onInformationPressed()
 
        }
 
+printf("EED interfMainPanel::onInformationPressed 3\n");
 //CMRU 29-08-09-----------------------------------------------------------------------------------------------
        //Calibration panel
        if(infoPanelCalibration == NULL)
@@ -727,7 +744,6 @@ void interfMainPanel::onInformationPressed()
                wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
                infoPanelCalibration->SetSizer(flexsizer, true);
                infoPanelCalibration->SetAutoLayout( true );
-
                wxPanel *panel = new interfCalibrationPanel(infoPanelCalibration);
                wxStaticText* stattext = new wxStaticText(infoPanelCalibration, -1, wxString(_T("              Calibration               ")), wxDefaultPosition,
                                                                                                  wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
@@ -737,20 +753,32 @@ void interfMainPanel::onInformationPressed()
                flexsizer->Add(panel, wxEXPAND);
                infoPanelCalibration->Layout();
        }
+printf("EED interfMainPanel::onInformationPressed 4\n");
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFlexGridSizer* sizer = new wxFlexGridSizer(1);
-       panelAux->SetSizer(sizer, true);
-       panelAux->SetAutoLayout( true );
+#else
+       wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
+#endif
        sizer->Add(infoPanelMask);
+printf("EED interfMainPanel::onInformationPressed 4.1\n");
        sizer->Add(infoPanelCalibration);
-
+printf("EED interfMainPanel::onInformationPressed 4.2\n");
+       panelAux->SetSizer(sizer, true);
+printf("EED interfMainPanel::onInformationPressed 4.3\n");
+       panelAux->SetAutoLayout( true );
+printf("EED interfMainPanel::onInformationPressed 4.4\n");
        showPanel(panelAux);
+printf("EED interfMainPanel::onInformationPressed 4.5\n");
 
 //------------------------------------------------------------------
-
+printf("EED interfMainPanel::onInformationPressed OOJJOOOOOOOOOO......\n");
        wxContourMainFrame::getInstance()->changeInstant();
+printf("EED interfMainPanel::onInformationPressed End\n");
 }
 
+
 void interfMainPanel::getInstantVector(std::vector<int>& tempVector)
 {
        wxContourMainFrame::getInstance()->getInstantVector(tempVector);
@@ -830,27 +858,21 @@ void interfMainPanel::onMirrorPressed(){
                mirrorPanel->SetSizer(flexsizer, true);
                mirrorPanel->SetAutoLayout( true );
                panelMirror = new interfMirrorPanel(mirrorPanel);
-
                wxStaticText* stattext = new wxStaticText(mirrorPanel, -1, wxString(_T("   Mirroring Tool   ")), wxDefaultPosition,
                        wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
 
                flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
                flexsizer->Add(panelMirror, wxEXPAND);
                mirrorPanel->Layout();
-
                refLineShown=true;
                wxContourMainFrame::getInstance()->referenceLine();
-       }
-
-       else
-       {
-
+       } else {
                if (!refLineShown)
                {
                        wxContourMainFrame::getInstance()->refLineShow();
                        refLineShown=true;
                }
-       }
+       } // if mirrorPanel
 
        showPanel(mirrorPanel);
 }
@@ -937,6 +959,38 @@ void interfMainPanel::SetContourGroup(int contourGroup)
        wxContourMainFrame::getInstance()->SetContourGroup( contourGroup);
 }
 
+
+void interfMainPanel::onFlipContours()
+{
+       printf("EED interfMainPanel::onFlipContours() \n");
+       if(flipPanel==NULL)
+       {
+               flipPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition,
+                       wxDefaultSize, wxBORDER_STATIC, wxString(_T("")));
+               wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1);
+               flipPanel->SetSizer(flexsizer, true);
+               flipPanel->SetAutoLayout( true );
+               panelFlip = new interfFlipPanel(flipPanel);
+               wxStaticText* stattext = new wxStaticText(flipPanel,  -1,
+                       wxString(_T("         Flip Contours   ")),
+                       wxDefaultPosition, wxDefaultSize,
+                       wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T("")));
+               flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE);
+               flexsizer->Add(panelFlip, wxEXPAND);
+               flipPanel->Layout();
+       }
+       showPanel(flipPanel);
+}
+
+
+void interfMainPanel::FlipContours(int typeContourFlip, int flipDirection)
+{
+       printf("EED interfMainPanel::FlipContours( %d , %d ) \n",typeContourFlip,  flipDirection );
+       wxContourMainFrame::getInstance()->FlipContours( typeContourFlip , flipDirection );
+}
+
+
+
 //CMRU 17-08-09 ---------------------------------------------
 void interfMainPanel::onPrintLabel ()
 {
@@ -979,7 +1033,7 @@ void interfMainPanel::onCalibration(wxString size, int unit)
        type = wxContourMainFrame::getInstance()->getType();
        contourSize = wxContourMainFrame::getInstance()->getContourSizeInPixels();
 
-       std::cout<<"Cata->Tamaño del contorno en pixeles:"<<contourSize<<endl;
+       std::cout<<"Cata->Tamao del contorno en pixeles:"<<contourSize<<endl;
 
        if ( type == 6 )
        {