[vtkusers] Re: scalar visualization question

Bill Greene w_h_greene at yahoo.com
Tue Apr 5 12:37:59 EDT 2005


Amy Squillacote wrote:
> Hi Bill,
> 
> If your data set is polygonal, try vtkBandedPolyDataContourFilter.
> 

Yes, vtkBandedPolyDataContourFilter would seem to be what I'm looking 
for. But, I've tried for a couple of days and can't seem to make it 
work. I've attached a small snippet of code. When I run it with:

vtkContourFilter *contours = vtkContourFilter::New();

I get 6 contour lines colored from red to blue. But when I run it with

vtkBandedPolyDataContourFilter *contours = 
vtkBandedPolyDataContourFilter::New();

the entire rectangular region is red. I know there must be a simple 
solution to this but, so far, I haven't been able to find it.

Any help much appreciated.

Bill

--------------------------------------------------------
vtkContourFilter *contours = vtkContourFilter::New();
   //vtkBandedPolyDataContourFilter *contours = 
vtkBandedPolyDataContourFilter::New();
   contours->SetInput(quad);
   contours->GenerateValues(8, quad->GetScalarRange());


   vtkPolyDataMapper *quadMapper = vtkPolyDataMapper::New();
   quadMapper->SetInput(contours->GetOutput());
   quadMapper->SetScalarRange(10,maxS);





More information about the vtkusers mailing list