The HSmartSelItem - selection item which can handle instancing. More...

#include <HSelectionItem.h>

Public Member Functions

virtual bool Delete ()
 
virtual bool Equals (const HSelectionItem *i2) const
 
virtual const HC_KEY * GetFullPathKeys (HBaseView *view)
 
virtual void GetFullPathKeys (HBaseView *view, HC_KEY path[])
 
void GetHighlightedRefList (HC_KEY *keys)
 
int GetHighlightedRefListCount ()
 
virtual const int GetHighlightMode ()
 
virtual int GetIncludeCount () const
 
virtual const HC_KEY *const GetIncludeKeys () const
 
virtual void GetIncludeKeys (HC_KEY includes[]) const
 
virtual const char * GetName () const
 
virtual bool Highlight ()
 
 HSmartSelItem (HC_KEY key, HSelectionSet *selection_set, int incl_count, HC_KEY incl_keys[])
 
 HSmartSelItem (HC_KEY key, HSelectionSet *selection_set, int incl_count, HC_KEY incl_keys[], bool is_segment)
 
virtual bool IsHighlighted () const
 
virtual bool IsInstanced () const
 
bool IsSegment ()
 
virtual bool QueryIncludeDependency (HC_KEY include_key, HC_KEY &ret_dependent_key)
 
virtual void SetHighlightMode (HSelectionHighlightMode m)
 
virtual bool UnHighlight ()
 
virtual bool UpdateIncludeDependency (HC_KEY include_key, HC_KEY dependent_key, HC_KEY replacement_key)
 
void UpdateIncludePath (int incl_count, HC_KEY incl_keys[])
 
- Public Member Functions inherited from HSelectionItem
virtual int GetFullPathCount (HBaseView *view)
 
virtual HC_KEY GetKey () const
 
virtual HC_KEY GetSegmentKey () const
 
float GetTimeStamp ()
 
 HSelectionItem (HC_KEY key, HSelectionSet *selection_set)
 
void SetTimeStamp (float now)
 

Static Public Member Functions

static bool IsHighlighted (const HC_KEY key, const HSelectionSet *selection_set, const int incl_count, const HC_KEY incl_keys[])
 
static bool IsRegionHighlighted (const HC_KEY key, const HSelectionSet *selection_set, const int incl_count, const HC_KEY incl_keys[], int region)
 

Protected Member Functions

void AddHighlightedRefKey (HC_KEY key)
 
void CommonUnhighlightRef ()
 
void FixIncludePath ()
 
HC_KEY GetHighlightedRefKey ()
 
 HSmartSelItem (bool is_ooc, HC_KEY key, HSelectionSet *selection_set, int incl_count, HC_KEY incl_keys[], bool is_segment)
 

Protected Attributes

struct vlist_s * m_pSelKeyList
 
- Protected Attributes inherited from HSelectionItem
HC_KEY * m_FullPath
 The include path plus the selection item and view key. If the object is not a HSmartSelItem, the path may be incomplete.
 
int m_FullPathCount
 The length of the m_FullPath array of keys including the selection item and view key.
 
HC_KEY m_key
 The HOOPS key to the selection element.
 
HSelectionSetm_pSelectionSet
 The selection set which owns this selection item.
 
float m_TimeStamp
 Time the item was created. Used for sorting the selection list.
 

Friends

class HSelectionSet
 

Detailed Description

The HSmartSelItem - selection item which can handle instancing.

This implementation of HSelectionItem class handles instanced segments and entities. It also uses the 'conditional styling' mechanism to highlight the selection.

Constructor & Destructor Documentation

◆ HSmartSelItem() [1/2]

HSmartSelItem::HSmartSelItem ( HC_KEY  key,
HSelectionSet selection_set,
int  incl_count,
HC_KEY  incl_keys[] 
)

Constructs a HSmartSelItem object.

Parameters
keyHOOPS key to selection item.
selection_setpointer to the HOOPS selection set which owns this selection item.
incl_countNumber of include keys in the selection item segment path.
incl_keysAn array of HOOPS keys of all the include keys in the selection item path.

◆ HSmartSelItem() [2/2]

HSmartSelItem::HSmartSelItem ( HC_KEY  key,
HSelectionSet selection_set,
int  incl_count,
HC_KEY  incl_keys[],
bool  is_segment 
)

Constructs a HSmartSelItem object.

Parameters
keyHOOPS key to selection item.
selection_setpointer to the HOOPS selection set which owns this selection item.
incl_countNumber of include keys in the selection item segment path.
incl_keysAn array of HOOPS keys of all the include keys in the selection item path.
is_segmentIs the item known to be a segment.

Member Function Documentation

◆ AddHighlightedRefKey()

void HSmartSelItem::AddHighlightedRefKey ( HC_KEY  key)
protected

Adds a Reference Geometry key to the list of highlighted objects

Parameters
thereference geometry key of a highlighted object

◆ Delete()

virtual bool HSmartSelItem::Delete ( )
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.

Implements HSelectionItem.

Reimplemented in HSubentitySelItem.

◆ Equals()

virtual bool HSmartSelItem::Equals ( const HSelectionItem i2) const
virtual
Returns
True if the two selection elements are equal.
Parameters
i2An HSelectionItem object to be compared with this object

Reimplemented from HSelectionItem.

Reimplemented in HSubentitySelItem, and HRegionSelItem.

◆ FixIncludePath()

void HSmartSelItem::FixIncludePath ( )
protected

Ensure the include path is correct for the type of highlighting performed

◆ GetFullPathKeys() [1/2]

virtual const HC_KEY* HSmartSelItem::GetFullPathKeys ( HBaseView view)
virtual
Returns
An array to include keys, just like GetIncludeKeys, except that the keys array includes the selection item and the view key (as passed in).
Parameters
viewThe HBaseView in which this item is selected.

Reimplemented from HSelectionItem.

◆ GetFullPathKeys() [2/2]

virtual void HSmartSelItem::GetFullPathKeys ( HBaseView view,
HC_KEY  path[] 
)
virtual
Parameters
viewThe HBaseView in which the item is selected
pathAn array of keys (returned to the user), just like GetIncludeKeys, except that the keys array includes the selection item and the view key (as passed in). Note that the caller must ensure that the array is of the appropriate size, e.g., via the GetFullPathCount function.

Reimplemented from HSelectionItem.

◆ GetHighlightedRefKey()

HC_KEY HSmartSelItem::GetHighlightedRefKey ( )
protected

Dequeues a Reference Geometry key from the list of highlighted objects

Returns
the reference geometry key of a highlighted object

◆ GetHighlightedRefList()

void HSmartSelItem::GetHighlightedRefList ( HC_KEY *  keys)

Copies the list of Geometry Reference keys from this selection item.

Parameters
arrayof Reference Geometry keys. Returned to user. Passed by reference always.

◆ GetHighlightedRefListCount()

int HSmartSelItem::GetHighlightedRefListCount ( )

Retrieves the size of the list of highlighted objects

Returns
size of highlighted list

◆ GetHighlightMode()

virtual const int HSmartSelItem::GetHighlightMode ( )
inlinevirtual
Returns
The selection highlight mode.

References HSelectionSet::m_HighlightMode.

◆ GetIncludeCount()

virtual int HSmartSelItem::GetIncludeCount ( ) const
inlinevirtual
Returns
The number of include keys in the include path.

Implements HSelectionItem.

◆ GetIncludeKeys() [1/2]

virtual const HC_KEY* const HSmartSelItem::GetIncludeKeys ( ) const
inlinevirtual
Returns
An array to include keys. The return pointer is for read-only purpose.

Implements HSelectionItem.

◆ GetIncludeKeys() [2/2]

virtual void HSmartSelItem::GetIncludeKeys ( HC_KEY  includes[]) const
virtual
Parameters
includesAn 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.

Implements HSelectionItem.

◆ GetName()

virtual const char* HSmartSelItem::GetName ( ) const
inlinevirtual
Returns
A character pointer denoting the name which is "HSmartSelItem."

Reimplemented from HSelectionItem.

Reimplemented in HSubentitySelItem, and HRegionSelItem.

◆ Highlight()

virtual bool HSmartSelItem::Highlight ( )
virtual

Call this function to highlight the selection item.

Returns
True if the highlight is successful.

Implements HSelectionItem.

Reimplemented in HSubentitySelItem, and HRegionSelItem.

◆ IsHighlighted() [1/2]

virtual bool HSmartSelItem::IsHighlighted ( ) const
virtual

Checks to see if an item is currently highlighted.

Returns
True if the item is currently highlighted, false if otherwise.

Implements HSelectionItem.

◆ IsHighlighted() [2/2]

static bool HSmartSelItem::IsHighlighted ( const HC_KEY  key,
const HSelectionSet selection_set,
const int  incl_count,
const HC_KEY  incl_keys[] 
)
static

Checks to see if an item is currently highlighted. If you do not have the HSmartSelItem object, but just have the keys and include list returned from HOOPS, you could use this method to find out if the key was selected.

Parameters
keyHOOPS key to the item to be tested for selection.
selection_setA pointer to the HOOPS selection set in which this is to be tested.
incl_countNumber of include keys in the item segment path.
incl_keysAn array of HOOPS keys of all the include keys in the item path.
Returns
True if the item is currently highlighted, false if otherwise.

◆ IsInstanced()

virtual bool HSmartSelItem::IsInstanced ( ) 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.

Implements HSelectionItem.

◆ IsRegionHighlighted()

static bool HSmartSelItem::IsRegionHighlighted ( const HC_KEY  key,
const HSelectionSet selection_set,
const int  incl_count,
const HC_KEY  incl_keys[],
int  region 
)
static

Checks to see if a region is currently highlighted. If you do not have the HSmartSelItem object, but just have the keys and include list returned from HOOPS, you could use this method to find out if the key was selected

Parameters
keyHOOPS shell key to the item to be tested for selection.
selection_setA pointer to the HOOPS selection set in which this is to be tested.
incl_countNumber of include keys in the item segment path.
incl_keysAn array of HOOPS keys of all the include keys in the item path.
regionThe region number in the shell.
Returns
True if the item is currently highlighted, false if otherwise.

◆ QueryIncludeDependency()

virtual bool HSmartSelItem::QueryIncludeDependency ( HC_KEY  include_key,
HC_KEY &  ret_dependent_key 
)
virtual

Determines if the selection item has any dependency on the include key being provide. If it has, the api returns true and returns which key is dependent as the second argument.

Parameters
include_keyHC_KEY to include key on which the dependency is wanted.
ret_dependent_keyHC_KEY to segment/entity which depends on the include key.
Returns
True if the item has dependency on the include_key.

Implements HSelectionItem.

◆ SetHighlightMode()

virtual void HSmartSelItem::SetHighlightMode ( HSelectionHighlightMode  m)
inlinevirtual

Sets the selection highlight mode.

Parameters
mWhat the new highlight mode should be (see the SelectionHighlightMode enumeration for possible values)

References HSelectionSet::m_HighlightMode.

◆ UnHighlight()

virtual bool HSmartSelItem::UnHighlight ( )
virtual

Call this function to unhighlight the selection item.

Returns
True if the unhighlight is successful.

Implements HSelectionItem.

Reimplemented in HSubentitySelItem, and HRegionSelItem.

◆ UpdateIncludeDependency()

virtual bool HSmartSelItem::UpdateIncludeDependency ( HC_KEY  include_key,
HC_KEY  dependent_key,
HC_KEY  replacement_key 
)
virtual

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

Parameters
include_keyHC_KEY to include key which is deleted/going to be deleted
dependent_keyHC_KEY to segment/entity which depends on the include key
replacement_keynew HC_KEY as a replacement to the dependent key
Returns
True if the dependency has been successfully updated.

Implements HSelectionItem.

◆ UpdateIncludePath()

void HSmartSelItem::UpdateIncludePath ( int  incl_count,
HC_KEY  incl_keys[] 
)

Replace the original include path and count passed into the constructor.

Parameters
incl_countThe new number of keys in the include path
incl_keysAn array of include keys

The documentation for this class was generated from the following file: