[Paraview] [EXT] Re: Details of XML filter with lists of input arrays

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Oct 5 11:58:36 EDT 2017


Dennis,

Here's a example. You need manually modify the XML generated using
[1]. I've attached script.xml with my modifications to add a new
property for "Arrays".
Also attached a state file that demos this filter (load state after
lading the script.xml as plugin).

Hope that helps.
Utkarsh

[1]  `python python_filter_generator.py script.py script.xml`



On Wed, Oct 4, 2017 at 10:11 AM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> Dennis,
>
> Oops sorry, it slipped my mind you were doing this for programmable
> filter. It should be doable, but I'll need to dig -- don't remember of
> the top of my head. I'll put it on my plate to put together a small
> example for you.
>
> Utkarsh
>
> On Wed, Oct 4, 2017 at 7:59 AM, Dennis Conklin
> <dennis_conklin at goodyear.com> wrote:
>> Utkarsh,
>>
>> I think you have me confused with a real programmer!   ;- )
>>
>> I am just trying to write a Programmable Filter in python and I'm lost.
>>
>> I want to write an xml plugin that will put up a list of all the cell variables and let the user select from then and then have the names of those variables available in my python script within the Programmable Filter.    I'm hoping this can be similar to plugins I have written with hardcoded variable names where I've used something like:
>>
>> Properties = dict(
>>   Sector_Angle = True)
>>
>>
>> def RequestData():
>>
>>
>>    def process_block(block):
>>       #
>>       #
>>       if (Sector_Angle):
>>
>> Maybe this isn't possible at this low level, but how would I put up the list and then what would I have in my RequestData script that I could branch on.
>>
>> Thanks for your patience.
>>
>> Dennis
>>
>>
>> -----Original Message-----
>> From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
>> Sent: Tuesday, October 03, 2017 4:07 PM
>> To: Dennis Conklin <dennis_conklin at goodyear.com>
>> Cc: Paraview (paraview at paraview.org) <paraview at paraview.org>
>> Subject: Re: [EXT] Re: [Paraview] Details of XML filter with lists of input arrays
>>
>>> So, after the user chooses some variables, are the chosen variable names in "input_array"?
>>> Or does "input_array"  contain True or False based on which he chose, in which case where are the corresponding names of the variables?
>>
>> When user selects variables, he's doing it on the "VolumeArrays"
>> property. Thus the selection is provided to the VTK filter via calling the command specified on the "VolumeArrays" property. In the case of the ExtractCTHParts files, this is done via `AddVolumeArrayName` and `RemoveVolumeArrayNames` API.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_filter_generator.py
Type: text/x-python
Size: 10795 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171005/f38d833d/attachment-0002.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: script.py
Type: text/x-python
Size: 710 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171005/f38d833d/attachment-0003.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: script.xml
Type: text/xml
Size: 4504 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171005/f38d833d/attachment-0001.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: state.pvsm
Type: application/octet-stream
Size: 406315 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171005/f38d833d/attachment-0001.obj>


More information about the ParaView mailing list