[vtkusers] VTK : vtkLookupTable blues..

Luke J West ljw at soc.soton.ac.uk
Tue Sep 9 10:56:09 EDT 2003


Hi,

I can get vtkLookupTable to respond to SetHueRange, SetSaturationRange and
SetValueRange, to create just the colourtable I want, but it ignores calls to
SetTableRange, and continues to map the colourtable onto the data range [0,1],
which I assume is the default behavior. I've tried to do this in numerous pieces
of code, but to no avail.

any ideas?

here is my pipeline from vtkStructuredGrid to vtkActor...

thanks,

luke


  vtkStructuredGrid* topog_grd = vtkStructuredGrid::New();
   topog_grd->SetDimensions(NX(),NY(),1);
   topog_grd->SetPoints(topog_pts);
   topog_pts->Delete();
   topog_grd->GetPointData()->SetScalars(topog_arr);
                                                                              
                              
  vtkContourFilter* topog_con = vtkContourFilter::New();
   topog_con->SetInput(topog_grd);
   topog_con->GenerateValues(Nz(),0,1000);
                                                                              
                              
  vtkLookupTable* topog_lut = vtkLookupTable::New();
   topog_lut->SetTableRange     (0,1000); // has no effect
   topog_lut->SetHueRange       ( 0, 1);
   topog_lut->SetSaturationRange( 1, 1);
   topog_lut->SetValueRange     ( 1, 1);
                                        
  vtkStructuredGridGeometryFilter* topog_geo =
vtkStructuredGridGeometryFilter::New();
   topog_geo->SetInput(topog_grd);
   topog_geo->SetExtent(0,NX(),0,NY(),0,0);
                                            
  vtkPolyDataMapper* topog_map = vtkPolyDataMapper::New();
   topog_map->SetLookupTable(topog_lut);
   topog_map->SetInput(topog_con->GetOutput());
                                                
  vtkActor* topog_act = vtkActor::New();
   topog_act->SetMapper(topog_map); 


Luke J West : Research Assistant : e-Science
--------------------------------------------
Rm. 566/12, School of Ocean & Earth Sciences
Southampton Oceanography Centre, Southampton
SO14 3ZH  United Kingdom
--------------------------------------------
Tel: +44 23 8059 4801  Fax: +44 23 8059 3052
Mob: +44 79 6107 4783




More information about the vtkusers mailing list