]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx
#3145 creaContours Bug New Normal - changeWx28to30
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourViewPanel.cxx
index a470eba60ab0bed5d8226838c42a8b8b1587532d..a501b9193ff780b3f0c0c90acd6ffdaf54a11be2 100644 (file)
@@ -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.
+# ------------------------------------------------------------------------ */
+
 
 //----------------------------------------------------------------------------------------------------------------
 // Class definition include
@@ -87,31 +112,51 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
 
        }*/
        //:wxScrolledWindow(parent, -1, pos, size, style)
-       wxContourViewPanel :: wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
+       wxContourViewPanel::wxContourViewPanel ( vtkImageData * theShowingImage, wxWindow *parent, const wxPoint& pos, const wxSize& size,long style, int vertStart, int vertEnd, int horzStart, int horzEnd )
        :wxPanel(parent, -1, pos, size, style)
        {
+printf("EED wxContourViewPanel::wxContourViewPanel Start\n");
                theShowingImage->GetSpacing(last_spacing);
-               showingVID = theShowingImage;
-               int gapH = 20;
-               int gapV = 10;
-               _verticalConceptName = "";
-               _horizontalConceptName = "";
+               showingVID                              = theShowingImage;
+               int gapH                                = 20;
+               int gapV                                = 10;
+               _verticalConceptName    = "";
+               _horizontalConceptName  = "";
                createHorizontalBar(1,80);
                createVerticalBar(1,200);
                createViewPanel();
-               _eventHandler = NULL;
+               _eventHandler                   = NULL;
 
-               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1, 4, gapV, gapH);
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(1,4,  gapV, gapH);
                panelSizer -> AddGrowableCol(2);
                panelSizer -> AddGrowableRow(2);
+#else
+               wxFlexGridSizer * panelSizer = new wxFlexGridSizer(4);
+               panelSizer -> AddGrowableCol(2);
+#endif
+printf("EED wxContourViewPanel::wxContourViewPanel 01\n");
+printf("EED wxContourViewPanel::wxContourViewPanel 1\n");
                panelSizer->Add(_verticalBar, 1, wxGROW);
+printf("EED wxContourViewPanel::wxContourViewPanel 2\n");
                panelSizer->AddSpacer(gapV);
+printf("EED wxContourViewPanel::wxContourViewPanel 3\n");
                panelSizer->Add(theViewPanel, 1, wxGROW);
+printf("EED wxContourViewPanel::wxContourViewPanel 4\n");
                panelSizer->AddSpacer(gapV);
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
                outSizer = new wxFlexGridSizer(3, 1, gapH, gapV);
                outSizer -> AddGrowableCol(1);
                outSizer -> AddGrowableRow(1);
+#else
+               outSizer = new wxFlexGridSizer(3);
+               outSizer -> AddGrowableCol(1);
+#endif
+printf("EED wxContourViewPanel::wxContourViewPanel 5\n");
+printf("EED wxContourViewPanel::wxContourViewPanel 7\n");
                outSizer->Add( _horizontalBar, 1, wxGROW);
                outSizer->Add( panelSizer, 1, wxGROW);
                outSizer->AddSpacer(gapH);
@@ -119,6 +164,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                _horizontalBar->setDeviceBlitStart( _verticalBar->GetWidth() + 2*gapH, gapV);
                _horizontalBar->setDeviceEndMargin( 2*gapH+10 );
 
+printf("EED wxContourViewPanel::wxContourViewPanel 8\n");
                //Connecting the events to the horizontal bar
                Connect(_horizontalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Horizontal );
                Connect(_horizontalBar->GetId(),wxEVT_TSBAR_ACTUAL,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onActualChange_Bar_Horizontal );
@@ -126,6 +172,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                Connect(_horizontalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Horizontal );
                Connect(_horizontalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Horizontal );
                Connect(_horizontalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Horizontal );
+printf("EED wxContourViewPanel::wxContourViewPanel 9\n");
 
                //Connecting the events to the vertical bar
                Connect(_verticalBar->GetId(),wxEVT_TSBAR,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onBarrange_Vertical );
@@ -134,19 +181,19 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                Connect(_verticalBar->GetId(),wxEVT_TSBAR_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onEndChange_Bar_Vertical );
                Connect(_verticalBar->GetId(),wxEVT_SELECTION_END,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onSelectionEnd_Vertical );
                Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onMovedBar_Vertical );
-
-
+printf("EED wxContourViewPanel::wxContourViewPanel 9.1\n");
                this->SetSizer( outSizer );
+printf("EED wxContourViewPanel::wxContourViewPanel 9.2\n");
                this->SetAutoLayout( true );
+printf("EED wxContourViewPanel::wxContourViewPanel 9.3\n");
                this->Layout();
-
                //SetSize(1900,1900);
                //theViewPanel->SetSize(800,600);
                //theViewPanel->GetWindow(1)->SetSize(800,600);
-
                //outSizer->Fit( this );
-
+printf("EED wxContourViewPanel::wxContourViewPanel 10\n");
                initializeScenceManager();
+printf("EED wxContourViewPanel::wxContourViewPanel End\n");
        }
 
 
@@ -155,22 +202,19 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
                delete _sceneManager;
        }
 
-       void wxContourViewPanel::initializeScenceManager(){
-
+       void wxContourViewPanel::initializeScenceManager()
+       {
                //_theViewPanel = theViewPanel;
                //_theViewPanel->setWxEventHandler( this );
-
                double spc[3];
                this->getSpacing(spc);
                _sceneManager           = new wxVtkBaseView_SceneManager ( this->getWxVtkBaseView(), this, spc  );
-
                Connect( this->GetId(), wxINSTANT_CHANGE, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onChangeInstant );
         Connect( wxID_ANY, wxEVT_START_CREATE_MULT_ROI, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onCreateMultipleROI );
                Connect( wxID_ANY, wxEVT_START_CREATE_ROI, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onCreateROI );
                Connect( wxID_ANY, wxEVT_STOP_CREATE_ROI, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onStopCreateROI );
                Connect( wxID_ANY, wxEVT_CHANGED_DEEP, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourViewPanel::onChangedDeep );
                Connect( wxID_ANY,  wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourViewPanel :: onActionButtonPressed );
-
        }
 
        wxVtkBaseView_SceneManager* wxContourViewPanel::getSceneManager(){