<div dir="ltr">Amit,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I wish there was a document discussing that and saving the pedagogy involved in such approach.</blockquote><div><br></div><div>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 :-) </div><div><br></div><div>HTH,</div><div>Cory</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 6:03 AM, Amit Prabhakar <span dir="ltr"><<a href="mailto:amitprabhakar05@gmail.com" target="_blank">amitprabhakar05@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>Hello Cory,<br><br></div>Thanks a lot for the immediate help. It made the list of point data arrays available to me, which is what I wanted.<br><br></div>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.<br><br></div>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)<br><br><span style="font-family:monospace,monospace"><span class=""><StringVectorProperty command="SetInputArrayToProcess"<br>                            element_types="0 0 0 0 2"<br></span>                            label="Scalars"<br>                            name="SelectInputScalars"<span class=""><br>                            number_of_elements="5"><br>        <ArrayListDomain attribute_type="Scalars"<br>                         input_domain_name="input_array1"<br>                         name="array_list"><br>          <RequiredProperties><br>            <Property function="Input"<br>                      name="Input" /><br>          </RequiredProperties><br>        </ArrayListDomain><br></span>        <Documentation>This property indicates the name of the scalar array on<br>        which to operate. The indicated array may be used for scaling the<br>        glyphs. (See the SetScaleMode property.)</Documentation><br>      </StringVectorProperty></span><br><br></div>I am expecting <span style="font-family:monospace,monospace">name="SelectInputScalars"</span> to be a variable somewhere in vtkPVGlyphFilter.h somewhere, either through a private variable and/or vtkSetMacro(SelectInputScalars).<br><br></div>But neither of them is present in the source/header file. Not able to figure out what am I missing.<br><br></div><br></div>Thanks for any link or advice.<span class=""><font color="#888888"><br><br></font></span></div><span class=""><font color="#888888">Amit<br><div><div><div><br><div><div><div><div><div><br></div></div></div></div></div></div></div></div></font></span></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 11:41 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Hi Amit,<div><br></div><div>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.</div><div><br></div><div>In your case, I would look at the "Glyph With Custom Source" filter definition in</div><div><br></div><div>ParaView/ParaViewCore/ServerManager/SMApplication/Resources/filters.xml<br></div><div><br></div><div>The relevant properties are</div><div><br></div><div><div>      <InputProperty command="SetInputConnection"</div><div>                     name="Input"></div><div>        <ProxyGroupDomain name="groups"></div><div>          <Group name="sources" /></div><div>          <Group name="filters" /></div><div>        </ProxyGroupDomain></div><div>        <DataTypeDomain name="input_type"></div><div>          <DataType value="vtkDataSet" /></div><div>        </DataTypeDomain></div><div>        <InputArrayDomain attribute_type="point"</div><div>                          name="input_array1"</div><div>                          number_of_components="1"</div><div>                          optional="1" /></div><div>        <InputArrayDomain attribute_type="point"</div><div>                          name="input_array2"</div><div>                          number_of_components="3"</div><div>                          optional="1" /></div><div>        <Documentation>This property specifies the input to the Glyph filter.</div><div>        This is the dataset from which the points are selecetd to be glyphed.</div><div>        </Documentation></div><div>      </InputProperty></div></div><div><br></div><div>and</div><div><br></div><div><div>      <StringVectorProperty command="SetInputArrayToProcess"</div><div>                            element_types="0 0 0 0 2"</div><div>                            name="Scalars"</div><div>                            number_of_elements="5"></div><div>        <ArrayListDomain attribute_type="Scalars"</div><div>                         input_domain_name="input_array1"</div><div>                         name="array_list"></div><div>          <RequiredProperties></div><div>            <Property function="Input"</div><div>                      name="Input" /></div><div>          </RequiredProperties></div><div>        </ArrayListDomain></div><div>        <Documentation>Select the input array to be treated as the active "Scalars".</div><div>          You can scale the glyphs using the selected scalars by setting the</div><div>          "Scale Mode" property to "scalar"</div><div>        </Documentation></div><div>      </StringVectorProperty></div></div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>HTH,</div><div>Cory</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Oct 12, 2015 at 7:13 AM, Amit Prabhakar <span dir="ltr"><<a href="mailto:amitprabhakar05@gmail.com" target="_blank">amitprabhakar05@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div>Hello,<br><br></div>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:<br><br><a href="http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Drop_down_list_with_values_from_input_arrays" target="_blank">http://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Drop_down_list_with_values_from_input_arrays</a><br><br><br></div>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.<br><br><br></div><div>I am specially intrigued by presence of this part:<br><br><pre><span><span><RequiredProperties<span>></span></span></span> 
            <span><span><Property</span> <span>function</span>=<span>"ArrayList"</span> </span>
<span>                      <span>name</span>=<span>"CellArrayInfo"</span> <span>/></span></span> 
<span><span></RequiredProperties<span>></span></span></span> <br><br></pre><pre> <br><span style="font-family:arial,helvetica,sans-serif">I am also not sure what to change in my source file, while using the <br>above XML.<br><br>Could anyone please explain this to me? Or pass any link on this topic?<br><br></span></pre><pre><span style="font-family:arial,helvetica,sans-serif">Thanks a lot in advance.<span><font color="#888888"><br></font></span></span></pre><span><font color="#888888"><span style="font-family:arial,helvetica,sans-serif"><br></span></font></span></div><span><font color="#888888"><div><br><br clear="all"></div><div><div><div><div><br>-- <br><div><div dir="ltr"><div><div dir="ltr">==============================<br>Amit Prabhakar <br>Singapore.<br>==============================</div></div></div></div>
</div></div></div></div></font></span></div>
<br></div></div><span>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr">==============================<br>Amit Prabhakar <br>Singapore.<br>==============================</div></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div></div>