How the ArraySelectionDomain works in PV

(Haocheng Liu) #1

Hi, I’m trying to understand how ArraySelectionDomain works in PV and what functions I need to implement in my reader so that I can use this property( Drop Down List with Values from Input File). However I cannot find a proper documentation for it nor can I locate the parser code in PV source code. Would you plz point me to some tutorial/ paraview source codes?

For now, I just follow the pattern in the xdmf3 reader and I can just guess what I need to implement.

Thanks!

(Mathieu Westphal (Kitware)) #2

There is an example usage here :
https://kitware.github.io/paraview-docs/latest/cxx/PropertyHints.html

And it is documented here :
https://kitware.github.io/paraview-docs/latest/cxx/classvtkSMArraySelectionDomain.html

vtkSMArraySelectionDomain is a domain that can be for used for properties that allow users to select an array (or actually any string) based on an information_only property.

The usecase is generally when a reader can, during the RequestInformation pass, recover the available readable array and provide their name in an information_only prop, then the user select the arrays to read during the RequestData pass.

      <StringVectorProperty name="PointArrayInfo"
                            information_only="1">
        <ArraySelectionInformationHelper attribute_name="Point" />
      </StringVectorProperty>

      <StringVectorProperty name="PointArrayStatus"
                            command="SetPointArrayStatus"
                            number_of_elements="2"
                            repeat_command="1"
                            number_of_elements_per_command="2"
                            element_types="2 0"
                            information_property="PointArrayInfo"
                            label="Point Arrays">
        <ArraySelectionDomain name="array_list">
          <RequiredProperties>
            <Property name="PointArrayInfo" function="ArrayList" />
          </RequiredProperties>
        </ArraySelectionDomain>
        <Documentation>
          This property contains a list of the point-centered arrays to read.
        </Documentation>
      </StringVectorProperty>
1 Like