From: Eduardo DAVILA Date: Fri, 3 Dec 2021 10:24:18 +0000 (+0100) Subject: #3472 TDx X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=659bcd2c2a608cfb8c5854ffe84e9248871df9a1;p=creaMaracasVisu.git #3472 TDx --- diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index a889cf5..2dcd989 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -98,6 +98,7 @@ void ViewerNV::Process() if(!compareVectors(type, _currenttype)) { _mwxwidget->SetType(&type); + _mwxwidget->SetTDxWindow( bbGetInputTDxWindow() ); _mwxwidget->UpdateLayout(img); }else if (img != _currentimg){ _mwxwidget->SetImage(img); @@ -190,6 +191,7 @@ void ViewerNV::bbUserSetDefaultValues() vecNTypeViwer.push_back(2); vecNTypeViwer.push_back(0); bbSetInputnTypeView(vecNTypeViwer); + bbSetInputTDxWindow( -1 ); bbSetOutputwxVtkBaseView1( NULL ); bbSetOutputwxVtkBaseView2( NULL ); diff --git a/bbtk/src/bbmaracasvisuViewerNV.h b/bbtk/src/bbmaracasvisuViewerNV.h index e26cf26..d54e3e8 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.h +++ b/bbtk/src/bbmaracasvisuViewerNV.h @@ -83,6 +83,7 @@ class /*BBTK_EXPORT*/ ViewerNV BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *); BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *); BBTK_DECLARE_INPUT(Interpolate, bool); + BBTK_DECLARE_INPUT(TDxWindow, int); BBTK_DECLARE_OUTPUT(wxVtkBaseView1,wxVtkBaseView*); @@ -129,6 +130,7 @@ BBTK_DESCRIPTION("Viewer : N view configuration 2D and 3D"); BBTK_INPUT(ViewerNV,Obs4,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,""); BBTK_INPUT(ViewerNV,Obs5,"Optional: set a different Color level by using an other widget",vtkInteractorObserver*,""); BBTK_INPUT(ViewerNV,Interpolate,"Interpolate true/false (default true)",bool,""); + BBTK_INPUT(ViewerNV,TDxWindow,"(default -1) -1:No TDx [0..3]:window",int,""); BBTK_OUTPUT(ViewerNV,wxVtkBaseView1,"wxVtkBaseView 1",wxVtkBaseView *,""); BBTK_OUTPUT(ViewerNV,wxVtkBaseView2,"wxVtkBaseView 2",wxVtkBaseView *,""); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx index 5fe704d..4d0d87c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx @@ -244,15 +244,15 @@ //std::cout<<"size "<size()<size()==1) { - wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0], mvtkmprbasedata); + wxwindow1 = new wxMaracas_ViewerWidget(this, imagedata, (*nTypeView)[0], mvtkmprbasedata, nTDxWindow==0 ); wxwindow = wxwindow1; }else if (nTypeView->size()==2) { wxSplitterWindow *spliter = new wxSplitterWindow( this , -1); spliter->SetMinimumPaneSize(1); //RaC Nov2012 Correctly resize internal panels with the window resize event spliter->SetSashGravity(0.5); - wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0], mvtkmprbasedata); - wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1], mvtkmprbasedata); + wxwindow1 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[0], mvtkmprbasedata,nTDxWindow==0); + wxwindow2 = new wxMaracas_ViewerWidget(spliter, imagedata, (*nTypeView)[1], mvtkmprbasedata,nTDxWindow==1); spliter -> SplitHorizontally( wxwindow1 , wxwindow2 ); wxwindow = spliter; }else if (nTypeView->size()==3) @@ -264,9 +264,9 @@ //RaC Nov2012 Correctly resize internal panels with the window resize event spliter->SetSashGravity(0.5); spliterA->SetSashGravity(0.5); - wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0], mvtkmprbasedata); - wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1], mvtkmprbasedata); - wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2], mvtkmprbasedata); + wxwindow1 = new wxMaracas_ViewerWidget(spliter , imagedata, (*nTypeView)[0], mvtkmprbasedata,nTDxWindow==0); + wxwindow2 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[1], mvtkmprbasedata,nTDxWindow==1); + wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2], mvtkmprbasedata,nTDxWindow==2); spliter -> SplitVertically( wxwindow1 , spliterA ); spliterA-> SplitHorizontally( wxwindow2 , wxwindow3 ); wxwindow = spliter; @@ -293,10 +293,10 @@ // spliterA-> SplitHorizontally( wxwindow1 , wxwindow2 ); // spliterB-> SplitHorizontally( wxwindow3 , wxwindow4 ); - wxwindow1 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[0], mvtkmprbasedata); - wxwindow2 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[1], mvtkmprbasedata); - wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2], mvtkmprbasedata); - wxwindow4 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[3], mvtkmprbasedata); + wxwindow1 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[0], mvtkmprbasedata,nTDxWindow==0); + wxwindow2 = new wxMaracas_ViewerWidget(spliterB, imagedata, (*nTypeView)[1], mvtkmprbasedata,nTDxWindow==1); + wxwindow3 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[2], mvtkmprbasedata,nTDxWindow==2); + wxwindow4 = new wxMaracas_ViewerWidget(spliterA, imagedata, (*nTypeView)[3], mvtkmprbasedata,nTDxWindow==3); spliterA-> SplitHorizontally( wxwindow3 , wxwindow4 ); spliterB-> SplitHorizontally( wxwindow2 , wxwindow1 ); @@ -322,9 +322,16 @@ //----------------------------------------------------------------------------------- - void wxMaracas_N_ViewersWidget::SetType(std::vector* type){ +void wxMaracas_N_ViewersWidget::SetType(std::vector* type) +{ nTypeView = type; - } +} + +//----------------------------------------------------------------------------------- +void wxMaracas_N_ViewersWidget::SetTDxWindow(int tdxwindow) +{ + nTDxWindow = tdxwindow; +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h index 4d0223c..fbe031d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h @@ -123,6 +123,8 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel void SetImage( vtkImageData *image ); void ConfigureVTK(); void SetType(std::vector* type); + void SetTDxWindow(int tdxwindow); + void UpdateLayout(vtkImageData* imagedata); // double GetZ(int iWin); double GetX(); @@ -149,12 +151,9 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel wxMaracas_ViewerWidget *wxwindow2; wxMaracas_ViewerWidget *wxwindow3; wxMaracas_ViewerWidget *wxwindow4; - wxWindow *_currentwxw; - - std::vector *nTypeView; - + int nTDxWindow; vtkMPRBaseData* mvtkmprbasedata; void invariant(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index b8aac46..f490cbb 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -52,7 +52,7 @@ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ - wxMaracas_ViewerWidget::wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata) + wxMaracas_ViewerWidget::wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata,bool TDxWindow) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { wxPanel *panel = this; @@ -95,22 +95,22 @@ if (type==-1) { - mvtk2Dbaseview = new wxVtk2DBaseView(panel); + mvtk2Dbaseview = new wxVtk2DBaseView(panel,TDxWindow); mvtk2Dbaseview->SetVtkBaseData(mvtkmprbasedata); wxwindow = mvtk2Dbaseview->GetWxVTKRenderWindowInteractor(); }else if (type==0) { - mvtkmpr2Dview_Z = new wxVtkMPR2DView(panel,2); + mvtkmpr2Dview_Z = new wxVtkMPR2DView(panel,2,TDxWindow); mvtkmpr2Dview_Z->SetVtkBaseData(mvtkmprbasedata); wxwindow = mvtkmpr2Dview_Z->GetWxVTKRenderWindowInteractor(); }else if (type==1) { - mvtkmpr2Dview_X = new wxVtkMPR2DView(panel,0); + mvtkmpr2Dview_X = new wxVtkMPR2DView(panel,0,TDxWindow); mvtkmpr2Dview_X->SetVtkBaseData(mvtkmprbasedata); wxwindow = mvtkmpr2Dview_X->GetWxVTKRenderWindowInteractor(); }else if (type==2) { - mvtkmpr2Dview_Y = new wxVtkMPR2DView(panel,1); + mvtkmpr2Dview_Y = new wxVtkMPR2DView(panel,1,TDxWindow); mvtkmpr2Dview_Y->SetVtkBaseData(mvtkmprbasedata); wxwindow = mvtkmpr2Dview_Y->GetWxVTKRenderWindowInteractor(); }else if (type==3) @@ -130,7 +130,7 @@ }else if (type==5) { panelClipping3D = new wxSplitterWindow( panel , -1); - mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata); + mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata,TDxWindow); mwxvtkclipping3Dview = new wxVtkClipping3DView(mwxvtk3Dbaseview_Clipping3D); vtkClipping3DDataViewer *vtkclipping3Ddataviewer= new vtkClipping3DDataViewer(); vtkclipping3Ddataviewer->SetVtkMPRBaseData(mvtkmprbasedata); @@ -188,7 +188,7 @@ } else if (type==6) { panelClipping3D = new wxSplitterWindow( panel , -1); - mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata); + mwxvtk3Dbaseview_Clipping3D = new wxVtk3DBaseView( panelClipping3D , vtkmprbasedata,TDxWindow); mwxvtkmpr3Dview = new wxVtkMPR3DView( mwxvtk3Dbaseview_Clipping3D ); vtkmpr3Ddataviewer = new vtkMPR3DDataViewer(); wxWindow *window3D = mwxvtk3Dbaseview_Clipping3D->GetWxVTKRenderWindowInteractor(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h index 93b56f1..78ebbc3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h @@ -79,7 +79,7 @@ // Constructors & Destructors //------------------------------------------------------------------------------------------------------------ - wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata=NULL); + wxMaracas_ViewerWidget(wxWindow *parent, vtkImageData* imagedata, int type, vtkMPRBaseData *vtkmprbasedata=NULL,bool TDxWindow=false); ~wxMaracas_ViewerWidget(); //------------------------------------------------------------------------------------------------------------ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index 4d9a3ed..941b3ef 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -31,8 +31,8 @@ #include "vtkImageActor.h" -wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent) -:wxVtkBaseView(parent) +wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent,bool TDxWindow) +:wxVtkBaseView(parent,TDxWindow) { _imageViewer2XYZ = NULL; _vtkIinfoTextImage = NULL; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h index 2e3b712..d322fff 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h @@ -39,7 +39,7 @@ class vtkInfoTextImageInteractor; class creaMaracasVisu_EXPORT wxVtk2DBaseView: public wxVtkBaseView{ public: - wxVtk2DBaseView(wxWindow *parent); + wxVtk2DBaseView(wxWindow *parent,bool TDxWindow=false); virtual ~wxVtk2DBaseView(); virtual void Configure(bool okimage=true); vtkImageViewer2_XYZ* _imageViewer2XYZ; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index e1e80e3..2dd9455 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -30,8 +30,8 @@ #ifdef _DEBUG #define new DEBUG_NEW #endif -wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent, vtkBaseData* vtkbasedata) -:wxVtkBaseView( parent ) +wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent, vtkBaseData* vtkbasedata,bool TDxWindow) +:wxVtkBaseView( parent , TDxWindow) { SetVtkBaseData( vtkbasedata ); _configure = false; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h index f4fc33e..d60d05d 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h @@ -40,7 +40,7 @@ class creaMaracasVisu_EXPORT wxVtk3DBaseView: public wxVtkBaseView { public: - wxVtk3DBaseView( wxWindow *parent, vtkBaseData* vtkbasedata ); + wxVtk3DBaseView( wxWindow *parent, vtkBaseData* vtkbasedata, bool TDxWindow=false ); virtual ~wxVtk3DBaseView(); vtkCamera* GetCamera(); virtual vtkRenderer* GetRenderer(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index 763931d..81ff519 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -42,13 +42,16 @@ wxVtkBaseView::wxVtkBaseView() //------------------------------------------------------------------- -wxVtkBaseView::wxVtkBaseView(wxWindow *parent) +wxVtkBaseView::wxVtkBaseView(wxWindow *parent,bool TDxWindow) { _parent = parent; _iren = (crea::wxVTKRenderWindowInteractor*)new wxVTKRenderWindowInteractorPlus(_parent,this); //EED 2021-10-12 #ifdef VTK_USE_TDX - _iren->SetUseTDx(true); + if (TDxWindow==true) + { + _iren->SetUseTDx(true); + } // if TDX #endif @@ -97,14 +100,12 @@ void wxVtkBaseView::Refresh() // virtual //------------------------------------------------------------------- void wxVtkBaseView::RefreshView() // virtual { -printf("EED wxVtkBaseView::RefreshView Start\n"); // EED 10 Oct 2007 #if defined(WIN32) GetRenWin()->Render(); #else //GetRenWin()->Render(); #endif -printf("EED wxVtkBaseView::RefreshView End\n"); } //--------------------------------------------------------------------------- vtkRenderer* wxVtkBaseView::GetRenderer() // virtual diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h index 24515d0..de70a52 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h @@ -67,7 +67,7 @@ class creaMaracasVisu_EXPORT wxVtkBaseView{ public: wxVtkBaseView( ); - wxVtkBaseView( wxWindow *parent ); + wxVtkBaseView( wxWindow *parent, bool TDxWindow=false ); virtual ~wxVtkBaseView(); crea::wxVTKRenderWindowInteractor *GetWxVTKRenderWindowInteractor() throw (char*); virtual void Configure(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index 0b3e8ea..b6f7f3c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -35,8 +35,8 @@ using namespace gtm; #endif -wxVtkMPR2DView::wxVtkMPR2DView( wxWindow *parent, int direction) - :wxVtk2DBaseView(parent) +wxVtkMPR2DView::wxVtkMPR2DView( wxWindow *parent, int direction, bool TDxWindow) + :wxVtk2DBaseView(parent, TDxWindow) { _backX = -99999; _backY = -99999; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h index 56bb7bb..03323f8 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h @@ -40,7 +40,7 @@ class creaMaracasVisu_EXPORT wxVtkMPR2DView : public wxVtk2DBaseView { public: - wxVtkMPR2DView( wxWindow *parent, int direction ); + wxVtkMPR2DView( wxWindow *parent, int direction ,bool TDxWindow=false ); ~wxVtkMPR2DView(); void Configure(); virtual void Refresh();