X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkSurfaceTexture.cxx;h=ef9d87ed0dcc7d076a21e568c6cb5301bb4755cd;hb=9bf93d26c92029689cb5da02822edb68d5835864;hp=0fe8f31492db37b5f9a9cdbdad900098ef8b1452;hpb=cc8fc303bb892d48d17a1534b5b1c54eaa7118fb;p=bbtk.git diff --git a/packages/vtk/src/bbvtkSurfaceTexture.cxx b/packages/vtk/src/bbvtkSurfaceTexture.cxx index 0fe8f31..ef9d87e 100644 --- a/packages/vtk/src/bbvtkSurfaceTexture.cxx +++ b/packages/vtk/src/bbvtkSurfaceTexture.cxx @@ -49,13 +49,20 @@ 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); - colors->SetName("Colors"); +// colors->SetName("ColorsEED"); // Create the color map if (bbGetInputColorType()==1) { @@ -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;