[vtkusers] Contouring (again)

Robbie Banks robbie.banks at gmail.com
Mon Jul 19 20:52:35 EDT 2010


Hi all,

Sorry to bring up contouring again, but I have a little problem.

I have created a PolyDataMapper from a RectilinearGrid in 3D, each point has
a location and a scalar value associated with it. I wish to create a Contour
filter to create an isosurface in the plot for a given scalar value.

I create the contour filter and read in the data like below:

	vtkSmartPointer<vtkContourFilter> pContourFilter =
vtkSmartPointer<vtkContourFilter>::New();
	pContourFilter->SetInput(pActor->GetMapper()->GetInput());
	double range[2];
	pActor->GetMapper()->GetInput()-GetScalarRange(range);
	pContourFilter->SetValue(0,range[1]); 

	vtkSmartPointer<vtkPolyDataMapper> pMapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
	pMapper->SetInputConnection(pContourFilter->GetOutputPort());

	etc.....

This forms a single line round the outside of the volume at the value
specified. However, as stated I'm after a contour surface. Where am I going
wrong?

Is the GetMapper()->GetInput() only returning the outer values of the
PolyData.

How can I create the whole surface?

Thanks
Robbie




More information about the vtkusers mailing list