Is a "NamedValuesDomain" a good addition ?

(Mathieu Westphal (Kitware)) #1

In ParaView, ArraySelectionDomain allows to select wich array (actually which string) to enable/disable on a vtk object, using a widget like this one :

StringListDomain, in the other hand, allow to select a single string within a list of string , using a simple combobox.

Not using domains at all, we can also produce, for a repeatable property, this kind of widgets :

What about creating the last kind of widget when using a StringListDomain in a repeatable property. The first being filled up be provided string or from an information property with a StringArrayHelper ?
Unless it would be better to create a new domain altogether , eg “NamedValuesDomain” ?

For the information property version, it would be nice to have default values on each string, so instead of a StringArrayHelper, a more modern si_class may be a nice way to implement it.

Any thoughts ?

(Utkarsh Ayachit) #2

before we think of the solution, a few questions.

  1. What are the values, in your intended case? Looks like the information property is only providing information about “names” not the values. Is that correct?
  2. Is there any default value that is expected to be set on the property?
(Mathieu Westphal (Kitware)) #3


I suppose they should come from the information property as well.

(Utkarsh Ayachit) #4

BTW, the ArrayHelpers in XML are indeed replaced by appropriate si_class when the XML is parsed. ArrayHelpers we indeed things that existed before the si_class thing came about.

(Utkarsh Ayachit) #5

A new domain sounds reasonable.