HSelectionItem

Detailed Description

class HSelectionItem

The HSelectionItem class is an interface definition for a selection item.

This is the abstract base class for selection items held in a list the HSelectionSet class. It defines a set of interfaces for the HSelectionSet and operators like HOpSelectAperture to interact with selection items. Use this class as a base class when you want to implement new types of selection item classes. Note that you cannot create an instance of this class. It contains pure virtual functions which have no implementation.

Subclassed by HOldSelItem, HSmartSelItem

Public Functions

HSelectionItem(HC_KEY key, HSelectionSet *selection_set)

Constructs.

virtual ~HSelectionItem()
inline virtual char const *GetName() const
Returns:A character pointer denoting the name which is “HSelectionItem.”
inline virtual HC_KEY GetKey() const
Returns:The HOOPS key to the selection item.
virtual HC_KEY GetSegmentKey() const
Returns:If the selection item is a segment, then the item key is returend. If the selection item is entity, then key to the owner segment is returned.
virtual bool Equals(HSelectionItem const *i2) const
Parameters:i2 – An HSelectionItem object to be compared with this object.
Returns:True when the two selection elements are equal.
virtual bool Highlight() = 0

This function highlights the selection item.

Returns:True if the selection item was succesffuly highlighted.
virtual bool UnHighlight() = 0

This method unhighlights the selection item.

Returns:A true if the unhighlight is succesful
virtual bool IsHighlighted() const = 0

Checks to see if an item is currently highlighted.

Returns:True if the item is currently highlighted, false if the item is not highlighted.
virtual bool Delete() = 0

Call this function to delete the selection item. NOTE: If the selection is a non-instanced segment or entity, it will be deleted. If the selection is an instanced segment or entity, it’s include link will be removed.

Returns:True if the item was successfully deleted.
virtual bool IsInstanced() const = 0

Checks to see if the selection item has any segments/geometry which might be potentially shared. This is determined by checking the include keys in the selection path. If there is more than one (the model key), then it is instanced.

Returns:True if the item is instanced.
virtual int GetIncludeCount() const = 0
Returns:The number of include keys in the include path.
virtual const HC_KEY *const GetIncludeKeys() const = 0
Returns:An array to include keys. The return pointer is for read-only purposes.
virtual void GetIncludeKeys(HC_KEY includes[]) const = 0
Parameters:includes – An array of include keys (returned to the user). Note that the caller must ensure that the array is of the appropriate size, e.g, via the GetIncludeCount function.
virtual bool QueryIncludeDependency(HC_KEY include_key, HC_KEY &ret_dependent_key) = 0

Determines if the selection item has any dependency on the include key being provide. If it does have a dependency, this method returns true and returns which skey is dependent as the second argument.

Parameters:
  • include_key – HC_KEY to include key on which the dependency is wanted
  • ret_dependent_key – HC_KEY to segment/entity which depends on the include key
Returns:

True if the item has dependency on the given include_key.

virtual bool UpdateIncludeDependency(HC_KEY include_key, HC_KEY dependent_key, HC_KEY replacement_key) = 0

This method updates the given key’s dependency on a given include key with a new include key.

Parameters:
  • include_key – HC_KEY of the include key which is deleted/going to be deleted.
  • dependent_key – HC_KEY of the segment/entity which depends on the include key.
  • replacement_key – The new HC_KEY that will replace include_key for the given dependent_key.
Returns:

True if the dependency has been successfully updated.

virtual int GetFullPathCount(HBaseView *view)
Returns:A count of number of include keys in the include path plus 2 to account for the the selection item and view key.
virtual const HC_KEY *GetFullPathKeys(HBaseView *view)
Parameters:view – the HBaseView in which this item is selected
Returns:An array of keys, suitable for passing to HOOPS’ HC_PShow* or HC_Compute*By_Path functions
virtual void GetFullPathKeys(HBaseView *view, HC_KEY path[])
Parameters:
  • view – The HBaseView in which the item is selected
  • path – An array of keys (returned to the user), suitable for passing to the PShow or By_Path functions. Note that the caller must ensure that the array is of the appropriate size, e.g., via the GetFullPathCount function.
inline void SetTimeStamp(float now)

Sets a selection item’s time stamp

Parameters:now – the time stamp
inline float GetTimeStamp()

Retrieves a selection item’s time stamp

Returns:the time stamp