[vtkusers] Problems with visualizing multiple scalars on vtkDataSetMapper

Gerrick Bivins gbivins at objectreservoir.com
Fri Jul 11 13:08:32 EDT 2008


Hi Sarah,
How are you setting up your mapper?

I use a lookup table and setup my mapper something like this:
...
 lut = new vtkLookupTable();
 lut.SetNumberOfTableValues(256);
 lut.SetHueRange( 2.0f / 3.0f, 0.0f );
        
 mapper = new vtkPolyDataMapper();
 mapper.SetLookupTable( lut );
 mapper.SetScalarModeToUsePointFieldData();
...

Then anytime I change the current scalar, I update the mapper:

void updateCurrentScalarForMapper( String currentScalar,
                                   double [] currentScalarRange )
{
   mapper.SelectColorArray( currentScalar );
   mapper.SetScalarRange( currentScalarRange );
} 



Gerrick


On 7/11/08 11:46 AM, "Sarah Macumber" <S.Macumber at QuestReliability.com>
wrote:

> Hi, 
>  
> I have 2D / 3D data so I am using an vtkUnstructuredGrid & a vtkDataSetMapper
> to visualize my data.  My data has several associated scalar values which I
> want to be able to switch between for coloring purposes.  Calling SetScalars
> with the new scalar value does not update the visualization pipeline as
> described in this thread :
> Grid.GetCellData().SetScalars(currentScalars);
> 
> http://www.vtk.org/pipermail/vtk-developers/2007-September/004700.html
> <http://www.vtk.org/pipermail/vtk-developers/2007-September/004700.html>
> 
> but I still don't fully understand what to do about it.
> 
> What is the best way to switch your viewable scalar value on a
> vtkUnstructuredGrid?
> 
> Thanks, Sarah
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list