After a selection is performed, it is usually necessary to provided visual feedback to the user regarding what was selected. This typically involves applying the concept of highlighting to higher-level model structure. For example, the scene might contain a picture of an airplane wing which is represented by several pieces of HOOPS/3dGS geometry (probably shells). However, HOOPS/3dGS knows nothing about the airplane wing. Therefore, if you wanted to highlight the entire wing after the user selects on any part of it, you would need to figure out all the associated pieces of HOOPS geometry and highlight them all. This section will focus on some of the ways in which HOOPS/3dGS objects (segments and geometry) can be highlighted.
The way in which an object is highlighted is up to the developer. You could choose to modifiy color, line weight, face pattern, shading mode, or any combination of attributes.
Highlighting at a segment level simply involves modifying the attributes in the segment. Recall that all objects in a segment are affected by that segment's attributes. Note that this will affect the open segment, as well as any subsegments which do not have their own opinion about the attributes being modified. If you want all subsegments to have the same highlight attributes, regardless of local explicit settings, you can use the attribute lock in Rendering_Option:
HC_Set_Rendering_Options("attribute lock = color"); /* lock the value of color down the tree */
This comes in useful when you want to highlight an entire piece of the segment tree. For examples, let's say the HOOPS/3dGS database was representing an AEC drawing with multiple layers, representing various systems such as HVAC, piping, electrical, etc... If the GUI is in 'layer highlight' mode, you could easily highlight a selected layer by setting the desired highlight attributes at a top-level 'layer' parent segment, and then setting 'attribute lock' in that segment.
Frequently, a segment will contain geometry primitives that represent discrete 'model' objects. For example, let's say we have an 'asteriod' segment which contains a HOOPS/3dGS shell for each asteriod. If the GUI is in 'single asteriod selection mode', then you of course only want to highlight a single asteriod. Setting highlight attributes in the asteriod segment won't work since all the asteriods will be affected by that new attribute. So, we need to modify the database so that only the selected object will be drawn with the new highlight attributes. This can be done by moving the object to a highlight segment (and then moving it back to the original segment to unhighlight.) This can be achieved by using the function Move_By_Key.
The HOOPS/MVO Classes contain a class called HSelectionSet which provides highlighting support. This class is intended to be used along with the other HOOPS/MVO classes, but it's methods can be referred to for a reference implementation of segment and single object highlighting. The code handles other issues that were not mentioned above, such as dealing with include segments, and storing away a segment's original set of attributes (so that they can be restored later!). It manages a selection array, and provides methods to Select, DeSelect, DeSelectAll and to query if an object IsSelected.
Next | Previous | Index |