[Paraview] Displaying a List of Strings in a popup [ParaView 3]

clinton at elemtech.com clinton at elemtech.com
Thu Jun 28 11:56:36 EDT 2007


I don't see an example that does exactly what you want.
But here's something that might work (untested).

<StringVectorProperty
        name="PhaseNameInfo"
        command="GetPhaseList"
        information_only="1">
        <StringArrayHelper/>
  </StringVectorProperty>

<StringVectorProperty
      name="PhaseName"
      command="SetPhase"
      number_of_elements="1">
     <StringListDomain name="operation">
        <RequiredProperties>
          <Property name="PhaseNameInfo" function="ArraySelection"/>
        </RequiredProperties>
     </StringListDomain>
</StringVectorProperty>

That's assuming your reader has a SetPhase function.
The PhaseNameInfo is used to get the list of available strings, by calling 
GetPhaseList which returns a vtkStringArray.
Note how the PhaseNameInfo is tied to the domain of the PhaseName property.
The PhaseName property is used to set the selection on the reader.
The GUI would give you a combo box to choose one string from a list.

StringArrayHelper is new and doesn't exist in 3.0.  You might be able to copy 
it from the CVS head, rename it and include it in your plugin.

This approach might be easier in the long run, as you'll have less code to 
maintain yourself.

Clint

On Thursday 28 June 2007 8:15:23 am Mike Jackson wrote:
> I am writing a plugin for ParaView 3 and I am going with the idea of
> having ParaView 3 autogenerate the GUI for my Reader. (We are
> prototyping at this point).
>     I need to retrieve a list of Strings from my Data File to display
> to the user so the user can then select one of those string values. I
> generally understand all the C++ code part. It is the Server Manager
> XML that I am getting hung up on. I have been reading through the
> ParaView book and looking through some of the XML files in ParaView 3
> source code. It would seem I need something like:
>
> <StringVectorProperty
>          name="PhaseName"
>          command="GetPhaseList"
>          information_only="1">
>          <SimpleStringInformationHelper/>
>       </StringVectorProperty>
>
> I know I need some sort of Information Helper so something.. Could
> someone shed some light or point me to an example? Whether the list
> is in a popup or traditiional List box does not really matter. If it
> can ONLY be done with a list of 'ints' I could hack something
> together to make that work...
>
> Thanks
> --
> Mike Jackson
> imikejackson & gmail * com
>
>
>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview




More information about the ParaView mailing list