What is the difference between a Kit object and a segment Key object?

In HPS, one can interact with geometry using a Key (e.g. ShellKey). Additionally, the API includes transitional objects called Kits to apply a group of settings to a Key. Although Keys and Kits have very similar methods (e.g. Show, Set and Unset) there are fundamental differences to understand.

Basically, a Kit represents a set of options for a given object. Perhaps the “Unset” method could have been named differently but it doesn’t have the effect of removing a setting when applied to a Key. The “Unset” method merely eliminates the setting from the Kit. If the Kit doesn’t have a setting, it makes no change to the Key when applied. This is how the Kit has been designed and implemented from the beginning of HPS.

The behavior of “Kit::Unset” methods may seem inconsistent compared with “Key::Unset” methods. However, in both cases, the Unset methods unset the particular attribute in the respective object (a Kit or a Key). Confusion may arise when applying the Kit with an unset attribute to a Key and expecting that attribute to be unset in the Key.

1 Like