[vtkusers] How to "charge" a Lookuptable color

Armeni Davide Davide.Armeni at TILAB.COM
Fri Sep 24 02:50:51 EDT 2004


Hi everyone,
I want to post a simplest question to u:

When i write a lookup table directly in an UnstructuredGrid file,
i've to set some property in the code that read the file ?

Or I must only indicate the input file ... ?
to read the "lut" table i have to explicit in the code ... ?

CODE:
  vtkUnstructuredGridReader *part = vtkUnstructuredGridReader::New();
 
part->SetFileName("/vtkexamples/UGridEx1.vtk");
part->SetScalarsName("scalars");
 
part->Update();

vtkDataSetMapper *partMapper = vtkDataSetMapper::New();
 
partMapper->SetInput((vtkDataSet*)part->GetOutput());
 
vtkLODActor *partActor = vtkLODActor::New();
  
 partActor->SetMapper(partMapper);
 partActor->RotateX(30.0);
 partActor->RotateY(-45.0);

  vtkRenderer *ren1 = vtkRenderer::New();
  vtkRenderWindow *renWin = vtkRenderWindow::New();
  renWin->AddRenderer(ren1);
  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
  iren->SetRenderWindow(renWin);
  
  ren1->AddActor(partActor);
  ren1->SetBackground(1.0, 1.0, 1.4);
   
  renWin->SetSize(800, 800);
  
  renWin->Render();
  
  iren->Start();

  part->Delete();
  partMapper->Delete();
  partActor->Delete();
  ren1->Delete();
  renWin->Delete();
  iren->Delete();

  return 0;
}



example:
# vtk DataFile Version 4.0
Unstructured Grid Example
ASCII
DATASET UNSTRUCTURED_GRID
POINTS n float
0.0 0.0 0.0
....

CELLS n m
3 1 5 0
...

CELL_TYPES n
5
...

POINT_DATA n
SCALARS scalars int 1
LOOKUP_TABLE lut
6
...
coeff(n)

LOOKUP_TABLE lut 8
1.0 0.0 0.4 1.0
0.0 1.0 1.0 1.0
0.0 0.0 1.0 1.0
0.4 0.4 0.6 1.0
0.0 0.0 1.0 1.0
1.0 0.0 1.0 1.0
0.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0


Gruppo Telecom Italia - Direzione e coordinamento di Telecom Italia S.p.A.

====================================================================
CONFIDENTIALITY NOTICE
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please send an e_mail to 
MailAdmin at tilab.com. Thank you
====================================================================



More information about the vtkusers mailing list