]> Creatis software - creaMaracasVisu.git/commitdiff
3590 orientationView ViewerNV vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 29 May 2026 14:53:28 +0000 (16:53 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Fri, 29 May 2026 14:53:28 +0000 (16:53 +0200)
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

index 74bf209ff2d1d73a6f860a068e60c12af01594dd..e74c926d9afd5b97b50d696c452ab724727ed393 100644 (file)
@@ -113,11 +113,13 @@ void ViewerNV::Process()
 {
     vtkImageData* img          = bbGetInputIn();
     std::vector<int> type      = bbGetInputnTypeView();
+    int orientationView     = bbGetInputorientationView();
     if(img != NULL && _mwxwidget != NULL)
     {
         if(!compareVectors(type, _currenttype))
         {
             _mwxwidget->SetType(&type);
+            _mwxwidget->SetOrientationView( orientationView );
             _mwxwidget->SetTDxWindow( bbGetInputTDxWindow() );
             _mwxwidget->UpdateLayout(img);
         }else if (img != _currentimg){
@@ -222,6 +224,7 @@ void ViewerNV::bbUserSetDefaultValues()
        vecNTypeViwer.push_back(2);
        vecNTypeViwer.push_back(0);
        bbSetInputnTypeView(vecNTypeViwer);
+    bbSetInputorientationView(0);
     bbSetInputTDxWindow( -1 );
     bbSetInputReactivityType(1);
 
index 4a444c449ce2de210dcbc4be1df81b258c87cba5..b5ee7fe3687d445b6889bd4355bdb48247bf0540 100644 (file)
@@ -75,6 +75,7 @@ class /*BBTK_EXPORT*/ ViewerNV
   BBTK_DECLARE_INPUT(Title,std::string);
   BBTK_DECLARE_INPUT(In, vtkImageData *);
   BBTK_DECLARE_INPUT(nTypeView, std::vector<int> );
+  BBTK_DECLARE_INPUT(orientationView, int );
   BBTK_DECLARE_INPUT(ColorFunction, vtkColorTransferFunction* );
   BBTK_DECLARE_INPUT(WindowLevel, double );
   BBTK_DECLARE_INPUT(ColorLevel, double );
@@ -126,6 +127,7 @@ BBTK_DESCRIPTION("(C++,Python,JavaScript) Viewer : N view configuration 2D and 3
   BBTK_INPUT(ViewerNV,Title,"Title prepended to the text",std::string,"");
   BBTK_INPUT(ViewerNV,In,"Input image",vtkImageData*,"");
   BBTK_INPUT(ViewerNV,nTypeView,"vector of viewer types (default 5 1 2 0): -1=Z_2DwithOutAxis 0=Z_2D 1=X_2D 2=Y_2D 3=Plane 4=Sphere 5=3D 6=3Dplane 7=3D_empty",std::vector<int>,"");
+  BBTK_INPUT(ViewerNV,orientationView,"(default 0)  0:nothing  nTypeView 3 elements: 0: T-distribution, 1-vertical, 2-horizontal   ",int,"");
   BBTK_INPUT(ViewerNV,ColorFunction,"Optional: set a different color for the viewers 2D",vtkColorTransferFunction*,"");
   BBTK_INPUT(ViewerNV,WindowLevel,"Optional: set a different Window level by using an other widget",double,"");
   BBTK_INPUT(ViewerNV,ColorLevel,"Optional: set a different Color level by using an other widget",double,"");
index 5a9891797367648bacb0d6f874e35745d439f3f1..3c66c1aa86b5b76e64bf0488f46f2c13d5e25b47 100644 (file)
@@ -70,6 +70,7 @@
        wxMaracas_N_ViewersWidget::wxMaracas_N_ViewersWidget(wxWindow *parent, vtkImageData* imagedata, std::vector<int> *nTypeView)
                : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
        {
+        OrientationView = 0;
                wxwindow1               = NULL;
                wxwindow2               = NULL;
                wxwindow3               = NULL;
@@ -83,7 +84,7 @@
                {
                        this->SetType(nTypeView);
                        this->UpdateLayout(imagedata);
-               }
+               } // if  imagedata  nTypeView
        }
        /**
        *       @pre A wxWindow* object must be provided as a parent for the viewer and the type of layout for the viewer
@@ -95,6 +96,7 @@
        */
        wxMaracas_N_ViewersWidget::wxMaracas_N_ViewersWidget(wxWindow *parent, std::vector<int> *nTypeView, vtkImageData* imagedata)
        : wxPanel( parent, -1){
+        OrientationView = 0;
                wxwindow1               = NULL;
                wxwindow2               = NULL;
                wxwindow3               = NULL;
                        spliter->SetMinimumPaneSize(1);
                        spliterA->SetMinimumPaneSize(1);
                        //RaC Nov2012 Correctly resize internal panels with the window resize event
-                       spliter->SetSashGravity(0.5);
+                       spliter->SetSashGravity(0.333);
                        spliterA->SetSashGravity(0.5);
                        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  );
+            
+            // T-distribution (normal)
+            if (OrientationView==0)
+            {
+                spliter        -> SplitVertically( wxwindow1 , spliterA    );
+                spliterA-> SplitHorizontally( wxwindow2 , wxwindow3 );
+            } else if (OrientationView==1){  // Vertical
+                spliter -> SplitHorizontally( wxwindow1 , spliterA  );
+                spliterA-> SplitHorizontally( wxwindow2 , wxwindow3 );
+            } else if (OrientationView==2){  // Horizontal
+                spliter -> SplitVertically( wxwindow1 , spliterA    );
+                spliterA-> SplitVertically( wxwindow2 , wxwindow3   );
+            } // if orientationView
+
                        wxwindow = spliter;
                }else if (nTypeView->size()>=4){
                        wxSplitterWindow        *spliter        = new wxSplitterWindow( this , -1,
@@ -343,6 +357,12 @@ void wxMaracas_N_ViewersWidget::SetType(std::vector<int>* type)
         nTypeView = type;
 }
 
+//-----------------------------------------------------------------------------------
+void wxMaracas_N_ViewersWidget::SetOrientationView(int orientationView)
+{
+     OrientationView = orientationView;
+}
+
 //-----------------------------------------------------------------------------------
 void wxMaracas_N_ViewersWidget::SetTDxWindow(int tdxwindow)
 {
index fbe031d0046fb99f8edb13c35047bb3d9167479b..b3fc23637c89a1fcc3e38be9857913b2bbad97d4 100644 (file)
@@ -123,6 +123,7 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel
        void SetImage( vtkImageData *image      );
        void ConfigureVTK();
        void SetType(std::vector<int>* type);
+    void SetOrientationView(int);
     void SetTDxWindow(int tdxwindow);
 
        void UpdateLayout(vtkImageData* imagedata);
@@ -153,6 +154,7 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel
        wxMaracas_ViewerWidget  *wxwindow4;
        wxWindow *_currentwxw;
        std::vector<int> *nTypeView;
+    int OrientationView;
     int nTDxWindow;
        vtkMPRBaseData* mvtkmprbasedata;