[vtkusers] Re: can't find function vtkContourFilter::SetInput(vtkImageData*) ŒQÿ¿

Irene Tedjo Irene.Tedjo at gmx.de
Wed Aug 4 03:17:44 EDT 2004


>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*) 
>  
 
Hi Mac, 
 
by c++ you should convert the data structure explicitly 
because vtkImageData is a subclass of vtkDataSet. Try to do 
this: 
  
vtkContourFilter * contour = vtkContourFilter::New(); 
         contour->SetInput( (vtkDataSet*)imp->GetOutput() ); 
         contour->SetValue( 0, 1.0 ); 
 
Good luck. 
 
Irene 
 
 

-- 
NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl




More information about the vtkusers mailing list