[Paraview] MultiBlock Reader, RequestInformation and ParaView Display

David C Thompson dcthomp at sandia.gov
Mon Apr 21 14:27:03 EDT 2008


> I am hacking together a MultiBlock reader  for a quick demo and I was
> wondering if there is something I can put in "RequestInformation()"
> that can then be set into the Pipeline that will enable ParaView to
> show how many "blocks" are in a file, before the User clicks the "OK"
> button in ParaView?
> 
> outInfo->Set( vtkStreamingDemandDrivenPipeline::.....(), ....);

Yes. The ExodusII reader does this. Actually, the ExodusII reader
supports several *types* of blocks (element block, face block, edge
block, element set, side set, face set, edge set, node set). The XML
that supports element blocks is in
Servers/ServerManager/Resources/readers.xml:

     <StringVectorProperty 
        name="ElementBlockArrayInfo"
        information_only="1">
        <ArraySelectionInformationHelper attribute_name="ElementBlock"/>
     </StringVectorProperty>

     <StringVectorProperty
        name="ElementBlockArrayStatus"
        command="SetElementBlockArrayStatus"
        number_of_elements="2" 
        repeat_command="1"
        number_of_elements_per_command="2"
        element_types="2 0" 
        information_property="ElementBlockArrayInfo">
       <ArraySelectionDomain name="array_list">
          <RequiredProperties>
             <Property name="ElementBlockArrayInfo" function="ArrayList"/>
          </RequiredProperties>
       </ArraySelectionDomain>
     </StringVectorProperty>

which points to these methods from VTK/Hybrid/vtkExodusIIReader.h:

  int GetNumberOfElementBlockArrays();
  const char* GetElementBlockArrayName(int index);
  int GetElementBlockArrayStatus(const char* name);
  void SetElementBlockArrayStatus(const char* name, int flag);

There is a Qt panel widget (Qt/Components/pqExodusIIPanel.h) for the
reader that displays the names (and types) of the blocks -- and allows
users to select a subset to be loaded -- before the user presses OK.
This panel is associated to the reader by this class:
Qt/Components/pqObjectInspectorWidget.cxx . I don't know how a plugin
can "suggest" its own panel be used but perhaps someone more familiar
with plugins will chime in.

	David




More information about the ParaView mailing list