]> Creatis software - creaMaracasVisu.git/commitdiff
#3472 TDx
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 3 Dec 2021 10:24:18 +0000 (11:24 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 3 Dec 2021 10:24:18 +0000 (11:24 +0100)
14 files changed:
bbtk/src/bbmaracasvisuViewerNV.cxx
bbtk/src/bbmaracasvisuViewerNV.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h

index a889cf5e0c4b7f5d1a6df04af05844f2a577cb9e..2dcd98950f71a29c6c30e89fafb8d606d29086ce 100644 (file)
@@ -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 );
index e26cf263bd65da4299e274bc14ef33bca4c17219..d54e3e88dd2f3ea36f4ef784a640e434436eabea 100644 (file)
@@ -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  *,"");
index 5fe704df34b3df6fd0bb6552f645e6ee579c5e6d..4d0d87c029b9ce6202179efd9f508dbba5a94ddc 100644 (file)
                //std::cout<<"size "<<nTypeView->size()<<std::endl;
                if (nTypeView->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)
                        //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;
 //                     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  );
                        
 
 
 //-----------------------------------------------------------------------------------
- void wxMaracas_N_ViewersWidget::SetType(std::vector<int>* type){
+void wxMaracas_N_ViewersWidget::SetType(std::vector<int>* type)
+{
         nTypeView = type;
- }
+}
+
+//-----------------------------------------------------------------------------------
+void wxMaracas_N_ViewersWidget::SetTDxWindow(int tdxwindow)
+{
+     nTDxWindow = tdxwindow;
+}
 
 
 
index 4d0223c6092d00d8ce5a81a04c450c8b39a73315..fbe031d0046fb99f8edb13c35047bb3d9167479b 100644 (file)
@@ -123,6 +123,8 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel
        void SetImage( vtkImageData *image      );
        void ConfigureVTK();
        void SetType(std::vector<int>* 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<int> *nTypeView;
-
+    int nTDxWindow;
        vtkMPRBaseData* mvtkmprbasedata;
 
        void invariant();
index b8aac4632ca32d93ad410ede07033416673dbe5e..f490cbbd2ad4caac60cbb25d59a290c87d73f335 100644 (file)
@@ -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;
 
                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)
                }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);                    
 
                } 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();
index 93b56f1305b98effbe18a9dcaf5d296607fb35fe..78ebbc3e311ff9ee78d5d22c5c260444aa139edc 100644 (file)
@@ -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();
 
        //------------------------------------------------------------------------------------------------------------
index 4d9a3ed0511d8ccbcf71438aa15091091cdcf6e5..941b3ef3ae0d5f7c1e9e1d190d80e4bf3bbe33fa 100644 (file)
@@ -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;
index 2e3b7121c2f7ecee97b437e10473d4fe9a0b3cc7..d322fff42d8129e25ec455d0c82fedadc54d8efa 100644 (file)
@@ -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;
index e1e80e325a605d73311856c259d7a3e2a6fcd92a..2dd9455d42a509a851a1ff3c9ac174183785b848 100644 (file)
@@ -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;
index f4fc33e3488274be14c4cb6ca1dbdacd75d44f49..d60d05d523fb6b936579d5d9ea812d5c04fb893b 100644 (file)
@@ -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();
index 763931dea7f461185bc2d0df530b6495fc4e6563..81ff519e9702ed1c18715219756b00988cd230df 100644 (file)
@@ -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 
index 24515d083c1e07209f0f0572df9b02734052af11..de70a525c8b916d6a5709f8f40986d8f2409ff91 100644 (file)
@@ -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();
index 0b3e8ea32a1001b66bfa264262acf0c6adaced7a..b6f7f3c802e05a643bf2aec59a310709ccdf0f69 100644 (file)
@@ -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;
index 56bb7bb59f9c6a58a6ee080d8e8c8d7365c9a3dc..03323f8d8bdcbaf6bb2895afa9af29a3c6f6367f 100644 (file)
@@ -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();