From: Eduardo DAVILA Date: Thu, 21 Sep 2017 11:24:27 +0000 (+0200) Subject: #3128 creaMaracasVisu Feature New Normal - branch changeWx28to30 compilation with... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c5bb8b228d6fcd2a4ea1d6210bfa3a39d6bcac33;p=creaMaracasVisu.git #3128 creaMaracasVisu Feature New Normal - branch changeWx28to30 compilation with wxWidgets3 --- diff --git a/lib/GUI/Wx/SurfaceRenderer/wxMaracasSurfaceRendering.cxx b/lib/GUI/Wx/SurfaceRenderer/wxMaracasSurfaceRendering.cxx index 90fc918..8f969e4 100644 --- a/lib/GUI/Wx/SurfaceRenderer/wxMaracasSurfaceRendering.cxx +++ b/lib/GUI/Wx/SurfaceRenderer/wxMaracasSurfaceRendering.cxx @@ -294,12 +294,7 @@ ToolBar::ToolBar(wxWindow * parent,std::string iconsdir) #if wxMAJOR_VERSION <= 2 this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File"))); #else - this->AddTool(1, - wxString("test"), - bitmap0, - NULL, - wxITEM_NORMAL, - wxString("Open File") ); + this->AddTool(1, wxString(_T("test")),bitmap0, wxString(_T("Open File")), wxITEM_NORMAL ); #endif diff --git a/lib/GUI/Wx/VolumeRenderer/wxMaracasMultipleVolumeRendererView.cxx b/lib/GUI/Wx/VolumeRenderer/wxMaracasMultipleVolumeRendererView.cxx index c70043e..4560348 100644 --- a/lib/GUI/Wx/VolumeRenderer/wxMaracasMultipleVolumeRendererView.cxx +++ b/lib/GUI/Wx/VolumeRenderer/wxMaracasMultipleVolumeRendererView.cxx @@ -230,7 +230,15 @@ ToolBarMultipleVolumeRenderer::ToolBarMultipleVolumeRenderer(wxWindow * parent,s //iconfil+= "/OpenImage.png"; //wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); wxBitmap bitmap0(OpenImage_xpm); + + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File"))); +#else + this->AddTool(1, wxString(_T("test")),bitmap0 , wxString(_T("Open File")), wxITEM_NORMAL ); +#endif + /*iconfil+= "/Open.png"; wxBitmap* bitmap2 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index 7b98936..1f132b5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -384,6 +384,9 @@ void WidgetShowNPoints::OnInsertPoint (wxCommandEvent& event)//CFT //------------------------------------------------------------------------ void WidgetShowNPoints::OnLoadPoints(wxCommandEvent& event) { + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFileDialog* FD = new wxFileDialog( 0, _T("Load points .."), _T(""), @@ -391,6 +394,15 @@ void WidgetShowNPoints::OnInsertPoint (wxCommandEvent& event)//CFT _T("(*.xls)|*.xls"), wxOPEN | wxFILE_MUST_EXIST, wxDefaultPosition); +#else + wxFileDialog* FD = new wxFileDialog( 0, + _T("Load points .."), + _T(""), + _T(""), + _T("(*.xls)|*.xls"), + wxFD_OPEN | wxFD_FILE_MUST_EXIST, + wxDefaultPosition); +#endif int i; //EED int result_FD = FD->ShowModal(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx index 044d49a..ef444aa 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyle3DView.cxx @@ -109,7 +109,13 @@ bool vtkInteractorStyle3DView::SelectMarchibCubePoint() this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetY(xc(1)/spc[1]); this->_wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetZ(xc(2)/spc[2]); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 this->_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + this->_wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + ok=true; } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx index 7de9472..d7c6b68 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx @@ -373,7 +373,13 @@ void vtkInteractorStyleBaseView::EvaluateToRefresh() _parent_refresh_waiting = false; wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //CPR 13/01/2010 +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 this->_wxvtkbaseview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + this->_wxvtkbaseview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + int i; int size = _lstParentToReport.size(); for(i = 0; iMoveY(x,y,z); wxvtkmpr2Dview->MoveZ(x,y,z); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh - wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); wxCommandEvent newevent2(wxEVT_COMMAND_MENU_SELECTED,12122); // Doble click + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent2); +#else + wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); + wxvtkmpr2Dview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent2); +#endif + + return true; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleSphere.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleSphere.cxx index 54a7f73..177534e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleSphere.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleSphere.cxx @@ -93,7 +93,13 @@ bool vtkInteractorStyleSphere::OnLeftButtonUp() _vtkInteractorStyleBaseView->TransformCoordinate(x,y,z); wxsphereview->SetXYZtoParent(x,y); wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxsphereview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent); +#else + wxsphereview->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent); +#endif + } else { wxsphereview->RotationEnd(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget2.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget2.cxx index 7e698c3..a4d4821 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget2.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget2.cxx @@ -42,5 +42,11 @@ wxMPRWidget2::~wxMPRWidget2() void wxMPRWidget2::OnRefreshView(wxCommandEvent & event) // Virtual { wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 this->GetParent()->ProcessEvent(newevent1); +#else + this->GetParent()->ProcessWindowEvent(newevent1); +#endif + } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx index 2677457..1b562be 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererView.cxx @@ -230,7 +230,12 @@ ToolBarMultipleVolumeRenderer::ToolBarMultipleVolumeRenderer(wxWindow * parent,s //iconfil+= "/OpenImage.png"; //wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); wxBitmap bitmap0(OpenImage_xpm); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File"))); +#else + this->AddTool(1, wxString(_T("test")),bitmap0, wxString(_T("Open File")), wxITEM_NORMAL ); +#endif /*iconfil+= "/Open.png"; wxBitmap* bitmap2 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx index 108944d..1098be2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRendererView.cxx @@ -209,7 +209,14 @@ ToolBarRenderer::ToolBarRenderer(wxWindow * parent,std::string iconsdir) //iconfil+= "/OpenImage.png"; //wxBitmap* bitmap0 = new wxBitmap(wxString(iconfil.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); wxBitmap bitmap0(OpenImage_xpm); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 this->AddTool(1, wxString(_T("test")),bitmap0, NULL, wxITEM_NORMAL, wxString(_T("Open File"))); +#else + this->AddTool(1, wxString(_T("test")),bitmap0, wxString(_T("Open File")), wxITEM_NORMAL ); +#endif + + this->Realize(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx index 110ba6d..2252041 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxPanelCuttingImageData.cxx @@ -37,11 +37,11 @@ wxPanelCuttingImageData::wxPanelCuttingImageData (wxWindow *parent) : wxPanel( parent, -1) { - _imageData=NULL; - _histogrammeVector=NULL; - _wxvtk3Dbaseview=NULL; - _wxvtkbaseView=NULL; - CreateInterface(); + _imageData = NULL; + _histogrammeVector = NULL; + _wxvtk3Dbaseview = NULL; + _wxvtkbaseView = NULL; + CreateInterface() ; CreateModel(); Create3DViewObjects(); } @@ -488,7 +488,12 @@ void wxPanelCuttingImageData::OnExtract(wxCommandEvent& event) // _wxvtkbaseView->RefreshView(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkbaseView->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkbaseView->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx index 59c33cd..557bf67 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx @@ -1038,7 +1038,14 @@ void wxSTLWidget_03::OnBtnCreateFileSTL(wxCommandEvent& event) // wxDirDialog dialog( this, "Choose a directory...", ( !dirSTL.IsEmpty( ) )?dirSTL: wxGetHomeDir( ) ); + + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxSAVE ); +#else + wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxFD_SAVE ); +#endif if( dialog.ShowModal( ) == wxID_OK ) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractor.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractor.cxx index cd205a4..e7aa85e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractor.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractor.cxx @@ -82,23 +82,37 @@ wxWindow* wxGetTopLevelParent(wxWindow *win) #endif //VTK_USE_COCOA #endif //__WXCOCOA__ -#ifdef __WXGTK__ -# include // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0 -# include "gdk/gdkprivate.h" -#if wxCHECK_VERSION(2, 8, 0) -#ifdef __WXGTK20__ -#include -#else -#include -#endif + + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 + #ifdef __WXGTK__ + # include // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0 + # include "gdk/gdkprivate.h" + #if wxCHECK_VERSION(2, 8, 0) + #ifdef __WXGTK20__ + #include + #else + #include + #endif + #else + #include + #endif + #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \ + GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \ + GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) + #endif #else -#include -#endif -#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \ - GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \ - GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) + #ifdef __WXGTK__ + #include + #include + #endif #endif + + + + #ifdef __WXX11__ #include "wx/x11/privx.h" #define GetXWindow(wxwin) ((Window)(wxwin)->GetHandle()) @@ -366,7 +380,15 @@ long wxVTKRenderWindowInteractor::GetHandleHack() // Find and return the actual X-Window. #if defined(__WXGTK__) || defined(__WXX11__) - return (long)GetXWindow(this); + + //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 + #if wxMAJOR_VERSION <= 2 + return (long)GetXWindow(this); + #else + GdkWindow* Win = gtk_widget_get_window( (GtkWidget *) GetHandle() ); + return (long int)GDK_WINDOW_XDISPLAY(Win); + #endif + #endif //#ifdef __WXMOTIF__ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx index da8764c..b03dafd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DViewCntrlPanel.cxx @@ -344,9 +344,14 @@ void wxVtkClipping3DViewCntrlPanel::OnRepresentationSurfaceWireFrame(wxCommandEv _wxvtkclipping3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif - } + } // if idTissue } //------------------------------------------------------------------- @@ -356,7 +361,14 @@ void wxVtkClipping3DViewCntrlPanel::OnVisibleVolume(wxCommandEvent& event) _wxvtkclipping3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + } //------------------------------------------------------------------- void wxVtkClipping3DViewCntrlPanel::OnVisibleBoxSurface(wxCommandEvent& event) @@ -390,14 +402,18 @@ void wxVtkClipping3DViewCntrlPanel::OnColor(wxCommandEvent& event) float b=dlgColour.GetColourData().GetColour().Blue()/255; tmpActor->GetProperty()->SetColor( r , g , b ); _color->SetBackgroundColour(dlgColour.GetColourData().GetColour()); - _wxvtkclipping3Dview->Refresh(); - wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); - } - } +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + } // if ShowModal + } // if idTissue } + //------------------------------------------------------------------- void wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(wxCommandEvent& event) { @@ -405,12 +421,15 @@ void wxVtkClipping3DViewCntrlPanel::OnVisibleSurface(wxCommandEvent& event) if (idTissue!=-1) { _wxvtkclipping3Dview->VisibleActor(idTissue, _visible->GetValue()); - _wxvtkclipping3Dview->Refresh(); - wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); - } +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + } // if idTissue } //------------------------------------------------------------------- void wxVtkClipping3DViewCntrlPanel::OnOpacity(wxScrollEvent& event) @@ -422,12 +441,15 @@ void wxVtkClipping3DViewCntrlPanel::OnOpacity(wxScrollEvent& event) tmpActor = _wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->GetTissueActor(idTissue); float opacity=_opacity->GetValue(); tmpActor->GetProperty()->SetOpacity( opacity/100 ); - _wxvtkclipping3Dview->Refresh(); - wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); - } +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + } // if idTissue } //---------------------------------------------------------------------------- @@ -462,8 +484,15 @@ void wxVtkClipping3DViewCntrlPanel::OnIsoValue(wxScrollEvent& event) _wxvtkclipping3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); - } +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + + } // if idTissue } //------------------------------------------------------------------- @@ -478,7 +507,12 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL(wxCommandEvent& event) wxString dirSTL = wxGetHomeDir( ) ; +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxSAVE ); +#else + wxFileDialog dialog( this, _T("Choose a directory..."), dirSTL , _T(""), _T("*.*"), wxFD_SAVE ); +#endif if( dialog.ShowModal( ) == wxID_OK ) { @@ -524,7 +558,12 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnCreateFileSTL(wxCommandEvent& event) //------------------------------------------------------------------- void wxVtkClipping3DViewCntrlPanel::OnBtnSaveRawVolume(wxCommandEvent& event) { +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.maracas"), wxSAVE ); +#else + wxFileDialog dialog(this, _T("Choose a file"), _T(""), _T(""), _T("*.maracas"), wxFD_SAVE ); +#endif if (dialog.ShowModal() == wxID_OK) { std::string directory = (const char*) (dialog.GetDirectory().mb_str() ); @@ -668,7 +707,15 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) //_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions(); _wxvtkclipping3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + + /* volumeMapper->Update(); @@ -696,10 +743,10 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) size=greyctf->size(); for(i=0;iAddRGBPoint(grey2,red,green,blue); } @@ -709,7 +756,12 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) //_wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadVolumeFunctions(); _wxvtkclipping3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif /* volumeMapper->Update(); @@ -726,13 +778,26 @@ void wxVtkClipping3DViewCntrlPanel::OnBtnVolumeFunctions(wxCommandEvent& event) //------------------------------------------------------------------- void wxVtkClipping3DViewCntrlPanel::OnBtnMeshVTKLoad(wxCommandEvent& event) { +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.vtk"), wxOPEN); +#else + wxFileDialog dialog(this, _T("Choose a file"), _T("c:/Maracas_configuration"),_T(""), _T("*.vtk"), wxFD_OPEN); +#endif + if (dialog.ShowModal() == wxID_OK) { _wxvtkclipping3Dview->GetVtkClipping3DDataViewer()->ReadMeshVTK( (char *)dialog.GetPath().c_str() ); _wxvtkclipping3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh + +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); - } +#else + _wxvtkclipping3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + + } // if } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx index 790d3bc..d717de5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx @@ -715,7 +715,13 @@ void wxVtkMPR3DViewCntrlPanel::OnInterpolate(wxCommandEvent& event) _wxvtkmpr3Dview->Refresh(); wxCommandEvent newevent1(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessEvent(newevent1); +#else + _wxvtkmpr3Dview->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()->GetParent()->ProcessWindowEvent(newevent1); +#endif + }