]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkSurfaceTexture.cxx
#3459 Bug Refresh LookupTable SurfaceTexture
[bbtk.git] / packages / vtk / src / bbvtkSurfaceTexture.cxx
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;