How to replace XML specification with python decorators?

Hi,

I would like to replace an old vtkPythonProgrammableFilter with a subclass of VTKPythonAlgorithmBase.

There was an XML specification file to expose that filter in ParaView and I would like to use some decorators to replace that file as described in this link.

I’m looking for some examples to replace part of that file.

  1. Do you have any hint to define a sub-menu with an enumeration of choices, as in the following XML code ?
    <IntVectorProperty
            name="geomOrigin"
            label="Origin"
            initial_string="geomOrigin"
            command="SetParameter"
            animateable="1"
            default_values="1"
            panel_visibility="advanced"
            number_of_elements="1">
            <EnumerationDomain name="enum">
              <Entry value="1" text="One"/>
              <Entry value="2" text="Two"/>
            </EnumerationDomain>
            <Documentation>Description...</Documentation>
      </IntVectorProperty>
  1. Do you have any hint to create a checkbox, as in the following example?
    <IntVectorProperty
        name="verbose"
        label="Details"
        initial_string="verbose"
        command="SetParameter"
        animateable="1"
        default_values="0"
        number_of_elements="1">
        <BooleanDomain name="bool" />
    </IntVectorProperty>
  1. Is there any possibility to write the XML corresponding to a decorated class?

Thanks in advance.

Regards,
Loic

You can use your xmls as is, see
paraview/Examples/Plugins/PythonAlgorithm/PythonAlgorithmExamples.py