[Paraview] String Drop Down XML
Brian Panneton
brian.panneton at gmail.com
Wed Mar 9 17:23:36 EST 2011
Nevermind. I figured it out.
I can use something similar to this:
[code]
<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>
[/code]
and have two functions:
[code]
void SetPhase(const char* phase);
vtkStringArray* GetPhaseList();
[/code]
This seems to work.
On Wed, Mar 9, 2011 at 4:24 PM, Brian Panneton <brian.panneton at gmail.com>wrote:
> I can't seem to figure out how to make a drop down list with strings from a
> reader. I have created a drop down list with integers, and I have read that
> it was possible, but I can't figure out what I need to implement. If any one
> has any good examples (XML and C++) that would be great.
>
> If I have this:
> [code]
> <StringVectorProperty name="CellArrayInfo"
> information_only="1">
> <ArraySelectionInformationHelper attribute_name="Cell"/>
> </StringVectorProperty>
> <StringVectorProperty name="CellArrayStatus"
> command="SetCellArrayStatus"
> number_of_elements="0"
> repeat_command="1" number_of_elements_per_command="2"
> element_types="2 0"
> information_property="CellArrayInfo"
> label="Cell Arrays">
> <ArraySelectionDomain name="array_list">
> <RequiredProperties>
> <Property name="CellArrayInfo"
> function="ArrayList"/>
> </RequiredProperties>
> </ArraySelectionDomain>
> </StringVectorProperty>
> [/code]
>
> I read that I could change:
> [code]
> number_of_elements="0"
> repeat_command="1" number_of_elements_per_command="2"
> [/code]
>
> to
> [code]
> number_of_elements="1"
> [/code]
>
> but that does not work.
>
> I also tried using the EnumerationDomain with IntVectorProperty. This will
> only give me a dropdown with integers.
>
> Note: I'm not looking for this:
> [code]
> <EnumerationDomain name="enum">
> <Entry text="Stuff" value="0" />
> ....
> [/code]
>
> If I am not able to do a dropdown with a string, is there a way to only
> allow one item to be selected in my first sample of xml?
>
> Thanks,
> Brian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110309/51f5d172/attachment.htm>
More information about the ParaView
mailing list