Filter xml template

Hi all,

I’m creating a new filter along with its Paraview (xml) interface.
In this filter I have a lot of parameters. A parameter is composed of 3 components:

  • a boolean that specifies whether the parameter is given as a constant value or a grid property
  • a constant value (if the previous boolean is false)
  • a grid property (if the previous boolean is true)

I managed to do it for one parameter (cf xml code below), but now I have to do it for many other parameters (only the label and the commands change from one parameter to another).
Is there a way to create a kind of template that I could define once then use any number of times. Maybe there is already one somewhere?

Thank you for your time

Simon

XML code for 1 parameter:

  <IntVectorProperty
        name="UseProperty"
        label="Use property"
        command="SetUseProperty"
        number_of_elements="1"
        default_values="0">
	  <BooleanDomain name="bool"/>
  </IntVectorProperty>

 <DoubleVectorProperty 
    name="Constant" 
    label="Constant" 
    command="SetConstant" 
    number_of_elements="1"
    default_values="0">
    <Hints>
        <PropertyWidgetDecorator type="ShowWidgetDecorator">
            <Property name="UseProperty" function="boolean_invert" />
        </PropertyWidgetDecorator>
    </Hints>
 </DoubleVectorProperty>

 <StringVectorProperty name="Property"
                        label="Property"
                        command="SetProperty"
                        number_of_elements="1"
                        animateable="0">
    <ArrayListDomain name="array_list"
                     attribute_type="Scalars"
                     input_domain_name="inputs_array">
      <RequiredProperties>
        <Property name="Input"
                  function="Input" />
      </RequiredProperties>
    </ArrayListDomain>
    
    <Hints>
        <PropertyWidgetDecorator type="ShowWidgetDecorator">
            <Property name="UseProperty" function="boolean" />
        </PropertyWidgetDecorator>
    </Hints>
  </StringVectorProperty>

There is no built-in template in ParaView for that.

And is there a way to create one?
Also is there any documentation about what’s possible to do in XML files? All I’ve found is the “Plugin How To” wiki page and example XMLs on the Gitlab.

I don’t think it would be wise to add a template generating multiple properties. @utkarsh.ayachit may want to chime in.

Here is the full documentation of what is possible in XML files :

1 Like

Thank you very much as usual

Simon