]> Creatis software - creaMaracasVisu.git/commitdiff
#3582 ResetRefresh mechanism vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 16 Sep 2025 14:09:57 +0000 (16:09 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 16 Sep 2025 14:09:57 +0000 (16:09 +0200)
bbtk/bbs/boxes/ManualPaint2.bbg
bbtk/bbs/boxes/ManualPaint2.bbs
bbtk/src/bbcreaMaracasVisuColorLayerImageView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/ColorLayerImageViewManager.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h

index 44e236f390cb7dcf5baf1e49d8f5434f123f3653..28bb828301fb9ddcda2eae636709336da399b653 100644 (file)
@@ -1,12 +1,13 @@
 # ----------------------------------
-# - BBTKGEditor v 1.5 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbg
+# - BBTKGEditor v 1.6 BBG BlackBox Diagram file
+# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbg
 # ----------------------------------
 
 APP_START
 CATEGORY:<VOID>
 DESCRIPTION:Description ??
 AUTHOR:Author ??
+EXPORTFORMAT:0
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:ManualPaint2
 PACKAGENAME:creaMaracasVisu
@@ -84,8 +85,8 @@ BOXES:34
 BOX
 creaMaracasVisu:ManualPaint_Model:Box00
 ISEXEC:FALSE
--66.621926:-17.429511:-900.000000
--31.541926:-19.929511:-900.000000
+-67.601620:-24.409982:-900.000000
+-32.521620:-26.909982:-900.000000
 PORT
 2D3D:"1"
 PORT
@@ -106,8 +107,8 @@ FIN_BOX
 BOX
 wx:RadioButton:Box01
 ISEXEC:FALSE
--86.702341:31.013095:-900.000000
--49.862341:28.513095:-900.000000
+-86.702341:30.347478:-900.000000
+-48.102341:27.847478:-900.000000
 PORT
 In0:"Deselect"
 PORT
@@ -129,7 +130,7 @@ BOX
 creaMaracasVisu:ColorLayerImageView:Box03
 ISEXEC:FALSE
 45.427915:-19.888628:-900.000000
-85.787915:-22.388628:-900.000000
+87.547915:-22.388628:-900.000000
 PORT
 TypeControlsInterface:"2"
 PORT
@@ -165,7 +166,7 @@ BOX
 wx:LayoutLine:Box09
 ISEXEC:FALSE
 -70.041427:-48.732937:-900.000000
--36.721427:-51.232937:-900.000000
+-34.961427:-51.232937:-900.000000
 FIN_BOX
 BOX
 std:GetVectorStringElement:Box11
@@ -210,8 +211,8 @@ FIN_BOX
 BOX
 std:TransposeVectorVectorString:Box17
 ISEXEC:FALSE
--82.333286:36.474034:-900.000000
--58.898286:33.974034:-900.000000
+-80.170031:40.301330:-900.000000
+-56.735031:37.801330:-900.000000
 PORT
 In0:"Desactivate Big-Blue Small-Blue Big-Clean Small-Clean"
 FIN_BOX
@@ -219,7 +220,7 @@ BOX
 wx:RadioButton:Box18
 ISEXEC:FALSE
 -229.150922:28.930314:-900.000000
--192.310922:26.430314:-900.000000
+-190.550922:26.430314:-900.000000
 PORT
 In:"1"
 PORT
@@ -231,7 +232,7 @@ BOX
 wx:LayoutLine:Box19
 ISEXEC:FALSE
 -96.084954:-41.834911:-900.000000
--62.764954:-44.334911:-900.000000
+-61.004954:-44.334911:-900.000000
 PORT
 Orientation:"H"
 FIN_BOX
@@ -285,7 +286,7 @@ BOX
 vtk:UpdateRender:Box27
 ISEXEC:FALSE
 63.631767:-39.284768:-900.000000
-85.656768:-41.784768:-900.000000
+85.656767:-41.784768:-900.000000
 PORT
 Active:"true"
 FIN_BOX
@@ -301,13 +302,13 @@ BOX
 wx:LayoutLine:Box29
 ISEXEC:FALSE
 -150.508630:-5.278624:-900.000000
--117.188630:-7.778624:-900.000000
+-115.428630:-7.778624:-900.000000
 FIN_BOX
 BOX
 wx:CommandButton:Box30
 ISEXEC:FALSE
 -168.207844:3.758670:-900.000000
--145.932844:1.258670:-900.000000
+-145.447844:1.258670:-900.000000
 PORT
 Label:"Undo"
 FIN_BOX
@@ -315,7 +316,7 @@ BOX
 wx:CommandButton:Box31
 ISEXEC:FALSE
 -143.662996:4.444256:-900.000000
--121.387996:1.944256:-900.000000
+-120.902996:1.944256:-900.000000
 PORT
 Label:"Redo"
 FIN_BOX
@@ -351,7 +352,7 @@ BOX
 wx:LayoutLine:Box36
 ISEXEC:FALSE
 -206.209254:13.022267:-900.000000
--172.889254:10.522267:-900.000000
+-171.129254:10.522267:-900.000000
 PORT
 Orientation:"H"
 FIN_BOX
@@ -359,7 +360,7 @@ BOX
 wx:RadioButton:Box37
 ISEXEC:FALSE
 -176.103448:28.466673:-900.000000
--139.263448:25.966673:-900.000000
+-137.503448:25.966673:-900.000000
 PORT
 In:"1"
 PORT
@@ -371,7 +372,7 @@ BOX
 wx:RadioButton:Box39
 ISEXEC:FALSE
 -151.360228:22.778994:-900.000000
--114.520228:20.278994:-900.000000
+-112.760228:20.278994:-900.000000
 PORT
 In:"1"
 PORT
@@ -381,7 +382,7 @@ In1:"XZ"
 PORT
 In2:"XY"
 FIN_BOX
-CONNECTIONS:85
+CONNECTIONS:86
 CONNECTION
 Box01:Out:Box02:In
 NumberOfControlPoints:0
@@ -637,4 +638,7 @@ NumberOfControlPoints:0
 CONNECTION
 Box36:Widget:Box19:Widget1
 NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box03:BoxExecute
+NumberOfControlPoints:0
 APP_END
index af4e442340bd9a3e907652471a256253275b9d7f..35cf0225860f876185c193952a39ca7e21149baf 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
-# - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbs
+# - BBTKGEditor v 1.6 BBS BlackBox Script (Complex Box)
+# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbs
 # ----------------------------------
 
 include std
@@ -202,6 +202,7 @@ connect Box39.Widget Box36.Widget4
 connect Box39.Out Box00.Direction
 connect Box29.Widget Box19.Widget6
 connect Box36.Widget Box19.Widget1
+connect Box00.BoxChange Box03.BoxExecute
 
 # Complex input ports
 input TitleOptions Box20.In " "
index 7f00080f39ef690474804d8adf341fd90a8a7ac4..b5261021ec264bdfa0112716e0d7117baf2c334b 100644 (file)
@@ -94,6 +94,7 @@ void ColorLayerImageView::Process()
                 clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 0 , bbGetInputWxVtkBaseView() );
                 clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 1 , bbGetInputWxVtkBaseView1() );
                 clivp->GetColorLayerImageViewManager()->SetwxVtkBaseView( 2 , bbGetInputWxVtkBaseView2() );
+                clivp->GetColorLayerImageViewManager()->ResetRefresh( );
                 clivp->GetColorLayerImageViewManager()->SetRangeForColorBar( range );
                 clivp->GetColorLayerImageViewManager()->SetColorBarPosition( colorbarposition );
                 clivp->GetColorLayerImageViewManager()->SetBaseColors( base_color );
index cca709a45d337067b448f602113cfe18b552fac5..4a39be930597ad272b773fac7dc0403a64ce75a7 100644 (file)
@@ -53,7 +53,15 @@ ColorLayerImageViewManager::~ColorLayerImageViewManager()
 }
 //=========================================================================
 
-
+//----------------------------------------------------------------------------
+void ColorLayerImageViewManager::ResetRefresh()
+{
+    int i,size =_colorLayerImageViewLst.size();
+    for (i=0;i<size;i++)
+    {
+        _colorLayerImageViewLst[i]->ResetRefresh();
+    } // for i
+}
 
 //----------------------------------------------------------------------------
 void ColorLayerImageViewManager::SetwxVtkBaseView(int id, wxVtkBaseView *baseview)
index eaf7e8dbfb242182ed5d0f9c363cd7e8feaf3e2c..caf5dc20904dcf1e7f7e48f3922268cce70b8e80 100644 (file)
@@ -50,6 +50,7 @@ class  ColorLayerImageViewManager
          virtual int           GetX();
          virtual int           GetY();
          virtual int           GetZ();
+      void              ResetRefresh();
          void                          SetwxVtkBaseView(int id, wxVtkBaseView *baseview);
          wxVtkBaseView*        GetwxVtkBaseView(int id);
          void                          SetBaseColors(std::vector<double> & base_color);
index 4ef89db140cd4b1c67619175bb70250773425dcb..7ec645cf3e01faf470a06957e79682aad98a640d 100644 (file)
@@ -105,6 +105,7 @@ LayerImageBase::LayerImageBase()
        _baseView                               =       NULL;
        _imageReslicer                  =       vtkImageReslice::New();
        _imageChangeInformation =       vtkImageChangeInformation::New();
+    this->ResetRefresh();  // _Xback=-9999   _Yback=-9999   _Zback=-9999
 }
 
 //----------------------------------------------------------------------------
@@ -211,33 +212,27 @@ void LayerImageBase::SetImage(vtkImageData* image)
        {
                vtkImageData    *imagebase              =       GetwxVtkBaseView()->GetVtkBaseData()->GetImageData();
                if (imagebase!=NULL) 
-               {       
-
+               {
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
                        imagebase->GetWholeExtent(ext);
 #else
                        imagebase->GetExtent(ext);
 #endif
-
-                       dimBase[0]=ext[1]-ext[0]+1;                             
-                       dimBase[1]=ext[3]-ext[2]+1;                             
-                       dimBase[2]=ext[5]-ext[4]+1;                             
+                       dimBase[0] = ext[1]-ext[0]+1;
+                       dimBase[1] = ext[3]-ext[2]+1;
+                       dimBase[2] = ext[5]-ext[4]+1;
                        SetDimensionBase(dimBase);
                        imagebase->GetSpacing(spcBase);
                        SetSpcBase(spcBase);
-
                        if ((_X<0) || (_X>dimBase[0])) { SetX( dimBase[0]/2 ); } 
                        if ((_Y<0) || (_Y>dimBase[1])) { SetY( dimBase[1]/2 ); } 
-                       if ((_Z<0) || (_Z>dimBase[2])) { SetZ( dimBase[2]/2 ); } 
-
-
+                       if ((_Z<0) || (_Z>dimBase[2])) { SetZ( dimBase[2]/2 ); }
                } // if imagebase
        } // if wxvtkbaseview
        _image->GetScalarRange( _range );
 //     _thresholdTable = vtkLookupTable::New();
 
-
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _imageChangeInformation->SetInput(_image);
@@ -352,7 +347,6 @@ void LayerImageBase::SetRangeForColorBar(std::vector<double> &range)
    _rangeForColorBar=range;
 }
 
-
 //------------------------------------------------------------------------------
 void LayerImageBase::GetRangeForColorBar(double &minRange, double &maxRange)
 {
@@ -366,18 +360,24 @@ void LayerImageBase::GetRangeForColorBar(double &minRange, double &maxRange)
        }
 }
 
-
+//----------------------------------------------------------------------------
+void LayerImageBase::ResetRefresh()
+{
+    _Xback      = -9999;
+    _Yback      = -9999;
+    _Zback      = -9999;
+}
 
 //----------------------------------------------------------------------------
 void LayerImageBase::SetwxVtkBaseView(wxVtkBaseView *baseview)
 {
-       if (_baseView==NULL)
+    if (_baseView==NULL)
    {
-               _baseView = baseview;
-               ColorLayerObserver *colorlayerobserver = ColorLayerObserver::New();
-               _baseView->GetVtkBaseData()->AddObserver( 1, colorlayerobserver );
-               colorlayerobserver->SetLayerImageBase(this);
-       } // if _baseView
+        _baseView   = baseview;
+        ColorLayerObserver *colorlayerobserver = ColorLayerObserver::New();
+        _baseView->GetVtkBaseData()->AddObserver( 1, colorlayerobserver );
+        colorlayerobserver->SetLayerImageBase(this);
+    } // if _baseView
 }
 
 //----------------------------------------------------------------------------
@@ -395,7 +395,6 @@ void LayerImageBase::Refresh()
     } // if _baseView
 }
 
-
 //----------------------------------------------------------------------------
 vtkLookupTable* LayerImageBase::GetThresholdTable()
 {
@@ -482,6 +481,10 @@ void LayerImageBase::onThreshold()
         }
     }
     
+// EED 2025-09-16 Borrame
+//    ok=true;
+//
+
        if ( (_image!=NULL) && (_baseView!=NULL) && (ok==true) )
        {
         double x = GetX();
index e849c202b462db9a879a6d0dd36524f2d32b9c77..59f91dcaf1958c605c2f5449ec4452337faed324 100644 (file)
@@ -89,6 +89,7 @@ class LayerImageBase
                void                    GetRangeForColorBar(double &minRange, double &maxRange);
                void                    SetColorBarPosition(std::vector<int> &colorbarposition);
                void                    UpdateColorBarPosition();
+        void            ResetRefresh();
                void                    SetwxVtkBaseView(wxVtkBaseView *baseview);
 
                void onThreshold();