[Smtk-developers] Q: Either-or combinations of attribute items

Yumin Yuan yumin.yuan at kitware.com
Tue Nov 11 17:36:21 EST 2014


BTW, the UI will display this as a combo box with Enum entries ("Axis
aligned", "General"), and when an entry is selected in the combo box, a
widget with specified items for that Enum value will be shown under the
combo.

Yumin

On Tue, Nov 11, 2014 at 5:03 PM, Robert Michael O'Bara <
bob.obara at kitware.com> wrote:

> Yes you can do this by using conditional items.
>
> Here is roughly how you do it:
>
>         <Int Name="Specification Mode">
>           <ChildrenDefinitions>
>             <Double Name="Width">
>             </Double>
>             <Double Name="Height">
>             </Double>
>             <Double Name="Depth">
>             </Double>
>             <Double Name="Center" NumberOfRequiredValues=3>
>             </Double>
>             <Double Name="Lengths" NumberOfRequiredValues=3>
>             </Double>
>             <Double Name="Axes" NumberOfRequiredValues=3>
>             </Double>
>           </ChildrenDefinitions>
>           <DiscreteInfo DefaultIndex="1">
>             <Structure>
>               <Value Enum="Axis Aligned">0</Value>
>               <Items>
>                 <Item> Width </Item>
>                 <Item> Height </Item>
>                 <Item> Depth </Item>
>               </Items>
>             </Structure>
>             <Structure>
>               <Value Enum="General">1</Value>
>               <Items>
>                 <Item>Center</Item>
>                 <Item>Axes</Item>
>                 <Item>Lengths</Item>
>               </Items>
>             </Structure>
>           </DiscreteInfo>
>         </Int>
>
> Robert M. O'Bara, MEng.
> Assistant Director of Scientific Computing
>
> Kitware Inc.
> 28 Corporate Drive
> Suite 101
> Clifton Park, NY 12065
>
> Phone: (518) 881- 4931
>
>
>
>
> On Nov 11, 2014, at 4:37 PM, David Thompson <david.thompson at kitware.com>
> wrote:
>
> Hi all,
>
> I believe I've heard that you can specify some items in an attribute can
> depend on others being present (or perhaps excluding the presence of
> others).
>
> Is that the case? The CGM "brick" operator takes in *either* a width,
> height, and depth *or* a center point, 3 axes, and a length along each
> axis. Is there a good way to constrain an attribute to accept one case or
> the other? Is this presented in the GUI as a separate tab or radio buttons
> (or something else)?
>
> If you let me know I will try adding something relevant to the user's
> guide.
>
> Thanks,
> David
> _______________________________________________
> Smtk-developers mailing list
> Smtk-developers at smtk.org
> http://public.kitware.com/mailman/listinfo/smtk-developers
>
>
>
> _______________________________________________
> Smtk-developers mailing list
> Smtk-developers at smtk.org
> http://public.kitware.com/mailman/listinfo/smtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20141111/f5f9ff63/attachment.html>


More information about the Smtk-developers mailing list