Hello,
is it possible to creat a dynamic UI with the vtkPythonAlgorithm filter model ?
example, having in my python plugin UI multiple “range value slider”, their number depending on the loaded data.
Thanks for help !
Hello,
is it possible to creat a dynamic UI with the vtkPythonAlgorithm filter model ?
example, having in my python plugin UI multiple “range value slider”, their number depending on the loaded data.
Thanks for help !
I do not think so.
A widget is the UI to control a given property of your filter, and those are statically defined. Some widget can have repeatable entries (example: table where user can add/delete rows at runtime) but nothing like that with sliders.
What are you trying to achieve exactly ?
Hello, thanks for your clear answer,
for my problem, i need to recompose a field from several fields (the number is variable), and for this recomposition i need one scalar per field,
In qt or another UI API it was simple since widgets are objects and can be created at run time dynamicly, but here they are defined with a decorator. I try to add a function to the instantiated object on the filter constructor with the __ get__.(self) method, I got no error message but the widget did not appear on the panel’ :
@smproperty.intvector(name=“ThetaResolution”, default_values=16)
def SetThetaResolution(self, x):
___self.Theta=x
___self.Modified()
self.SetThetaResolution=SetThetaResolution.__get __(self)
Another solution is to have a (smproperty.stringvector) to list the fields names and one slider, so I can assign the input value to the selected field, but I found that I can’t get informations about the input data before RequestData is called.
BR
For such thing, ParaView only provides table-based widget, still no slider. You will not be able to add property and corresponding widgets at runtime.
if arrays order is well known, you can add repeatable_command="1"
in the intvector
decorator. You will have a 1-column table, and user can add / remove rows at runtime and manually specify values. See this example
You should define your property as a stringvector, with two string elements per command.
You can init this table with array names with the appropriate domain, see this example
Many drawbacks with this one: second column is named “New Name” and is init with array names…
thanks for your advice