[Paraview] Multiple inheritance in filter writing

Benjamin Schindler bschindler at student.ethz.ch
Wed Jan 7 03:51:00 EST 2009


Hi

Thanks for the idea - I thought about this (the second trick) as well 
yesterday evening and it seems to work. The nice thing is - I can put it 
into a vtkHacks.cxx and not pollute anything inside my classes

Thanks
Benjamin

John Biddiscombe wrote:
> Benjamin
>
> What happens if you do this...
>
> class vtkMyFilter: public vtkUnstructuredGridAlgorithm
> //BTX
> , public myThreadedFilter
> //ETX
>
> I think I've used that trick before (or something similar, I'll 
> check). If that doesn't remove the offending method instantiation, 
> then why not simply define a dummy method in your vtk class (as long 
> as it is linked in, it should be ok).
>
> int vtkThreadedFilterCommand(vtkClientServerInterpreter*, 
> vtkObjectBase*, const char*, const vtkClientServerStream&, 
> vtkClientServerStream& resultStream)
> {
> return 1 or 0;
> }
>
> JB
>>
>> 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