[vtkusers] vtkSmartPointer

David Doria daviddoria+vtk at gmail.com
Tue May 11 07:21:58 EDT 2010


On Tue, May 11, 2010 at 6:11 AM, Artem Babayan
<artem.paraview at googlemail.com> wrote:
> Hello,
>
> Why does simple statement:
>
> vtkSmartPointer<vtkDataSet> test(vtkSmartPointer<vtkStructuredPoints>::New());
>
> does not compile with the following error:
>
> <..>/vtkSmartPointer.h: In constructor
> `vtkSmartPointer<T>::vtkSmartPointer(const vtkSmartPointer<U>&) [with
> U = vtkStructuredPoints, T = vtkview::vtkDataSet]':
> ../VSSet3dScalarVolumeViewer.cpp:59:   instantiated from here
> <..>/vtkSmartPointer.h:43: no matching function for call to
> `vtkSmartPointer<vtkview::vtkDataSet>::CheckType(vtkStructuredPoints*)'
> <..>/vtkSmartPointer.h:28: candidates are: static T*
> vtkSmartPointer<T>::CheckType(T*) [with T = vtkview::vtkDataSet]
>
> vtkStructurePoints are inherited (ultimately) from vtkDataSet isn't it?
>
> I included vtkStructurePoints.h, vtkDataSet.h, vtkStructuredPoints.h
> and (just in case) vtkImageData.h to the test program, so inheritance
> tree should be known at this point.
>
> Best wishes
> Artem


I've never seen that syntax (although that doesn't mean it doesn't exist.

Try this:

vtkSmartPointer<vtkDataSet> test = vtkSmartPointer<vtkStructuredPoints>::New();

Thanks,

David



More information about the vtkusers mailing list