[vtkusers] Easy SetInput Question

Mathieu Malaterre mathieu.malaterre at kitware.com
Mon Jan 9 13:10:17 EST 2006


Willy,

Every time you use a DataObject you need to include the header file. Otherwise the compiler does not know it derives from vtkDataSet.
Also I wouls suggest you to read the FAQ of VTK to get a good start, esp:

http://www.vtk.org/Wiki/VTK_FAQ#Forward_declaration_in_VTK_4.x
http://www.vtk.org/Wiki/VTK_FAQ#The_C.2B.2B_compiler_cannot_convert_some_pointer_type_to_another_pointer_type_in_my_little_program

And VTK Wiki is at:

http://www.vtk.org/Wiki/VTK

HTH
Mathieu

> vtkDataSet is the superclass for all the DataStructures which deal with Volume data. The typecast is because GetOutput usually gives a vtkPolyData while the SetInput wants a vtkDataSet parameter, so it has to be typecast. In our case it works becoz vtkDataSet is a superclass of vtkPolyData.
>    
>   HTH
>    
>   Darshan .
>    
>   PS- Get familiar with OOPS and C++ b4 u touch VTK, or u gonna have a hard time
> 
> Willy <willy_thumber at verizon.net> wrote:
>   Ok, here's an easy one from a supernoob. In the two examples of VTK C++ code, 
> what does the "(vtkDataSet *) mean?
> 
> vtkExtractVOI *evoi = vtkExtractVOI::New();
> evoi->SetInput((vtkDataSet *) PR->GetOutput());
> 
> vtkImageGaussianSmooth *gauss = vtkImageGaussianSmooth::New();
> gauss->SetInput((vtkDataSet *) evoi->GetOutput());
> 
> Anybody want to walk me through these code snippets? I'm trying to learn C++, 
> VTK, ITK, and OOP concepts, all at the same time. It gets a little 
> overwealming at times. Thanks for your help.
> Willy
> 
> _______________________________________________
> 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
>   
> 
> 
> 		
> ---------------------------------
> Yahoo! Photos
>  Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
> 
-------------- next part --------------
_______________________________________________
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