]> Creatis software - bbtk.git/commitdiff
#3459 Bug Refresh LookupTable SurfaceTexture
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 26 Apr 2021 07:00:02 +0000 (09:00 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 26 Apr 2021 07:00:02 +0000 (09:00 +0200)
packages/std/src/bbstdMathOperationVector.h
packages/vtk/src/bbvtkPolyDataToActor.cxx
packages/vtk/src/bbvtkSurfaceTexture.cxx
packages/vtk/src/bbvtkSurfaceTexture.h

index fe00fbcb18a6d14246c4debd7e98388c13468b4d..9451161113aa6b91c542f0eb1ca8764802b1da98 100644 (file)
@@ -63,7 +63,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(MathOperationVector,bbtk::AtomicBlackBox);
   BBTK_INPUT(MathOperationVector,In7,"Input vector 7",std::vector<double>,"");
   BBTK_INPUT(MathOperationVector,In8,"Input vector 8",std::vector<double>,"");
   BBTK_INPUT(MathOperationVector,In9,"Input vector 9",std::vector<double>,"");
-  BBTK_INPUT(MathOperationVector,Type,"Type (defalult 0): 0  adition (default) In0[i]+In1[i]+..+In9[i], -99 adition In0[i] In1[i] ... In[9], 1 sustraction In0[i]-In1[i]-..-In9[i], 2 multiplication In0[i]*In2[i]*...*In9[i], 3 division In0/In1/.../In9, 4 sqrt In1, 5 log10 In1, 6 exp In1, 7 incremental int [In0..In1], 8 random int [In0..In1], 9 (rad) sin In0, 10 (rad) cos In0, 11 tan (rad) In0, 12 asin In0, 13 acos In0, 14 atan In0, 15 atan2 In0 In1 , 16 min (In0[i],In1[i]..In9[i]), -16 min(In0) min(In1) ... min(In9) , 17 max (In0[i],In1[i]..In9[i]), -17 max(In0) max(In1) ... max(In9) , 18 abs In0 , 19 module In0[i]%In1[i] , 20 lessThan In0[i]<In1[i], 21 greaterThan In0[i]>In1[i], 22 Centre of Mass In0=lstX In1=lstY In2=lstZ In3=lstValues " ,int,"");
+  BBTK_INPUT(MathOperationVector,Type,"Type (defalult 0): 0  adition (default) In0[i]+In1[i]+..+In9[i], -99 adition In0[i] In1[i] ... In[9], 1 sustraction In0[i]-In1[i]-..-In9[i], 2 multiplication In0[i]*In2[i]*...*In9[i], 3 division In0/In1/.../In9, 4 sqrt In1, 5 log10 In1, 6 exp In1, 7 incremental int [In0..In1], 8 random int [In0..In1], 9 (rad) sin In0, 10 (rad) cos In0, 11 tan (rad) In0, 12 asin In0, 13 acos In0, 14 atan In0, 15 atan2 In0 In1 , 16 min (In0[i],In1[i]..In9[i]), -16 min(In0) min(In1) ... min(In9) , 17 max (In0[i],In1[i]..In9[i]), -17 max(In0) max(In1) ... max(In9) , 18 abs In0 , 19 module In0[i]%In1[i] , 20 lessThan In0[i]<In1[i], 21 greaterThan In0[i]>In1[i], 22 Centre of Mass In0=lstX In1=lstY In2=lstZ In3=lstValues, 23 round In0[i], 24 rint In0[i], 25 floor In0[i], 26 ceil In0[i], 27 trunc In0[i]" ,int,"");
 
   BBTK_OUTPUT(MathOperationVector,Out,"Output vector",std::vector<double>,"");
 
index 06c9cc24b7fe6ccc90ce0270e56e5111f145a333..0002d6c097da8fa273ae7dbd89099e41b5fa8359 100644 (file)
@@ -227,7 +227,7 @@ printf("EED WARNNING!  PolyDataToActor::DoProcess  which is the default values o
 //                                     polydatamapper->SetScalarModeToUseCellFieldData();      
 //                                     polydatamapper->SetScalarModeToUseFieldData();    //    1/2     hausdorff->SetTargetDistanceMethodToPointToCell();
 //                                     polydatamapper->SetScalarModeToUsePointData();   // *
-                                       polydatamapper->SetScalarModeToUsePointFieldData();                                     
+                                       polydatamapper->SetScalarModeToUsePointFieldData();
                                        
                                        polydatamapper->SetColorModeToMapScalars();
                                        polydatamapper->SetLookupTable( bbGetInputScalarVisibilityOn_LookupTable() );
index 1e002aa5c9e9617c6482fe14ca654c0ab03c1aaf..ef9d87ed0dcc7d076a21e568c6cb5301bb4755cd 100644 (file)
@@ -49,9 +49,16 @@ void SurfaceTexture::Process()
                int maxX = ext[1]-ext[0]+1;
                int maxY = ext[3]-ext[2]+1;
                int maxZ = ext[5]-ext[4]+1;
-               if (firsttime==true)
+               
+               if (backColorType!=bbGetInputColorType() )
                {
-                       firsttime=false;
+                       backColorType = bbGetInputColorType();
+                       if (colors!=NULL)                               { colors->Delete();                     }
+//                     if (colorLookupTable!=NULL)             { colorLookupTable->Delete();   }
+//                     if (colorLookupTableWL!=NULL)   { colorLookupTableWL->Delete(); }
+                       
+                       
+//                     firsttime=false;
                        // Generate the colors for each point based on the color map
                        colors = vtkUnsignedCharArray::New(); 
                        colors->SetNumberOfComponents(3);
@@ -132,6 +139,9 @@ void SurfaceTexture::Process()
                          colorLookupTable->SetTableValue(11,0.5,0.5,1  ,1);
                        } // type 3
                }  // firsttime
+               
+               
+               
                bbGetInputMesh()->GetPointData()->SetScalars(colors);
                if (bbGetInputColorType()==1)
                {
@@ -198,7 +208,7 @@ void SurfaceTexture::bbUserSetDefaultValues()
        bbSetInputTransform(NULL);
        bbSetInputExternalLookupTable(NULL);
   
-       firsttime                               = true;
+       backColorType                   = -999;
        colors                                  = NULL;
        colorLookupTable                = NULL;
        colorLookupTableWL              = NULL;
index c8108c0dd3ec8a8a21df7932044a42147021aa19..20032a563e36f5cb2c27743aecbc32b0751fd375 100644 (file)
@@ -36,7 +36,7 @@ class bbvtk_EXPORT SurfaceTexture
   void Process();
 
 
-       bool                                            firsttime;
+       int                                             backColorType;
        vtkUnsignedCharArray            *colors;
        vtkScalarsToColors                      *generalLookupTable;
        vtkLookupTable                          *colorLookupTable;