X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkSurfaceTexture.cxx;h=ef9d87ed0dcc7d076a21e568c6cb5301bb4755cd;hb=ab91e25f4ca81c10788da1fdd681a87f1f17641e;hp=1e002aa5c9e9617c6482fe14ca654c0ab03c1aaf;hpb=d8dcda9f784877269a0f7f2c17092202428397a8;p=bbtk.git diff --git a/packages/vtk/src/bbvtkSurfaceTexture.cxx b/packages/vtk/src/bbvtkSurfaceTexture.cxx index 1e002aa..ef9d87e 100644 --- a/packages/vtk/src/bbvtkSurfaceTexture.cxx +++ b/packages/vtk/src/bbvtkSurfaceTexture.cxx @@ -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;