- 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);
-
- if (bbGetInputColorType()==1)
- {
- colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
- colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
- }
-
- int missingpoints = bbGetInputMesh()->GetNumberOfPoints() - colors->GetDataSize()/colors->GetNumberOfComponents();
- for(i = 0; i < missingpoints; i++)
- {
- colors->InsertNextTuple3(0,0,0);
- }
-
- if (bbGetInputTransform()!=NULL)
- {
- bbGetInputTransform()->Update();
- }
-
- double gl;
- double p1[3];
- double p2[3];
- double dcolor[3];
- for(i = 0; i < bbGetInputMesh()->GetNumberOfPoints(); i++)
- {
- if (bbGetInputTransform()!=NULL)
+ 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; iLookTable<tableSize*3; iLookTable++)
+ {
+ i=rand() % tableSize;
+ j=rand() % tableSize;
+ colorLookupTable->GetTableValue(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 3
+ } // firsttime
+ bbGetInputMesh()->GetPointData()->SetScalars(colors);
+ if (bbGetInputColorType()==1)
+ {
+ colorLookupTableWL->SetLevel( bbGetInputColorLevel() );
+ colorLookupTableWL->SetWindow( bbGetInputColorWindow() );
+ }
+ if (bbGetInputExternalLookupTable()!=NULL)