]> Creatis software - bbtkGEditor.git/commitdiff
#3132 bbGEditor Feature New Normal - branch changeWx28to30 compilation with wxWidgets3 changeWx28to30
authorEduardo DAVILA <davila@localhost.localdomain>
Mon, 2 Oct 2017 15:10:00 +0000 (17:10 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Mon, 2 Oct 2017 15:10:00 +0000 (17:10 +0200)
appli/bbEditor/bbEditor.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBoxController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx

index 497d60f5448c72282f07eee23ffc69146437d712..a12bae411a5cc06ab59ae0b07c6943ed81b9009f 100644 (file)
@@ -130,7 +130,6 @@ bool wxBBEditorApp::OnCmdLineParsed(wxCmdLineParser& parser)
 // main frame
 bool wxBBEditorApp::OnInit( )
 {
-
        vtkOutputWindowbbGEditor *vtkoutputwindowbbgeditor= vtkOutputWindowbbGEditor::New();
        vtkOutputWindow::SetInstance( vtkoutputwindowbbgeditor );
        vtkoutputwindowbbgeditor->Delete();
@@ -148,6 +147,7 @@ bool wxBBEditorApp::OnInit( )
 #endif
 
        bbtk::wxGUIEditorGraphicBBS *iegbbs;
+
        iegbbs = new bbtk::wxGUIEditorGraphicBBS(NULL);
        SetTopWindow(iegbbs);
        iegbbs->Show(true);
@@ -171,7 +171,6 @@ bool wxBBEditorApp::OnInit( )
                } 
        }
 
-
        return true;
 }
 
index e593fc27c6fc1ae8bdcb976ce219540604bf474c..095e70479ed8ac43cb225c5650093b2c2dba8e6d 100644 (file)
@@ -86,7 +86,7 @@ namespace bbtk
                if ( _vtkInteractorStyleBaseView!=NULL)
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *_wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *_wxVTKiren;
                        _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        _wxVTKiren->GetEventPosition( X , Y );
 
@@ -132,7 +132,7 @@ namespace bbtk
         bool ok=true;
                
                int X,Y;
-               wxVTKRenderWindowInteractor *_wxVTKiren;
+               crea::wxVTKRenderWindowInteractor *_wxVTKiren;
                _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                _wxVTKiren->GetEventPosition( X , Y );
                
@@ -172,68 +172,36 @@ namespace bbtk
        }
 
        //=========================================================================
-
        bool GBlackBoxController::OnLeftButtonUp()
        {
         _isLeftClickDown    = false;
                int state           = _view->getState();
-
-               //Evaluate new state
-
-//EED Borrame
-//             int X,Y;
-//             wxVTKRenderWindowInteractor *wxVTKiren;
-//             wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-//             wxVTKiren->GetEventPosition(X,Y);
-//             if(_isLeftClickDown)
-//             {
-//                     _isLeftClickDown=false;
-//                     if(_view->isPointInside(X,Y))
-//                     {
-                               // It is supposed that I'm always inside even if the box is in drag
-//                             _view->setState(SELECTED);
-//                             _model->notifyObservers(getId());
-//                     }
-//             }
-
-
-
-               int shiftkey            = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
-               int ctrlkey             = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
+               int shiftkey        = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey();
+               int ctrlkey         = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey();
                ctrlkey = ctrlkey + shiftkey;
-               
-               
 //EED 12/07/2012               
 //             if ( (state==SELECTED) && (ctrlkey==0) && (_objHasBeenMoved==false))
 //             {
 //                     _view->setState(NOTHING_HAPPENS);
 //                     _model->notifyObservers(getId(),REMOVE_FROM_SELECTED);
 //             }
-
-
-
                return true;
-
        }
 
        //=========================================================================
-
        bool GBlackBoxController::OnRightButtonUp()
        {
                return true;
        }
 
        //=========================================================================
-
        bool GBlackBoxController::OnMiddleButtonDown()
        {
                int X,Y;
-               wxVTKRenderWindowInteractor *wxVTKiren;
+               crea::wxVTKRenderWindowInteractor *wxVTKiren;
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X,Y);
-
 //             int state  = _view->getState();
-
                //Evaluate new state
                if(_view->isPointInside(X,Y))
                {
@@ -242,14 +210,11 @@ namespace bbtk
                        if(bbmodel->isExecutable())
                        {
                                bbmodel->setExecutable(false);
-                       }
-                       else
-                       {
+                       } else {
                                bbmodel->setExecutable(true);
                        }
                        bbmodel->notifyObservers(getId());
                }
-
                return true;
        }
 
index 80e59f08633a59fda723584012c78989e21ded46..ad8024df98fa1cea91c0aba25213f0ebd705ba9d 100644 (file)
@@ -86,7 +86,7 @@ namespace bbtk
                if ( _vtkInteractorStyleBaseView!=NULL)
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *_wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *_wxVTKiren;
                        _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        _wxVTKiren->GetEventPosition( X , Y );
 
@@ -139,7 +139,7 @@ namespace bbtk
        bool GBoxController::OnLeftButtonUp()
        {
                int X,Y;
-               wxVTKRenderWindowInteractor *wxVTKiren;
+               crea::wxVTKRenderWindowInteractor *wxVTKiren;
                wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                wxVTKiren->GetEventPosition(X,Y);
 
index 8a97cb419196e1f3997fbdaa40a01d32624381c9..1b2fcd4efb6d6096b0991d648d44b7a08257c1ef 100644 (file)
@@ -93,7 +93,7 @@ namespace bbtk
                if ( _vtkInteractorStyleBaseView!=NULL)
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *_wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *_wxVTKiren;
                        _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        _wxVTKiren->GetEventPosition( X , Y );
 
@@ -114,7 +114,7 @@ namespace bbtk
                if ( _vtkInteractorStyleBaseView!=NULL )
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *wxVTKiren;
                        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        wxVTKiren->GetEventPosition(X,Y);
 
@@ -132,7 +132,7 @@ namespace bbtk
                if( _vtkInteractorStyleBaseView!= NULL )
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *wxVTKiren;
                        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        wxVTKiren->GetEventPosition(X, Y);
 
@@ -156,7 +156,7 @@ namespace bbtk
                if ( _vtkInteractorStyleBaseView!=NULL )
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *wxVTKiren;
                        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        wxVTKiren->GetEventPosition(X,Y);
 
@@ -173,7 +173,7 @@ namespace bbtk
                if( _vtkInteractorStyleBaseView!= NULL )
                {
                        int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *wxVTKiren;
                        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        wxVTKiren->GetEventPosition(X, Y);
 
@@ -197,7 +197,7 @@ namespace bbtk
                if ( _vtkInteractorStyleBaseView!=NULL )
                {
                        int X, Y, Z=GPOSITION_Z;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
+                       crea::wxVTKRenderWindowInteractor *wxVTKiren;
                        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
                        wxVTKiren->GetEventPosition(X, Y);
                        _controller->GetManualViewBaseContour()->InitMove( X, Y,Z);
index e4d6b8ba8db95011fb9abe0c001e968bf409cd35..19994d9505abc1818699ae6ac202687ed80861d8 100644 (file)
@@ -89,7 +89,7 @@ namespace bbtk
 
     bool GObjectController::OnMouseMove( ) {
         int X , Y ;
-        wxVTKRenderWindowInteractor *_wxVTKiren ;
+        crea::wxVTKRenderWindowInteractor *_wxVTKiren ;
         _wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView( )->GetWxVTKRenderWindowInteractor( ) ;
         _wxVTKiren->GetEventPosition( X , Y ) ;
         int state = _view->getState( ) ;
index b5355ea108a2b0c4456c7b1e938f5ddcb078174a..4b9c0e5f0abcaefa0877995d2aff861386b46297 100644 (file)
@@ -122,7 +122,8 @@ wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS()
 }
 
 //=========================================================================
-void wxGUIEditorGraphicBBS::initToolbar() {
+void wxGUIEditorGraphicBBS::initToolbar() 
+{
        wxBitmap bmp_new(new_xpm);
        wxBitmap bmp_open(open_xpm);
        wxBitmap bmp_save(save_xpm);
@@ -143,8 +144,10 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        //Adds a tool btn to the toolbar
        toolbar->AddTool(ID_NEW, _T("New"), bmp_new, wxNullBitmap, wxITEM_NORMAL,
                        _T("New tab"), _T("Create a new panel tab"));
+
        toolbar->AddTool(ID_OPEN, _T("Open diagram"), bmp_open, wxNullBitmap,
                        wxITEM_NORMAL, _T("Open a diagram"), _T("Open a diagram"));
+
        toolbar->AddTool(ID_SAVE_DIAGRAM, _T("Save Diagram"), bmp_save,
                        wxNullBitmap, wxITEM_NORMAL, _T("Saves the current diagram"),
                        _T("Saves the current diagram")); //DFCH
@@ -165,7 +168,14 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        toolbar->AddSeparator();
        toolbar->AddTool(ID_BTNCOMPLEXBOX, _T("Complex box"), complexbox_xpm,
                        wxNullBitmap, wxITEM_NORMAL, _T("Complex box"), _T("Complex box"));
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        toolbar->SetToggle(ID_BTNCOMPLEXBOX, true);
+#else
+       printf ("EED Warnning. wxGUIEditorGraphicBBS::initToolbar       >>>   toolbar->SetToggle  \n ");
+       // ..
+#endif
 
        // RaC 2012 2nd HackFest - Now Complex inputs are any external input
        //              toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT, _T("Add input to Complex box"),
@@ -191,6 +201,7 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        toolbar->EnableTool(ID_EDITPROPERTIES, false);
 
        toolbar->AddTool(ID_SHOWTREE, _T("Show tree"),bmp_showTree, wxNullBitmap, wxITEM_NORMAL,        _T("Show tree"), _T("Show tree"));
+
        
        toolbar->EnableTool(ID_UNDO, false);
        toolbar->EnableTool(ID_REDO, false);
@@ -198,6 +209,7 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        toolbar->Realize();
        SetToolBar(toolbar);
 
+
        
        // connect command event handlers
 
@@ -239,6 +251,7 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties));
        Connect(ID_SHOWTREE,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowTree));
 
+
 }
 //=========================================================================
 void wxGUIEditorGraphicBBS::initHelpHTMLBrowser() {
index ef9dc2f09c702e4f271f0687f9fc091957b2e20a..78a3f31267358507070ea5009591b6ddc6366961 100644 (file)
   Version:   $Revision$
 =========================================================================*/
 
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-*  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.
-* ------------------------------------------------------------------------ */
-
-
 
 /**
  *  \file
index 731585d7ac15b80496e0cc030a37f53f072113f2..d3a984fd1d769db64b240ded0d7e98f60d2e8758 100644 (file)
@@ -138,7 +138,7 @@ void wxVtkSceneManager::configureBaseView()
        _baseView->SetInteractorStyleBaseView(interactorstylebaseview);
 
        // Important to activate the 2D interaction system
-       wxVTKRenderWindowInteractor *iren =     _baseView->GetWxVTKRenderWindowInteractor();
+       crea::wxVTKRenderWindowInteractor *iren =       _baseView->GetWxVTKRenderWindowInteractor();
        interactorstylebaseview->SetInteractor(iren);
        iren->SetInteractorStyle(interactorstylebaseview);
        interactorstylebaseview->SetwxVtkBaseView(_baseView);
@@ -816,7 +816,7 @@ bool wxVtkSceneManager::OnMouseMove()
        int X, Y;
        bool okStatusMessage    = false;
        bool okPortMessage      = false;
-       wxVTKRenderWindowInteractor *wxVTKiren;
+       crea::wxVTKRenderWindowInteractor *wxVTKiren;
        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
        wxVTKiren->GetEventPosition(X, Y);
 
@@ -1055,7 +1055,7 @@ bool wxVtkSceneManager::OnMiddleButtonUp() {
 GObjectController *wxVtkSceneManager::GetGBlackBoxControlerPointedByMouse() {
        GObjectController *result = NULL;
        int X, Y;
-       wxVTKRenderWindowInteractor *wxVTKiren;
+       crea::wxVTKRenderWindowInteractor *wxVTKiren;
        wxVTKiren
                        = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
        wxVTKiren->GetEventPosition(X, Y);
@@ -1093,47 +1093,6 @@ bool wxVtkSceneManager::OnLeftDClick() {
                UnSelectBlackBoxes();
                _parent->editBlackBox((GBlackBoxModel*) cont->getModel());
        }
-
-       /*EED Borrame
-
-        int X,Y;
-        wxVTKRenderWindowInteractor *wxVTKiren;
-        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-        wxVTKiren->GetEventPosition(X,Y);
-
-        std::map<int, GObjectController*>::iterator it;
-
-        bool clickOnObject = false;
-
-        for(it = _controllers.begin(); it != _controllers.end() && clickOnObject==false; ++it)
-        {
-        GObjectController *cont = it->second;
-        int type = cont->getGObjectType();
-
-        if(cont->getView()->isPointInside(X,Y))
-        {
-        if(type==GBLACKBOX)
-        {
-        for (int i=0; i< (int)_selectedObjects.size(); i++)
-        {
-        int id = _selectedObjects[i];
-        GObjectController* control = _controllers[id];
-        control->getView()->setState(NOTHING_HAPPENS);
-        }
-        _selectedObjects.clear();
-
-        GBlackBoxModel *bbmodel = (GBlackBoxModel*)cont->getModel();
-        _parent->editBlackBox(bbmodel);
-        }
-        clickOnObject = true;
-        }
-        }
-
-        if(clickOnObject==false)
-        {
-        //_parent->editDiagramParameters(this);
-        }
-        */
        return true;
 }