[Paraview-developers] Filtered choice of attributes

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Nov 18 10:37:17 EST 2016


Cornelis,

Glad to help :). To answer you latest question, you can add the new
class in the "SERVER_MANAGER_SOURCES" in the add_paraview_plugin()
call.
e.g.

 ADD_PARAVIEW_PLUGIN(
    ...
   SERVER_MANAGER_XML foo.xml
   SERVER_MANAGER_SOURCES vtkSMMyNewDomain.cxx
 )

A few things to remember:
1. Ensure your domain class name begins with "vtkSM"
2. In XML, use the name of the domain without the "vtkSM" prefix e.g.
"<MyNewDomain ... >"

Utkarsh

On Fri, Nov 18, 2016 at 10:26 AM, Cornelis Bockemühl
<cornelis.bockemuehl at gmail.com> wrote:
> Thanks for this! And not the least also for the quick reaction you are
> showing to so many questions here!!
>
> But how do I integrate such a subclass into Paraview so that it replaces the
> original class: Do I have to recompile Paraview for this (ok, can be done -
> did it already...) or is there a way to "insert" this code like with the
> plugins?
>
> Kind regards, Cornelis
>
>
> 2016-11-18 16:23 GMT+01:00 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>:
>>
>> There isn't a prebuilt way, but you can subclass vtkSMArrayListDomain and
>> override vtkSMArrayListDomain::IsFilteredArray() to filter out arrays you
>> don't want and use that domain for your property.
>>
>> On Fri, Nov 18, 2016 at 4:20 AM, Cornelis Bockemühl
>> <cornelis.bockemuehl at gmail.com> wrote:
>>>
>>> With this in the server manager xml it is possible to have the user
>>> select one of the available attributes in the input data:
>>>
>>> <StringVectorProperty command="SetMyAttribute"
>>> label="Select an attribute"
>>>                       name="MyTonnage"
>>>                       number_of_elements="1"
>>>                       panel_visibility="default">
>>>   <ArrayListDomain name="array_list">
>>>     <RequiredProperties>
>>>       <Property function="Input"
>>>                 name="Input" />
>>>     </RequiredProperties>
>>>   </ArrayListDomain>
>>>   <Documentation>
>>>     Whatever...
>>>   </Documentation>
>>> </StringVectorProperty>
>>>
>>> I have now a case where it would be desirable to constrain the selection
>>> to some of the attributes only, like with a filter function (best part of
>>> the C++ code of the plugin) that selects only some of the attributes based
>>> on their name.
>>>
>>> Is there any way how to achieve this?
>>>
>>> Thanks for any helpful hints!
>>>
>>> --
>>> Cornelis Bockemühl
>>> Basel, Schweiz
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Search the list archives at:
>>> http://markmail.org/search/?q=Paraview-developers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/paraview-developers
>>>
>>
>
>
>
> --
> Cornelis Bockemühl
> Basel, Schweiz


More information about the Paraview-developers mailing list