[vtkusers] error while creating new instance of vtkStructuredGridToPolyDataFilter

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Aug 11 17:38:44 EDT 2005


What is the statement that is raising this error?
 From your message I gather you are doing something like this:

vtkStructuredGridToPolyDataFilter* sgpdf = 
vtkInstantiator::CreateInstance("vtkStructuredGridToPolyDataFilter");

this will raise the error you mentioned since 
vtkInstantiator::CreateInstance() returns vtkObject. You need to cast it
to vtkStructuredGridToPolyDataFilter.

try this:
vtkStructuredGridToPolyDataFilter* sgpdf = 	
   vtkStructuredGridToPolyDataFilter::SafeDownCast(
   vtkInstantiator::CreateInstance(
   "vtkStructuredGridToPolyDataFilter"));

Ofcourse, this is just a guess of what the error might be, as I don't 
know what statement is causing the error.

Utkarsh
kshivann at engineering.uiowa.edu wrote:
> hi all,
>    i get the error message " error C2440: 'initializing' : cannot convert from
> 'vtkObject *' to 'vtkStructuredGridToPolyDataFilter *'" while creating a new
> instance of vtkStructuredGridToPolyDataFilter * . does anyone know the cause of
> the error.
> 
> thanks
> 
> kiran
> 
> 
> 
> _______________________________________________
> 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