[Paraview] More Customization of Python programmable Filter Panel

Cory Quammen cory.quammen at kitware.com
Thu Sep 24 11:07:10 EDT 2015


Hi Dennis,

Answers inlined below.

On Wed, Sep 23, 2015 at 2:39 PM, Dennis Conklin <dennis_conklin at goodyear.com
> wrote:

> All,
>
>
>
> Pat Marion discussed adding interactive Properties for a Programmable
> Filter here:
>
> http://www.kitware.com/blog/home/post/534
>
>
>
> I have a few questions about this:
>
> 1.       Is this still valid for v4.4 with the original
> python_filter_generator.py?
>
Yes, I just tested it.

> 2.      Have we added any other capability.  For instance,  I would love
> to present a list of variables to be calculated and let my user select or
> unselect each to decide exactly what he wants as output.   With a numeric
> field with 0 as unselect and 1 as select, people will always manage to type
> something else in there.    If this interface could have a checklist, or if
> fields could have a drop down list (Yes/No, etc) then this would greatly
> expand the utility of this technique.
>
You can do this if you have a fixed number of variables. Just list each
variable option as a IntVectorProperty with a BooleanDomain in the XML. In
the input file for the filter generator, just express these options with
the default values, .e.g,

Properties = dict(

  generate_var1 = True,

  generate_var2 = False,

  generate_var3 = False

  )


The filter generator will convert each of these lines into XML of the
following form:

      <IntVectorProperty
        name="generate_var1"
        label="generate var1"
        initial_string="generate_var1"
        command="SetParameter"
        animateable="1"
        default_values="1"
        number_of_elements="1">
        <BooleanDomain name="bool" />
        <Documentation></Documentation>
      </IntVectorProperty>


These properties will appear as checkboxes in the UI of your filter.

Of course, you can tweak the XML files that are generated if it doesn't get
the label attribute for the property right, for instance.

I hope that helps.
Cory



> So, is anyone using this and perhaps knows how to do these extended things?
>
>
>
> Thanks for any hints
>
>
>
> Dennis
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>


-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150924/d1a0e35a/attachment.html>


More information about the ParaView mailing list