[Paraview-developers] Meaning of fields/tags of filters XML - any suggestion or link

Cory Quammen cory.quammen at kitware.com
Tue Oct 13 10:00:31 EDT 2015


Amit,

The "command" attribute is what specifies the class member function is
called when the property is modified, not the "name" attribute. So in the
example XML I posted from vtkPVGlyphFilter, the member function called is
SetInputArrayToProcess, not SelectInputScalars. SelectInputScalars is just
the name of the property - this name is used internally in ParaView.

In your plugin, you will need a member function that takes a char*
parameter for the name, such as, SetPointArray(char* arrayName). Then your
command in the XML will be "SetPointArray" and the number_of_elements="1".
You don't have to specify the element_types attribute in this case. You can
store this name however you wish and use it as needed.

I wish there was a document discussing that and saving the pedagogy
> involved in such approach.


The plugin HowTo is a pretty good introduction to the basics of ParaView
plugins. You are in more advanced plugin territory, and that we haven't
documented as well (or at all). We welcome contributions from the ParaView
developer community :-)

HTH,
Cory

On Tue, Oct 13, 2015 at 6:03 AM, Amit Prabhakar <amitprabhakar05 at gmail.com>
wrote:

> Hello Cory,
>
> Thanks a lot for the immediate help. It made the list of point data arrays
> available to me, which is what I wanted.
>
> But I have another (last) step to understand : How the selected list is
> stored in my program? How can I access that list of variables (pointdata
> arrays) selected by users. Bear in mind that user might select multiple
> arrays from the list.
>
> I find no document explaining that. With my little knowledge so far, I
> assumed that the vtkSetMacro helps in setting a value of that sort. So, for
> example in this part of the Glyph Filter (As you indicated in your mail
> previously)
>
> <StringVectorProperty command="SetInputArrayToProcess"
>                             element_types="0 0 0 0 2"
>                             label="Scalars"
>                             name="SelectInputScalars"
>                             number_of_elements="5">
>         <ArrayListDomain attribute_type="Scalars"
>                          input_domain_name="input_array1"
>                          name="array_list">
>           <RequiredProperties>
>             <Property function="Input"
>                       name="Input" />
>           </RequiredProperties>
>         </ArrayListDomain>
>         <Documentation>This property indicates the name of the scalar
> array on
>         which to operate. The indicated array may be used for scaling the
>         glyphs. (See the SetScaleMode property.)</Documentation>
>       </StringVectorProperty>
>
> I am expecting name="SelectInputScalars" to be a variable somewhere in
> vtkPVGlyphFilter.h somewhere, either through a private variable and/or
> vtkSetMacro(SelectInputScalars).
>
> But neither of them is present in the source/header file. Not able to
> figure out what am I missing.
>
>
> Thanks for any link or advice.
>
> Amit
>
>
>
> On Mon, Oct 12, 2015 at 11:41 PM, Cory Quammen <cory.quammen at kitware.com>
> wrote:
>
>> Hi Amit,
>>
>> Unfortunately, populating a drop down list with point data arrays isn't
>> documented in the plugin How To. The best bet is to find a reader or filter
>> that does what you want and copy the XML needed to do the same for your
>> filter.
>>
>> In your case, I would look at the "Glyph With Custom Source" filter
>> definition in
>>
>> ParaView/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml
>>
>> The relevant properties are
>>
>>       <InputProperty command="SetInputConnection"
>>                      name="Input">
>>         <ProxyGroupDomain name="groups">
>>           <Group name="sources" />
>>           <Group name="filters" />
>>         </ProxyGroupDomain>
>>         <DataTypeDomain name="input_type">
>>           <DataType value="vtkDataSet" />
>>         </DataTypeDomain>
>>         <InputArrayDomain attribute_type="point"
>>                           name="input_array1"
>>                           number_of_components="1"
>>                           optional="1" />
>>         <InputArrayDomain attribute_type="point"
>>                           name="input_array2"
>>                           number_of_components="3"
>>                           optional="1" />
>>         <Documentation>This property specifies the input to the Glyph
>> filter.
>>         This is the dataset from which the points are selecetd to be
>> glyphed.
>>         </Documentation>
>>       </InputProperty>
>>
>> and
>>
>>       <StringVectorProperty command="SetInputArrayToProcess"
>>                             element_types="0 0 0 0 2"
>>                             name="Scalars"
>>                             number_of_elements="5">
>>         <ArrayListDomain attribute_type="Scalars"
>>                          input_domain_name="input_array1"
>>                          name="array_list">
>>           <RequiredProperties>
>>             <Property function="Input"
>>                       name="Input" />
>>           </RequiredProperties>
>>         </ArrayListDomain>
>>         <Documentation>Select the input array to be treated as the active
>> "Scalars".
>>           You can scale the glyphs using the selected scalars by setting
>> the
>>           "Scale Mode" property to "scalar"
>>         </Documentation>
>>       </StringVectorProperty>
>>
>> Note the InputArrayDomain defined in the Input property named
>> "input_array1". It defines a domain (a list of possible values for a
>> property) of the 1-component point arrays in the input. This domain is used
>> to populate the combo box for the "Scalars" array by specifying it as the
>> domain used by the ArrayListDomain of the "Scalars" property.
>>
>> You'll need to set up domains this way in your filter to get the list of
>> point data arrays in your property's combo box.
>>
>> HTH,
>> Cory
>>
>>
>>
>> On Mon, Oct 12, 2015 at 7:13 AM, Amit Prabhakar <
>> amitprabhakar05 at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I have been using paraview and have written really simple filters in
>>> past. However, I am lost into writing an appropriate XML for my filter. I
>>> am using this link as guide:
>>>
>>>
>>> http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Drop_down_list_with_values_from_input_arrays
>>>
>>>
>>> However, the problem I am facing is understanding the different
>>> fields/tags of the XML file (filters.xml). For example I want to use the
>>> point data array names (a string list, I guess) as list of User input to my
>>> filter.
>>>
>>>
>>> I am specially intrigued by presence of this part:
>>>
>>> <RequiredProperties>
>>>             <Property function="ArrayList"                       name="CellArrayInfo" /> </RequiredProperties>
>>>
>>>
>>> I am also not sure what to change in my source file, while using the
>>> above XML.
>>>
>>> Could anyone please explain this to me? Or pass any link on this topic?
>>>
>>> Thanks a lot in advance.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> ==============================
>>> Amit Prabhakar
>>> Singapore.
>>> ==============================
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>>
>> --
>> Cory Quammen
>> R&D Engineer
>> Kitware, Inc.
>>
>
>
>
> --
> ==============================
> Amit Prabhakar
> Singapore.
> ==============================
>



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


More information about the Paraview-developers mailing list