Build plugin that already exists with different SM xml

I’m trying to build paraview plugin Temporal Interpolator outside paraview source because i want to its property DiscreteTimeStepInterval to be displayed in a dropdown list instead of a double input, which is possible, right?.
Since this filter already exists in paraview, I have the source .h|.cxx files and altered ServerManager xml, however, I’m puzzled over the Module file. I’m not sure which module it depends on and so I simiply copied an example and CMake reported errors:
CMake Error at E:/ParaView-Build/lib/cmake/paraview-5.7/ParaViewPlugin.cmake:532 (message):
Unparsed arguments for paraview_add_plugin:
MODULE;TemporalInterpolator::TemporalaInterpolator

How should I fix this, or is there any convenient way to do this?

Thanks for any advice.

Yoshino.

is there any convenient way to do this?

Yes, XML plugins. https://kitware.github.io/paraview-docs/latest/cxx/PluginHowto.html : XML plugins part.

You will not need to build anything, just rewrite the XML of the filter as you see fit.

Thanks! It works and I’m able to choose the new filter in the alphabetical filter menu.

However, as I mentioned above, a drop down list is what I want, and I changed the XML property to <EnumerationDomain with several Entry as Plugin_HowTo#Drop down list describes. As a result, the property DiscreteTimeStepValue was displayed without a dropdown list, nor even any input, just like this:
image
Is the GUI parameter EnumerationDomain deprecated or it won’t work in this case?

Can you share the xml you are using ?

Here is my XML, I copy this from the filters.xml from paraview source and made little modification.
MultiTimeResolution.xml (2.7 KB)

The DoubleVectorProperty does not support enumeration domain sadly.
I’m afraid you need to create a class inheriting vtkTemporalInterpolator with its own int interface, then you could be able to control it from an IntVectorProperty.

1 Like

https://gitlab.kitware.com/paraview/paraview/-/issues/19977

But it will lose its meaning if set to int type, it has to be double(0.0~1.0) for interpolation. Do you think it possible for me to create a custom property widget(e.g. Exclusive QGroupBox), which has almost identical function, to show this property? Or the DoubleVectorProperty is just incompatible with any enum type widgets?

I think I found the solution. The property DiscreteTimeStepValue could be used to both aggregate(when set >1) and interpolate(when set between 0~1) dataset timesteps, while the latter function could be replaced by another proeprty ResampleFactor, which was not exposed in SM XML. A issue was raised: https://gitlab.kitware.com/paraview/paraview/-/issues/19979.

In my case, I add the property ResampleFactor in sm xml and it works. So I guess there is no need to set DiscreteTimeStepValue to double type, an integar value is all we need plus ResampleFactor. Is it ok for me if I manually change the type of DiscreteTimeStepValue to int from the source?

Well, you can, but it means you are building a patched ParaView.

1 Like

The amazing thing is that I made it work not by rewriting the source but changing the xml property from DoubleVectorProperty to IntVectorProiperty and then the EnumerationDomain works. Here it is:
image
You can see all the enum were listed and ResampleFactor was shown. I hope this is a side-effect other than a potential bug.

but the values are not correct, are they ?

For the double values, which are not needed, they are not, and I’ll remove them. But for the integar values, yes they are, at least I didn’t see any weird result yet. How do you think? :sweat_smile:

Of course, it should work with integer values.

1 Like

Then I have to build this plugin, right?

Yes.

If building is not an option for you, a similar result could be obtained with a PythonAlgorithmPlugin.

1 Like