// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
bbGetInputImage()->GetWholeExtent(ext);
#else
bbGetInputImage()->GetExtent(ext);
#endif
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
bbGetInputImage()->GetWholeExtent(ext);
#else
bbGetInputImage()->GetExtent(ext);
#endif
int maxX = ext[1]-ext[0]+1;
int maxY = ext[3]-ext[2]+1;
int maxZ = ext[5]-ext[4]+1;
int maxX = ext[1]-ext[0]+1;
int maxY = ext[3]-ext[2]+1;
int maxZ = ext[5]-ext[4]+1;
if (firsttime==true)
{
firsttime=false;
// Generate the colors for each point based on the color map
colors = vtkUnsignedCharArray::New();
colors->SetNumberOfComponents(3);
if (firsttime==true)
{
firsttime=false;
// Generate the colors for each point based on the color map
colors = vtkUnsignedCharArray::New();
colors->SetNumberOfComponents(3);
{
colorLookupTable->GetTableValue( iLookTable, rgba1);
colorLookupTable->GetTableValue(256-1-iLookTable, rgba2);
{
colorLookupTable->GetTableValue( iLookTable, rgba1);
colorLookupTable->GetTableValue(256-1-iLookTable, rgba2);
colorLookupTable->SetTableValue(256-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
colorLookupTable->SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
} // for iLookTable
colorLookupTable->SetTableValue(256-1-iLookTable , rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
colorLookupTable->SetTableValue( iLookTable , rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
} // for iLookTable
colorLookupTable->SetTableValue(j, rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
colorLookupTable->SetTableValue(i, rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
} // for iLookTable
colorLookupTable->SetTableValue(j, rgba1[0],rgba1[1],rgba1[2],rgba1[3]);
colorLookupTable->SetTableValue(i, rgba2[0],rgba2[1],rgba2[2],rgba2[3]);
} // for iLookTable
colorLookupTable->SetNumberOfTableValues(tableSize);
colorLookupTable->SetTableRange(6,range[1]);
colorLookupTable->Build();
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(0, 1 ,1 ,1 ,1);
colorLookupTable->SetTableValue(1, 1 ,0 ,0 ,1);
colorLookupTable->SetTableValue(2, 0 ,1 ,0 ,1);
colorLookupTable->SetTableValue(4, 0 ,1 ,1 ,1);
colorLookupTable->SetTableValue(5, 1 ,1 ,0 ,1);
colorLookupTable->SetTableValue(6, 1 ,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(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);
colorLookupTable->SetTableValue(10,1 ,0.5,0.5,1);
colorLookupTable->SetTableValue(11,0.5,0.5,1 ,1);
if (bbGetInputColorType()==1)
{
colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
}
if (bbGetInputColorType()==1)
{
colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
}
if (bbGetInputExternalLookupTable()!=NULL)
{
generalLookupTable = bbGetInputExternalLookupTable();
} else {
generalLookupTable = colorLookupTable;
}
if (bbGetInputExternalLookupTable()!=NULL)
{
generalLookupTable = bbGetInputExternalLookupTable();
} else {
generalLookupTable = colorLookupTable;
}
int missingpoints = bbGetInputMesh()->GetNumberOfPoints() - colors->GetDataSize()/colors->GetNumberOfComponents();
for(i = 0; i < missingpoints; i++)
{
colors->InsertNextTuple3(0,0,0);
}
int missingpoints = bbGetInputMesh()->GetNumberOfPoints() - colors->GetDataSize()/colors->GetNumberOfComponents();
for(i = 0; i < missingpoints; i++)
{
colors->InsertNextTuple3(0,0,0);
}
if ( (p2[0]>=0) && (p2[0]<maxX) && (p2[1]>=0) && (p2[1]<maxY) &&(p2[2]>=0) && (p2[2]<maxZ) )
{
gl = bbGetInputImage()->GetScalarComponentAsDouble(round(p2[0]), round(p2[1]), round(p2[2]),0);
if ( (p2[0]>=0) && (p2[0]<maxX) && (p2[1]>=0) && (p2[1]<maxY) &&(p2[2]>=0) && (p2[2]<maxZ) )
{
gl = bbGetInputImage()->GetScalarComponentAsDouble(round(p2[0]), round(p2[1]), round(p2[2]),0);
colors->SetTuple3(i,255*dcolor[0],255*dcolor[1],255*dcolor[2]);
} // for i
bbGetInputMesh()->Modified();
colors->SetTuple3(i,255*dcolor[0],255*dcolor[1],255*dcolor[2]);
} // for i
bbGetInputMesh()->Modified();