[vtkusers] can't find function vtkContourFilter::SetInput(vtkImageData*)

Mackenzie L. Cowell cowell at arsc.edu
Mon Aug 2 13:32:44 EDT 2004


Hello dear list members!

I'm using an implicit modeller to generate a scalar field around
a sort of stick figure I made (which is simply a collection of points and
lines in a vtkPolyData object), and then using vtkContourFilter to
generate an isosurface from that scalar field (which is, I believe,
generated as vtkImageData.

I was inspired to do this by the hello.tcl example, and the little program
I wrote works perfectly *in* tcl.  I need to port it over to c++, and it's
there that I'm running into problems.

Here is the relevent c++ code:  (awData is the stick figure)

	vtkImplicitModeller * imp = vtkImplicitModeller::New();
		imp->SetInput( awData );
		imp->SetSampleDimensions( 80, 80, 256 );  //resolution
		imp->SetMaximumDistance( 4 );  //perimiter of calculation
		imp->SetModelBounds( -15, 20, -5, 5, -1.0, 50.0 );

	vtkContourFilter * contour = vtkContourFilter::New();
		contour->SetInput( imp->GetOutput() );
		contour->SetValue( 0, 1.0 );
	vtkPolyDataMapper * impMapper = vtkPolyDataMapper::New();
		impMapper->SetInput( contour->GetOutput() );
		impMapper->ScalarVisibilityOff();

However!  I get this funky compile-time error:

/imports/archive/u1/uaf/cowell/airway/airway.cxx:113: no matching function
for
   call to `vtkContourFilter::SetInput(vtkImageData*)'
/imports/projects/UAFINSP/vtk-src/Filtering/vtkDataSetToPolyDataFilter.h:44:
candidates
   are: virtual void vtkDataSetToPolyDataFilter::SetInput(vtkDataSet*)

Am I just setting up the pipeline wrong?  It works fine in tcl:

vtkContourFilter contour
	contour SetInput [imp GetOutput]

anyway, your help is desperately needed and appreciated!
thanks!

Mac Cowell
Summer Intern
Arctic Region Supercomputing Center
Fairbanks, AK



More information about the vtkusers mailing list