Combine two filters into one in Custom Application

Hi,

I want to combine two filters (calculator and glyph to be specific) into one filter in my custom application. How can I achieve that?

P.S I don’t want to create a custom filter in the GUI, but want to create a filter when the application is built it should be there

I think some of the examples have custom filters in the repository. ElevationFilter maybe?

I am sorry if my original question was not clear.
I don’t want to create a new filter but combine two filters which are already in Paraview (glyph and calculator).

ElevationFilter does not combine two filter but only inherits from one existing filter (vtkElevationFilter).

I could not find an example of a filter which is a combination of two filters or inherits two filters.

VTK doesn’t do multiple inheritance anyways. You’ll need to make a new filter of the appropriate type and drive the other filters internally (basically, “composition over inheritance”). ParaView has a few that do this, but I can’t remember exactly. Maybe one of the image reader meta filters?

Yeah I get that, and I was also thinking of doing composition instead of inheritance.

I was not able to find an example in paraview filters that uses composition would you be able to tell me the name?

And how do you decide from which vtk filter should we inherit, for example for calculator and glyph should I choose vtkPassInputTypeAlgorithm or vtkPolyDataAlgorithm?

And I am unable to include vtkPVArrayCalculator.h or vtkPVGlyphFilter.h in my code, even though I am able to include other vtk files. Do I need to add something to vtk.module file?

They seem to live in the ParaView::VTKExtensionsFiltersGeneral module.

1 Like

Yes I am using vtkPVArrayCalculator and vtkPVGlyphFilter from there. But was not able to find an example of filter which uses composition to combine two filters.

Is there any other way to combine two filters? Maybe somehow use the XML file generated from the custom filter in Paraview’s GUI?

I think you’re now in @mwestphal or @cory.quammen territory now. I’m mainly the build/process guy and only have a very basic coverage of actually using ParaView.

Ah I see, but would you be able to pinpoint to an example which uses composition to combine two or more filters into one?