[vtkusers] Overriding RequestData() (Ellipsoid source)

Jérôme jerome.velut at gmail.com
Mon Oct 12 07:43:17 EDT 2009


Hi,
I quickly gave a watch. Since your class derives from vtkSphereSource, your
vtkTypeRevisionMacro should do the same:
   vtkTypeRevisionMacro( vtkEllipsoidSource, vtkSphereSource );

If it does'nt, your filter 'tells' that it is -in the oo sense- a
vtkPolyDataAlgorithm, but not a vtkSphereSource. So you have conflict
between pure C++ and VTK object approach.
- C++ : vtkEllipsoidSource derives from vtkSphereSource, the compiler stays
quiet.
- VTK : vtkEllipsoidSource "IsA" vtkPolyDataAlgorithm. The error seems to
deal with the differences between vtkSphereSource and vtkPolyDataAlgorithm.
Especially, Execute is an old method that certainly exists in
vtkSphereSource -old old source-, but *maybe* not, or in
vtkPolyDataAlgorithm that comes from vtk-5.x design.

For the RequestInformation redefinition in your class, I really don't know.
I effectively implement it when I need to pre-define some parameters. In
your case, It could be the EllipsoidTransform member's parameters set...

HTH,
Jerome

2009/10/12 David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
>

> I am trying to create an ellipsoid source by simply creating a subclass of
> vtkSphereSource and applying a transformation to it. Before even writing the
> transformation code, I wanted to make sure the new subclass was working
> properly so I created a quick test VisualizeEllipsoid.cpp (this along with
> the vtkEllipsoidSource class can be found here:
> http://www.rpi.edu/~doriad/VTK_List/vtkEllipsoidSource/<http://www.rpi.edu/%7Edoriad/VTK_List/vtkEllipsoidSource/>
> )
>
> If I do not override RequestData(), the example works properly and displays
> a sphere. However if I override RequestData to simply call the parent class
> (SphereSource) RequestData function, I get the following error:
>
> vtkEllipsoidSource (0x8b27df8): Definition of Execute() method should be in
> subclass and you should really use the ExecuteData(vtkInformation
> *request,...) signature instead
>
> Can anyone explain what this means? Also, it looks like the
> RequestInformation function of vtkSphereSource is creating a bounding box.
> What is this used for? (i.e. do I actually need to override
> RequestInformation for the new source to find the ellipsoid's bounding box?)
>
> Thanks,
>
> David
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091012/be156707/attachment.htm>


More information about the vtkusers mailing list