From b66220b31b36bcb3ee5711ee4fe11eaabb9ea4ab Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Fri, 29 May 2026 16:53:28 +0200 Subject: [PATCH] 3590 orientationView ViewerNV --- bbtk/src/bbmaracasvisuViewerNV.cxx | 3 ++ bbtk/src/bbmaracasvisuViewerNV.h | 2 ++ .../widgets/wxMaracas_N_ViewersWidget.cxx | 28 ++++++++++++++++--- .../widgets/wxMaracas_N_ViewersWidget.h | 2 ++ 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index 74bf209f..e74c926d 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -113,11 +113,13 @@ void ViewerNV::Process() { vtkImageData* img = bbGetInputIn(); std::vector 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); diff --git a/bbtk/src/bbmaracasvisuViewerNV.h b/bbtk/src/bbmaracasvisuViewerNV.h index 4a444c44..b5ee7fe3 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.h +++ b/bbtk/src/bbmaracasvisuViewerNV.h @@ -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 ); + 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,""); + 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,""); 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 5a989179..3c66c1aa 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_N_ViewersWidget.cxx @@ -70,6 +70,7 @@ wxMaracas_N_ViewersWidget::wxMaracas_N_ViewersWidget(wxWindow *parent, vtkImageData* imagedata, std::vector *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 *nTypeView, vtkImageData* imagedata) : wxPanel( parent, -1){ + OrientationView = 0; wxwindow1 = NULL; wxwindow2 = NULL; wxwindow3 = NULL; @@ -270,13 +272,25 @@ 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* type) nTypeView = type; } +//----------------------------------------------------------------------------------- +void wxMaracas_N_ViewersWidget::SetOrientationView(int orientationView) +{ + OrientationView = orientationView; +} + //----------------------------------------------------------------------------------- void wxMaracas_N_ViewersWidget::SetTDxWindow(int 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 fbe031d0..b3fc2363 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,7 @@ class creaMaracasVisu_EXPORT wxMaracas_N_ViewersWidget : public wxPanel void SetImage( vtkImageData *image ); void ConfigureVTK(); void SetType(std::vector* 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 *nTypeView; + int OrientationView; int nTDxWindow; vtkMPRBaseData* mvtkmprbasedata; -- 2.54.0