[vtk-developers] vtkImageToStructuredPoints missing GetOutput function

Francois Bertel francois.bertel at kitware.com
Wed Feb 3 18:18:02 EST 2010


Hello,

GetOutput() in vtkImageAlgorithm is not virtual so you are not
overriding. If you make GetOutput virtual in vtkImageAlgorithm then it
will be a case of overriding with covariant return type (C++98).
I'm not sure how the VTK wrappers handle that. I remember some red
dashboard with java in the past because either the VTK wrapper was not
allowing covariant return type or the JDK at this time was not
supporting it.

Anyway, some other classes just add a new method instead, like
"GetStructuredPointsOutput()".

Just my 2 cents. Any other suggestions are welcome.


On Wed, Feb 3, 2010 at 5:45 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> The GetOutput function is not overriden in vtkImageToStructuredPoints, so if
> you try to do this:
> vtkStructuredPoints* structuredPoints = i2sp->GetOutput();
> it complains that it can't convert from vtkImageData* to
> vtkStructuredPoints*
> This is fixed by adding:
> vtkStructuredPoints* GetOutput();
> to vtkImageToStructuredPoints.h
> and
> vtkStructuredPoints* vtkImageToStructuredPoints::GetOutput()
> {
>   return vtkStructuredPoints::SafeDownCast(this->GetOutputDataObject(0));
> }
> to vtkImageToStructuredPoints.cxx
> Any objections?
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list