<div dir="ltr"><div><div><div><div><div><div>Dear Utkarsh, <br><br></div>Thank you for the email. I tried modelling it along the example mentioned. This is the code that I have written but it segfaults for no reason that is apparent to me. <br>
<br></div>C++ Code:<br><br>ReadUALGrid::ReadUALGrid()<br>{<br>  //this->FileName = NULL;<br>  this->SetNumberOfInputPorts(0);<br>  this->SetNumberOfOutputPorts(1);<br>  this->trial=vtkSmartPointer<vtkDataArraySelection>::New();<br>
  this->trial->AddArray("hello");<br>  this->trial->AddArray("world");<br>  this->trial->EnableAllArrays();<br>}<br><br><br>}<br><br>vtkDataArraySelection * ReadUALGrid::GetCPOListSelection(){<br>
<br>return this->trial.GetPointer();<br>}<br><br><br>int ReadUALGrid::GetCPOListArrayStatus(char *name){<br><br>return this->trial->GetArraySetting(name);<br>}<br><br>void ReadUALGrid::SetCPOListArrayStatus(const char * name, int status){<br>
<br>        if (status){<br>                this->trial->EnableArray(name);<br>        }<br>        else{<br>                this->trial->DisableArray(name);<br>        }<br><br><br>}<br><br><br>int ReadUALGrid::GetNumberOfCPOListArrays(){<br>
<br><br>return this->trial->GetNumberOfArrays();<br>}<br><br><br>const char * ReadUALGrid::GetCPOListArrayName(int index){<br><br>return this->trial->GetArrayName(index);<br><br>}<br><br><br></div>XML:<br><br>
<StringVectorProperty<br>       name="CPOList"<br>       label="CPOList"<br>       command="SetCPOListArrayStatus"<br>       number_of_elements="0"<br>       number_of_elements_per_command="2"<br>
       element_types="2 0"<br>       information_property="CPOListArrayStatus"<br>       panel_visibility="default"><br>       <ArraySelectionDomain name="array_list"><br>        <RequiredProperties><br>
        <Property function="ArrayList"<br>                name="CPOListArrayStatus"/><br>        </RequiredProperties><br>        </ArraySelectionDomain><br>        <Documentation><br>
          This property specifies the CPO on the UAL Database.<br>        </Documentation><br>     </StringVectorProperty><br><br><br>     <StringVectorProperty<br>       name="CPOListArrayStatus"<br>
       information_only="1"><br>        <ArraySelectionInformationHelper attribute_name="CPOList"/><br>     </StringVectorProperty><br><br><br></div>Any idea where I am making the mistake? Can I initialize a DataArraySelection that way? Thanks. <br>
<br></div>Regards,<br></div>Girish<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 20 August 2014 22:49, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try modeling this on "Point/Cell" array selection properties provided<br>
by readers (in readers.xml). You'd need to use the<br>
ArraySelectionDomain, the StringListDomain won't work.<br>
<br>
e.g.<br>
      <StringVectorProperty command="SetPointArrayStatus"<br>
                            element_types="2 0"<br>
                            information_property="PointArrayInfo"<br>
                            label="Point Arrays"<br>
                            name="PointArrayStatus"<br>
                            number_of_elements="0"<br>
                            number_of_elements_per_command="2"<br>
                            repeat_command="1"><br>
        <ArraySelectionDomain name="array_list"><br>
          <RequiredProperties><br>
            <Property function="ArrayList"<br>
                      name="PointArrayInfo" /><br>
          </RequiredProperties><br>
        </ArraySelectionDomain><br>
        <Documentation>This property lists which point-centered arrays to<br>
        read.</Documentation><br>
      </StringVectorProperty><br>
<div><div class="h5"><br>
<br>
<br>
On Wed, Aug 20, 2014 at 9:37 AM, Girish Ramesh <<a href="mailto:rgirish28@gmail.com">rgirish28@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I would like to use the panel_widget option in the servermanager XML with a<br>
> String Array, but whenever I try to do it, it doesn't display anything. So,<br>
> I'm wondering how it can be done even though it works with a normal<br>
> StringVectorProperty for the default widget. Thank you. The XML and<br>
> screenshot is given below.<br>
><br>
> XML:<br>
><br>
> <StringVectorProperty<br>
>        name="CPOList"<br>
>        label="CPOList"<br>
>        command="SetCPOList"<br>
>        number_of_elements="1"<br>
>        panel_visibility="default"<br>
>        panel_widget="list"><br>
>        <StringListDomain name="array_list"><br>
>         <RequiredProperties><br>
>         <Property function="ArrayList"<br>
>                 name="CPOListInfo"/><br>
>         </RequiredProperties><br>
>         </StringListDomain><br>
>         <Documentation><br>
>           This property specifies the CPO on the UAL Database.<br>
>         </Documentation><br>
>      </StringVectorProperty><br>
><br>
><br>
>      <StringVectorProperty<br>
>        name="CPOListInfo"<br>
>        label="CPOListInfo"<br>
>        command="GetCPOList"<br>
>        information_only="1"><br>
>         <StringArrayHelper /><br>
>      </StringVectorProperty><br>
><br>
> Screenshot of option working with default widget:<br>
><br>
> <a href="https://imageshack.com/i/eyhM3mFKp" target="_blank">https://imageshack.com/i/eyhM3mFKp</a><br>
><br>
> Regards,<br>
> Girish<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
><br>
</blockquote></div><br></div>