[Paraview] Multiple inheritance in filter writing

Berk Geveci berk.geveci at kitware.com
Tue Jan 6 11:44:03 EST 2009


I am afraid there is no solution. VTK does not support multiple
inheritance. I recommend using HasA instead of IsA.

-berk

On Tue, Jan 6, 2009 at 11:20 AM, Benjamin Schindler
<bschindler at student.ethz.ch> wrote:
> Hi
>
> I've got a filter which is shared among a paraview plugin and some other
> tools. That's why it inherits a basic threading class to simplify writing
> threaded filters.
>
> The filter is defined as follows:
>
> class vtkMyFilter: public vtkUnstructuredGridAlgorithm, public
> vtkThreadedFilter
>
> The ThreadedFilter class has a vtk prefix to make the parser happy....
> Anyway, I run this filter, because in the generated file:
> vtkMyFilterClientServer.cxx, there is a function defined and used called:
>
> int vtkThreadedFilterCommand(vtkClientServerInterpreter*, vtkObjectBase*,
> const char*, const vtkClientServerStream&, vtkClientServerStream&
> resultStream);
>
> Obviously, such a function is defined for every base class - but the one
> above does not exist because vtkThreadedFilter is not wrapped. The easy
> solution would be to wrap vtkThreadedFilter, but this requires the
> definition of the New, SafeDownCast etc macros like in every other vtk
> object. However, since vtkThreadedFilter is not a vtk Object by themselves,
> it does not have a vtk baseclass and therefore, I cannot declare the macro
> vtkTypeRevisionMacro.
>
> Is there a simple solution to this mess?
>
> Thanks
> Benjamin
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list