I’m trying to do a Programmable Filter with a dynamic drop down list, where the displayed properties in the GUI depend on the selected option in the drop down list (See cases A and B in the next figure):
So far, I succeeding in creating this interface in the filter, i.e., this dynamic drop down list appear when I apply the filter and I obtain the cases A and B from the figure. You can check this by using the attached PVSM file (it requires first to load the plugin -xml file-).
However, when I click on the “Apply” button, there is an error related to the XML file:
Object type: vtkPythonProgrammableFilter, could not find requested method: “SetParameter” or the method was called with incorrect arguments.
In several forums I found that the command for the ProxyProperty is “Set+name” (i.e., if name=“Selection”, then command=“SetSelection”). I tried also this but it still not working.
I’m confident about the first proxy group (“DropDownList”) because I can see that PV displays what I code there. However, the problem is in the second proxy group (“filters”), and more precisely in ProxyProperty, but I can not figure it out.
Any clue is welcomed. Thanks for your time!
Miguel
<!-- Here is defined the drop down list for the GUI -->
<ProxyGroup name="DropDownList">
<Proxy name="All_methods" class="vtkPythonProgrammableFilter">
<IntVectorProperty
name="Method_A"
command="SetParameter"
initial_string="Method_A"
number_of_elements="1"
default_values="1">
<BooleanDomain name="bool"/>
</IntVectorProperty>
<IntVectorProperty
name="Method_B"
command="SetParameter"
initial_string="Method_A"
number_of_elements="1"
default_values="1">
<BooleanDomain name="bool"/>
</IntVectorProperty>
</Proxy>
<Proxy name="None" class="vtkPythonProgrammableFilter">
</Proxy>
<Proxy name="Select_Method" class="vtkPythonProgrammableFilter">
<IntVectorProperty
name="Method_1"
command="SetParameter"
initial_string="Method_1"
number_of_elements="1"
default_values="0">
<BooleanDomain name="bool"/>
</IntVectorProperty>
<IntVectorProperty
name="Method_2"
command="SetParameter"
initial_string="Method_2"
number_of_elements="1"
default_values="0">
<BooleanDomain name="bool"/>
</IntVectorProperty>
</Proxy>
</ProxyGroup>
<ProxyGroup name="filters">
<SourceProxy name="DROP_DOWN_LIST_TEST"
class="vtkPythonProgrammableFilter"
label="DROP_DOWN_LIST_TEST">
<!-- Define the input port with data to be processed -->
<InputProperty
name="Input"
command="SetInputConnection">
<ProxyGroupDomain name="groups">
<Group name="sources"/>
<Group name="filters"/>
</ProxyGroupDomain>
<DataTypeDomain name="input_type">
<DataType value="vtkDataSet"/>
</DataTypeDomain>
</InputProperty>
<!-- Define the Paraview data set type as "Same as Input" (default value of 8 means "Same as Input") -->
<IntVectorProperty
name="OutputDataSetType"
command="SetOutputDataSetType"
number_of_elements="1"
default_values="8"
panel_visibility="never">
</IntVectorProperty>
<!-- Execute the Python script : -->
<StringVectorProperty
name="Script"
command="SetScript"
number_of_elements="1"
default_values="print Method_1">
<Hints>
<Widget type="multi_line"/>
</Hints>
</StringVectorProperty>
<!-- Include the drop down list -->
<ProxyProperty
name="Selection"
command="SetSelection">
<ProxyListDomain name="proxy_list">
<Proxy group="DropDownList" name="All_methods" />
<Proxy group="DropDownList" name="Select_Method" />
<Proxy group="DropDownList" name="None" />
</ProxyListDomain>
</ProxyProperty>
</SourceProxy>
</ProxyGroup>