HSelectionItem

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.

Methods

HSelectionItem::HSelectionItem(HC_KEY key, HSelectionSet *selection_set)

Constructs.

virtual HSelectionItem::~HSelectionItem()

virtual

virtual char const *HSelectionItem::GetName() const

const virtual

Returns

A character pointer denoting the name which is “HSelectionItem.”
virtual HC_KEY HSelectionItem::GetKey() const

const virtual

Returns

The HOOPS key to the selection item.
virtual HC_KEY HSelectionItem::GetSegmentKey() const

const virtual

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 HSelectionItem::Equals(HSelectionItem const *i2) const

const virtual

Parameters

i2: An HSelectionItem object to be compared with this object.

Returns

True when the two selection elements are equal.
virtual bool HSelectionItem::Highlight() = 0

virtual

This function highlights the selection item.

Returns

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

virtual

This method unhighlights the selection item.

Returns

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

const virtual

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 HSelectionItem::Delete() = 0

virtual

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 HSelectionItem::IsInstanced() const = 0

const virtual

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 HSelectionItem::GetIncludeCount() const = 0

const virtual

Returns

The number of include keys in the include path.
virtual const HC_KEY *const HSelectionItem::GetIncludeKeys() const = 0

const virtual

Returns

An array to include keys. The return pointer is for read-only purposes.
virtual void HSelectionItem::GetIncludeKeys(HC_KEY includes[]) const = 0

const virtual

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 HSelectionItem::QueryIncludeDependency(HC_KEY include_key, HC_KEY &ret_dependent_key) = 0

virtual

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 HSelectionItem::UpdateIncludeDependency(HC_KEY include_key, HC_KEY dependent_key, HC_KEY replacement_key) = 0

virtual

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 HSelectionItem::GetFullPathCount(HBaseView *view)

virtual

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 *HSelectionItem::GetFullPathKeys(HBaseView *view)

virtual

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 HSelectionItem::GetFullPathKeys(HBaseView *view, HC_KEY path[])

virtual

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.

void HSelectionItem::SetTimeStamp(float now)

Sets a selection item’s time stamp

Parameters

now: the time stamp
float HSelectionItem::GetTimeStamp()

Retrieves a selection item’s time stamp

Returns

the time stamp

Variables

HC_KEY HSelectionItem::m_key

protected

HC_KEY

The HOOPS key to the selection element.

HSelectionSet *HSelectionItem::m_pSelectionSet

protected

The selection set which owns this selection item.

HC_KEY *HSelectionItem::m_FullPath

protected

HC_KEY

The include path plus the selection item and view key. If the object is not a HSmartSelItem, the path may be incomplete.

int HSelectionItem::m_FullPathCount

protected

int

The length of the m_FullPath array of keys including the selection item and view key.

float HSelectionItem::m_TimeStamp

protected

float

Time the item was created. Used for sorting the selection list.