X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fvtk%2Fsrc%2FbbvtkSurfaceTexture.cxx;h=f0b0be3f9e50dbcfc4218734eb219898c3b51d9f;hb=2ab6bff6c5478054c4fdc9d37304b28151251acb;hp=3e0f81ac70694ef2f423c9c700611b9aba5b628f;hpb=77d3a1538d87248a3f09105b30af8b7f0ecbfba6;p=bbtk.git diff --git a/packages/vtk/src/bbvtkSurfaceTexture.cxx b/packages/vtk/src/bbvtkSurfaceTexture.cxx index 3e0f81a..f0b0be3 100644 --- a/packages/vtk/src/bbvtkSurfaceTexture.cxx +++ b/packages/vtk/src/bbvtkSurfaceTexture.cxx @@ -5,7 +5,7 @@ #include "bbvtkPackage.h" #include - +#include namespace bbvtk { @@ -33,7 +33,6 @@ void SurfaceTexture::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]); } // for iLookTable +//EED 2018-06-8 ***********************ARDS Projet*********************************************** + if (bbGetInputColorType()==2) + { + int tableSize=256; + colorLookupTable = vtkLookupTable::New(); +// colorLookupTable->SetNumberOfTableValues(tableSize); + colorLookupTable->SetTableRange(range[0],range[1]); +// colorLookupTable->SetTableRange(0,11); + colorLookupTable->Build(); + +/* + for (unsigned int i = 0; i < tableSize; ++i) + { + colorLookupTable->SetTableValue(i, + vtkMath::Random(.25, 1.0), + vtkMath::Random(.25, 1.0), + vtkMath::Random(.25, 1.0), + 1.0); + } +*/ + + double rgba1[4]; + double rgba2[4]; + int i,j; + for (int iLookTable = 0; iLookTableGetTableValue(i, rgba1); + colorLookupTable->GetTableValue(j, rgba2); + + colorLookupTable->SetTableValue(j, rgba1[0],rgba1[1],rgba1[2],rgba1[3]); + colorLookupTable->SetTableValue(i, rgba2[0],rgba2[1],rgba2[2],rgba2[3]); + } // for iLookTable + + } // type 2 + + + if (bbGetInputColorType()==3) + { + int tableSize=13; + colorLookupTable = vtkLookupTable::New(); + colorLookupTable->SetNumberOfTableValues(tableSize); + colorLookupTable->SetTableRange(6,range[1]); + colorLookupTable->Build(); + + colorLookupTable->SetTableValue(0, 1 ,1 ,1 ,1); + colorLookupTable->SetTableValue(1, 1 ,0 ,0 ,1); + colorLookupTable->SetTableValue(2, 0 ,1 ,0 ,1); + colorLookupTable->SetTableValue(3, 0 ,0 ,1 ,1); + colorLookupTable->SetTableValue(4, 0 ,1 ,1 ,1); + colorLookupTable->SetTableValue(5, 1 ,1 ,0 ,1); + colorLookupTable->SetTableValue(6, 1 ,0 ,1 ,1); + + colorLookupTable->SetTableValue(7, 0.5,1 ,1 ,1); + colorLookupTable->SetTableValue(8, 1 ,0.5,1 ,1); + colorLookupTable->SetTableValue(9, 1 ,1 ,0.5,1); + + colorLookupTable->SetTableValue(10,1 ,0.5,0.5,1); + colorLookupTable->SetTableValue(11,0.5,0.5,1 ,1); + + } // type 2 + + + + } bbGetInputMesh()->GetPointData()->SetScalars(colors);