X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_Icons_NDimensions%2FinterfMainPanel.cxx;h=83da40fc269afdd5f346003d8d53ba907185ceaf;hb=2ca0ae039a31c7aec93da7aadc5fa5e983e08045;hp=c1179ebc2b43ef97db6898fd80178767d046bf42;hpb=ffd5933600d8bad1de6ee62c305cc26a046166dd;p=creaContours.git diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index c1179eb..83da40f 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.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 "interfMainPanel.h" @@ -7,7 +32,6 @@ 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,6 +54,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH colorImageLayerPanel = NULL; currentWindow = NULL; testPanel = NULL; + flipPanel = NULL; //CMRU 17-08-09 ------------------------------------------------------------------ infoPanelCalibration = NULL; @@ -42,7 +67,12 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_DOUBLE, wxString(_T(""))); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1); +#else + wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6); +#endif toolpanel->SetSizer(flexsizer, true); toolpanel->SetAutoLayout( true ); @@ -62,7 +92,6 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH 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(""))); @@ -303,7 +332,14 @@ void interfMainPanel::showPanel(wxWindow* panel) 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 + } sizer->Add(panel); currentWindow = panel; @@ -328,7 +364,14 @@ void interfMainPanel::hidePanel( ) 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); @@ -445,11 +488,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 +504,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() @@ -937,6 +981,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 +1055,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:"<Tama�o del contorno en pixeles:"<