[Paraview-developers] What widget is used for the the check box selection?

Cory Quammen cquammen at cs.unc.edu
Thu Aug 22 20:27:45 EDT 2013


Hi Josh,

Do you have a custom filter/source you are writing as a plugin? If so,
you just need to define certain methods in your filter/source and
configure your plugin XML a certain way.

Say you want to have checkboxes selecting a subset of point data
arrays from the input. The methods you need are:

  // Description:
  // Get number of point data arrays
  int GetNumberOfPointArrays();

  // Description:
  // Get name of a point data array at index
  const char* GetPointArrayName(int index);

  // Description:
  // Get/set the status of a point data array of a given name
  void SetPointArrayStatus(const char *name, int status);
  int GetPointArrayStatus(const char *name);

Now in the XML for your filter, you need something like this:

      <StringVectorProperty information_only="1"
                            name="PointArrayInfo">
        <ArraySelectionInformationHelper attribute_name="Point" />
      </StringVectorProperty>
      <StringVectorProperty command="SetPointArrayStatus"
                            element_types="2 0"
                            information_property="PointArrayInfo"
                            label="Point Arrays to Evaluate"
                            name="ArrayStatus"
                            number_of_elements="0"
                            number_of_elements_per_command="2"
                            panel_visibility="default"
                            repeat_command="1">
        <ArraySelectionDomain name="array_list">
          <RequiredProperties>
            <Property function="ArrayList"
                      name="PointArrayInfo" />
          </RequiredProperties>
          </ArraySelectionDomain>
        <Documentation>
        </Documentation>
      </StringVectorProperty>

I cribbed this from the XML descriptions in one of the readers in
ParaView/ParaViewCore/ServerManager/SMApplication/Resources/readers.xml

I hope that helps,

Cory

On Thu, Aug 22, 2013 at 6:16 PM, Joshua Murphy
<Joshua.Murphy at lasp.colorado.edu> wrote:
> Hello,
>
> I am trying to figure out what widget is used to create the check-box
> selection panels, such as the array selection panels in the readers?  I am
> trying to write a custom panel that utilizes the checkbox panels, and I
> haven't been able to figure out how it works.
>
> If someone could point me toward the code for the array selection properties
> panel, I would be grateful!
>
> Thanks,
> Josh
>
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>



-- 
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill


More information about the Paraview-developers mailing list