]> Creatis software - creaMaracasVisu.git/commitdiff
#3253 creaMaracasVisu Bug New Normal - manual paint refresh
authorEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Thu, 2 May 2019 14:20:42 +0000 (16:20 +0200)
committerEduardo DAVILA <davila@ei-ed-606.creatis.insa-lyon.fr>
Thu, 2 May 2019 14:20:42 +0000 (16:20 +0200)
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.h

index 7a8b873dede432bce859965aa3b1ca5c8d0ff03e..f792652e95f4e34fa9cd218277ab2811ea6fbec6 100644 (file)
@@ -126,8 +126,7 @@ void BrushFilter::Run() // virtual
                                {
                                        pixelModify=false;
                                        scalarComponent = _image->GetScalarComponentAsFloat(i,j, k, 0);
-                                       if ((_RangeMin <= scalarComponent)
-                                                       && (scalarComponent <= _RangeMax )) 
+                                       if ((_RangeMin <= scalarComponent) && (scalarComponent <= _RangeMax )) 
                                        {
                                                if (_brushform == 0) 
                                                {
index 07f154411f2b4506c6a7846535dfc797ffa73d09..1e2c470fee85473a3fc10f8a6c307dee1e517e8c 100644 (file)
@@ -96,7 +96,15 @@ void FillFilter::Run() // virtual
                _countRecursiveFillProblem      = 0;
                _countProgressingFill           = 0;
                _usingAuxImageFill                      = false;
+
                ivi                                             = _px + _py*(_maxX+1) + _pz*(_maxX+1)*(_maxY+1);  // index vector image
+
+
+DEF_POINTER_IMAGE_VTK_CREA_set(v_image,ss_image,p_image,st_image,_image)               
+DEF_POINTER_IMAGE_VTK_CREA_set(v_image2,ss_image2,p_image2,st_image2,_image2)          
+
+
+
 //EED01
 //             FillToolRecursive(_px, _py, _pz);
                FillToolRecursive(_px, _py, _pz, ivi);
@@ -133,8 +141,8 @@ void FillFilter::Run() // virtual
 //---------------------------------------------------------------------------
 void FillFilter::FillToolRecursive(int px, int py, int pz,long int ivi) 
 {
-DEF_POINTER_IMAGE_VTK_CREA(v_image,ss_image,p_image,st_image,_image)           
-DEF_POINTER_IMAGE_VTK_CREA(v_image2,ss_image2,p_image2,st_image2,_image2)              
+//ups ??EED   DEF_POINTER_IMAGE_VTK_CREA(v_image,ss_image,p_image,st_image,_image)             
+//ups ??EED   DEF_POINTER_IMAGE_VTK_CREA(v_image2,ss_image2,p_image2,st_image2,_image2)                
 
        _countRecursiveFill++;
        _countProgressingFill++;
@@ -149,14 +157,18 @@ DEF_POINTER_IMAGE_VTK_CREA(v_image2,ss_image2,p_image2,st_image2,_image2)
        {
                if (_usingAuxImageFill == true) 
                {
-                       this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
+//UPS ??EED                    this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
 //EED01
 //                     _auxImageFill->SetScalarComponentFromFloat(px, py, pz, 0, 0);
                        _ptrAuxImageFill[ ivi ]=0;
                }
-               _tmpDistfill = (px-_pxfill)*(px-_pxfill)
-                                       +  (py-_pyfill)*(py-_pyfill)
-                                       +  (pz-_pzfill)*(pz-_pzfill);
+               difX=px-_pxfill;
+               difY=py-_pyfill;
+               difZ=pz-_pzfill;
+               _tmpDistfill = difX*difX + difY*difY + difZ*difZ;
+//             _tmpDistfill = (px-_pxfill)*(px-_pxfill)
+//                                     +  (py-_pyfill)*(py-_pyfill)
+//                                     +  (pz-_pzfill)*(pz-_pzfill);
 
 //if (_countRecursiveFill >1 )
 //{
@@ -217,7 +229,7 @@ GETVALUE2_VTK_CREA(_tmpiglfill2,p_image2,st_image2,ivi)
 
                if (_auxGrayLevelValidationFill == true) 
                {
-                       this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
+//UPS ??EED                    this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
                        if (_image2!=NULL)
                        {
 //EED01
index 3482b2a66e47159810de0a040ad7ade78f730360..9a3e3b8215d7c4c272655538c82c71f86686706a 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "baseFilterManualPaint.h"
 
+
 class FillFilter : public baseFilterManualPaint {
 public:
        FillFilter();
@@ -69,8 +70,29 @@ private:
        int                     _maxYback;
        int                     _maxZback;
 
+
+       int                     difX;
+       int                     difY;
+       int                     difZ;
 protected:
 
+
+//DEF_POINTER_IMAGE_VTK_CREA_definition( v_image , ss_image , p_image , st_image )             
+       double  v_image                 ;
+       int     ss_image                ;
+       char    *p_image                ;
+       int             st_image                ;
+
+//macro not working ???    
+//   DEF_POINTER_IMAGE_VTK_CREA_definition(v_image2,ss_image2,p_image2,st_image2)              
+       double  v_image2                ;
+       int     ss_image2               ;
+       char    *p_image2               ;
+       int             st_image2               ;
+
+
+
+
 };