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

Amit Prabhakar amitprabhakar05 at gmail.com
Tue Oct 13 06:03:10 EDT 2015


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.

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

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.
==============================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20151013/99cf26f4/attachment-0001.html>


More information about the Paraview-developers mailing list