// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- if (firsttime==true)
+printf("EED ScalarsToColors::Process Start\n");
+ if (firsttime==true)
{
firsttime=false;
-
// Create the color map
if (bbGetInputType()==0)
{
_colorLookupTable = vtkLookupTable::New();
- _colorLookupTable->Build();
- double rgba1[4];
- double rgba2[4];
- for (int iLookTable = 0; iLookTable<128; iLookTable++)
- {
+ if (bbGetInputRange().size()==2)
+ {
+ _colorLookupTable->SetRange( bbGetInputRange()[0],bbGetInputRange()[1]);
+// _colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]);
+ } else {
+ _colorLookupTable->SetRange(0,255);
+ }
+ _colorLookupTable->SetNumberOfTableValues(1000);
+ _colorLookupTable->Build();
+ double rgba1[4];
+ double rgba2[4];
+ int iLookTable;
+ for (iLookTable = 0; iLookTable<500; iLookTable++)
+ {
_colorLookupTable->GetTableValue( iLookTable, rgba1);
- _colorLookupTable->GetTableValue(256-1-iLookTable, rgba2);
-
- _colorLookupTable->SetTableValue(256-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
+ _colorLookupTable->GetTableValue(1000-1-iLookTable, rgba2);
+ _colorLookupTable->SetTableValue(1000-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
_colorLookupTable->SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
} // for iLookTable
- } // if
- } // firsttime
-
- if (bbGetInputRange().size()==2)
- {
- _colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]);
- } else {
- _colorLookupTable->SetTableRange( 0,1 );
- }
-
- double rgb[3];
- _colorLookupTable->GetColor( bbGetInputScalarValue() , rgb );
- std::vector<double>colorRGB;
- colorRGB.push_back( rgb[0] );
- colorRGB.push_back( rgb[1] );
- colorRGB.push_back( rgb[2] );
-
- bbSetOutputColor( colorRGB );
- bbSetOutputLookupTable(_colorLookupTable);
-
+ double rgba[4];
+ _colorLookupTable->GetTableValue(0,rgba);
+ rgba[3]=0;
+ _colorLookupTable->SetTableValue(0,rgba);
+
+ int i,iMax=200;
+ for (i=0;i<iMax;i++)
+ {
+ _colorLookupTable->GetTableValue(500+100+i, rgba);
+ rgba[3]=(double)i/(double)iMax;
+ _colorLookupTable->SetTableValue(500+100+i,rgba);
+ _colorLookupTable->GetTableValue(500-100-i, rgba);
+ rgba[3]=(double)i/(double)iMax;
+ _colorLookupTable->SetTableValue(500-100-i,rgba);
+ } // for
+
+ iMax=100;
+ for (i=0;i<iMax;i++)
+ {
+ _colorLookupTable->GetTableValue(500+i, rgba);
+ rgba[3]=0;
+ _colorLookupTable->SetTableValue(500+i,rgba);
+ _colorLookupTable->GetTableValue(500-i, rgba);
+ rgba[3]=0;
+ _colorLookupTable->SetTableValue(500-i,rgba);
+ } // for
+
+ } // if Type 0
+
+//EED 2018-06-8 ***********************ARDS Projet***********************************************
+ if (bbGetInputType()==1)
+ {
+ _colorLookupTable = vtkLookupTable::New();
+ if (bbGetInputRange().size()==2)
+ {
+ _colorLookupTable->SetRange( bbGetInputRange()[0],bbGetInputRange()[1]);
+// _colorLookupTable->SetTableRange( bbGetInputRange()[0],bbGetInputRange()[1]);
+ } else {
+ _colorLookupTable->SetRange(0,255);
+ }
+ _colorLookupTable->SetValueRange(0.0, 1.0); // from black to white
+ _colorLookupTable->SetSaturationRange(0.0, 0.0); // no color saturation
+ _colorLookupTable->SetRampToLinear();
+ _colorLookupTable->Build();
+ double rgba[4];
+ _colorLookupTable->GetTableValue(0,rgba);
+ rgba[3]=0;
+ _colorLookupTable->SetTableValue(0,rgba);
+ } // IF
+
+
+
+
+ } // firsttime
+
+ double rgb[3];
+ std::vector<double>colorRGB;
+ _colorLookupTable->GetColor( bbGetInputScalarValue() , rgb );
+ colorRGB.push_back( rgb[0] );
+ colorRGB.push_back( rgb[1] );
+ colorRGB.push_back( rgb[2] );
+ bbSetOutputColor( colorRGB );
+ bbSetOutputLookupTable(_colorLookupTable);
+
+printf("EED ScalarsToColors::Process End\n");
+
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)