HSelectionSet

Functions

HSelectionSet

~HSelectionSet

void

Init

void

Select

void

Select

void

SelectRegion

void

SelectSubentity

void

Select

void

DeSelect

void

DeSelect

void

DeSelect

void

DeSelectRegion

void

DeSelectRegion

void

DeSelectSubentity

bool

SelectSubentityOOC

bool

DeSelectOOC

bool

HighlightRegionEdges

void

HighlightRegionEdges

bool

HighlightAnnotations

void

HighlightAnnotations

HRegionEdgeHighlightMode

HighlightRegionEdgesAutoVisibility

void

HighlightRegionEdgesAutoVisibility

void

HighlightRegionEdgesAutoVisibility

void

HighlightRegionFacesAutoVisibility

HRegionFaceHighlightMode

HighlightRegionFacesAutoVisibility

void

DeSelectAll

bool

IsSelected

bool

IsSelected

bool

IsSelected

bool

IsRegionSelected

bool

IsHighlightSegment

void

SetSelectionFaceColor

void

SetGrayScale

void

SetInvisible

bool

GetInvisible

void

SetAllowDisplacement

bool

GetAllowDisplacement

HSelList *

GetSelectionList

void

GetSelectionFaceColor

void

SetSelectionEdgeColor

void

GetSelectionEdgeColor

void

SetSelectionCutEdgeColor

void

GetSelectionCutEdgeColor

void

SetSelectionCutFaceColor

void

GetSelectionCutFaceColor

void

SetSelectionMarkerColor

void

GetSelectionMarkerColor

void

SetSelectionEdgeWeight

float

GetSelectionEdgeWeight

void

SetSelectionMarkerSize

float

GetSelectionMarkerSize

HC_KEY

GetAt

bool

GetAll

HSelectionItem const *

GetSelectionItemAt

HSelectionItem const *

GetSelectionItem

unsigned int

GetSize

void

Reset

bool

DeleteSelection

HC_KEY

GetHighlightStyle

void

SetHighlightStyle

char const *

GetHighlightStyleName

bool

DeInstance

bool

DeInstance

bool

GetSubwindowPenetration

void

SetSubwindowPenetration

bool

GetAllowSubentitySelection

void

SetAllowSubentitySelection

HSelectLevel

GetSelectionLevel

void

SetSelectionLevel

bool

GetAllowEntitySelection

void

SetAllowEntitySelection

bool

GetAllowRegionSelection

void

SetAllowRegionSelection

void

RegisterHighlightSeg

void

UnRegisterHighlightSeg

const HSelectionHighlightMode

GetHighlightMode

void

SetHighlightMode

void

SetHighlightTransparency

HC_KEY

GetSelectionSegment

void

ToggleHighlightStyle

bool

GetIsSelection

bool

GetReferenceSelection

void

SetReferenceSelection

void

SetUseDefinedHighlight

bool

GetUseDefinedHighlight

void

SetReferenceSelectionType

HRefSelType

GetReferenceSelectionType

void

UpdateHighlightStyle

HVHashPShowCache *

GetPShowCache

void

SetPShowCache

void

FlushPShowCache

void

UpdateHighlighting

HBaseView *

GetView

void

SetSortSelectionList

bool

GetSortSelectionList

bool

GetSubentityFaceSelection

void

SetSubentityFaceSelection

bool

GetSubentityEdgeSelection

void

SetSubentityEdgeSelection

bool

GetSubentityVertexSelection

void

SetSubentityVertexSelection

void

SetAllowSubentityDeselection

bool

GetAllowSubentityDeselection

void

SetSubentityTracking

bool

GetSubentityTracking

void

GetSelectionBounding

void

SetSelectWillNotify

bool

GetSelectWillNotify

int

GetAttrLookupID

HSelectionSegmentConditionInfo *

GetSelectionSegmentConditionInfo

HConditionStyleKeyInfoHash *

GetConditionStyleKeyInfo

Detailed Description

class HSelectionSet

The HSelectionSet class manages a list of selected items.

HSelectionSet creates and stores a list of HOOPS geometric primitives or segments that are defined by operators which use the HOOPS routine HC_Compute_Selection. The class supports adding, removing individual and multiple items from the list. It encapsulates the logic used to check whether an item is already selected. Items that are selected (those in the list) are highlighted in the scene. HSelectionSet can be easily extended to support control of highlight mode and style (for example, color, lineweight, boundingbox style, or 2d_quickmoved geometry).

Public Functions

HSelectionSet(HBaseView *view, bool bReferenceSelection = false)

Construct an HSelectionSet object.

virtual ~HSelectionSet()
virtual void Init()

Initializes the selection list and updates all selection attributes in the associated view.

virtual void Select(HC_KEY key, int num_include_keys, HC_KEY include_keys[], bool emit_message = false)

Adds the item identified by ‘key’ to the selection list. If the item is geometry, that geometry is moved to a highlight segment (temporary segment with new attributes). If the item is a segment, the segment’s attributes are directly modified.

This method Selects a specific instance of a segment/geometric-primitive. This instance selection is necessary if a driver segment/subsegment with ‘view’ attributes is including a segment in the ‘include library’, and you only want that particular reference of the item to be selected/deselected (so that the item will highlight/dehighlight in 1 view rather than all views) If selection on a particular instance is not necessary, then set num_include_keys to 0, and set include_keys to NULL

If this method is overloaded, then the matching DeSelect and IsSelected methods should also be overloaded.

Parameters
  • key – The key of the item to add.

  • num_include_keys – The number of include keys in the path upto the driver key.

  • include_keys – An array of include keys.

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void Select(HSelectionItem *new_sel, bool emit_message = false)

Adds a custom selection item to the selection list. If one of the standard selection items is to be used, there is no compelling reason to use this function. Rather it is offered as a way of getting derived selection items into the selection list and having them behave in a natural way without violating the encapsulation of the HSelectionSet.

Very little work will be done with the selection item. You can expect to have its time stamp set and its Highlight() function called.

Parameters
  • new_sel – A pointer to a selection item.

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void SelectRegion(HShellObject const &oShell, int num_include_keys, HC_KEY include_keys[], int region, bool emit_message)

Adds a region of a shell identified by ‘key’ to the selection list.

This method Selects a specific instance of a segment/geometric-primitive. This instance selection is necessary if a driver segment/subsegment with ‘view’ attributes is including a segment in the ‘include library’, and you only want that particular reference of the item to be selected/deselected (so that the item will highlight/dehighlight in 1 view rather than all views) If selection on a particular instance is not necessary, then set num_include_keys to 0, and set include_keys to NULL

If this method is overloaded, then the matching DeSelect method should also be overloaded.

Parameters
  • oShell – The HShellObject to which the region belongs.

  • num_include_keys – The number of include keys in the path upto the driver key

  • include_keys – An array of include keys

  • region – The region in the shell to select

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void SelectSubentity(HC_KEY key, int num_include_keys, HC_KEY include_keys[], int count, int const faces[] = 0, int const vertex1[] = 0, int const vertex2[] = 0, bool emit_message = false)

Adds the geometry identified by ‘key’ to the selection list and highlights the indicated sub-elements.

This method selects specific sub-elements of a piece of geometry, usually a shell or mesh. The first three and final arguments are identical to Select(). The remaining four are typically used passed in from HC_Show_Selection_Elements().

If this method is overloaded, then the matching DeSelect and IsSelected methods should also be overloaded.

Parameters
  • key – The key of the geometry with sub-elements to be highlighted.

  • num_include_keys – The number of include keys in the path up to the driver key.

  • include_keys – An array of include keys.

  • count – The number of entries in the faces, vertex1, and vertex2 arrays. Typically the faces array is shorter than either vertex array. This is perfectly acceptable. In this case, simply pad the remainder of the array with -1.

  • faces – The face numbers to be highlighted. Each one of these represents a face in the geometry associated with key.

  • vertex1 – Array of indices into the points array of the geometry specified by key. Each of these indices represents a vertex to be highlighted.

  • vertex2 – Array of indices into the points array of the geometry specified by key. Each one of these indices represents a point that, when paired with the corresponding point in vertex1 array, represents an edge to be highlighted.

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void Select(HC_KEY key, char const *segpath, HC_KEY include_key, HC_KEY includer_key, bool emit_message = false)

Deprecated. This method has been replaced by the variant that accepts arguments for number of include keys (num_include_keys) and list of include keys (include_keys) Adds the key of an item to the selection list. If the item is geometry, that geometry is moved to a highlight segment (temporary segment with new attributes). If a segment, the segment’s attributes are directly modified.

Parameters
  • key – The key of the item to add.

  • segpath – The full name of the segment. Passed by reference.

  • include_key – The key to the include segment that owns geometry in the scene.

  • includer_key – The key to the segment in which ‘include_segment’ has been included.

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void DeSelect(HC_KEY key, bool emit_message = false)

Removes all items identified by ‘key’ from the selection list and modifies those item’s attributes so that they are no longer highlighted. Note that there can be multiple items identified by ‘key’ in the selection list, but with each item representing a different ‘selection instance’ of that item. For example, there might be 4 views of a model, and a particular item is selected in 2 of the views.

If it is desirable to DeSelect a single particular instance of an item, then call the DeSelect variant that accepts arguments for number of include keys (num_include_keys) and list of include keys (include_keys) to identified the specific view.

Parameters
  • key – The HOOPS key to the item to be deselected.

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void DeSelect(HC_KEY key, int num_include_keys, HC_KEY include_keys[], bool emit_message = false)

Removes an item from a list and modifies that item’s attributes so that it is no longer highlighted.

This variant DeSelects a specific instance of a segment/geometric-primitive (typically, this would be desirable if a driver segment/subsegment with ‘view’ attributes is including a segment in the ‘include library’, and you only want that particular reference of the item to be selected/deselected. In other words, use this method to deselect a given item for one view instead of the all views that are using it via the include library.

This variant should be overloaded if the matching ‘Select’ method has been overloaded.

Parameters
  • key – The HOOPS key to the item to be deselected.

  • num_include_keys – The number of include keys in the path upto the driver key

  • include_keys – An array of include keys

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void DeSelect(HSelectionItem *remove_sel, bool emit_message = false)

Removes an item from a list and modifies that item’s attributes so that it is no longer highlighted.

This variant DeSelects a specific selection item in the selection list. Use this variant if you are using a custom selection item or if you have already located the exact item you would like deselected.

Parameters
  • new_sel – A pointer to a selection item.

  • emit_message – Indicates that a message should be sent to the emit_message_function

virtual void DeSelectRegion(HShellObject const &oShell, int region, bool emit_messag)

Removes all items identified by ‘key’ from the selection list and modifies those item’s attributes so that they are no longer highlighted. Note that there can be multiple items identified by ‘key’ in the selection list, but with each item representing a different ‘selection instance’ of that item. For example, there might be 4 views of a model, and a particular item is selected in 2 of the views.

If it is desirable to DeSelect a single particular instance of an item, then call the DeSelect variant that accepts arguments for number of include keys (num_include_keys) and list of include keys (include_keys).

Parameters
  • oShell – The HShellObject to which the region belongs.

  • region – The region in the shell to deselect

  • emit_message – Indicates that a message should be sent to the emit_message_function, which (if implemented) would typically use the HOOPS/Net ‘Send’ function to dispatch the message to clients

virtual void DeSelectRegion(HShellObject const &oShell, int num_include_keys, HC_KEY include_keys[], int region, bool emit_message = false)

Removes a region of a shell from the selection list and modifies that item’s attributes so that it is no longer highlighted.

This variant DeSelects a specific instance of a segment/geometric-primitive (typically, this would be desirable if a driver segment/subsegment with ‘view’ attributes is including a segment in the ‘include library’, and you only want that particular reference of the item to be selected/deselected). In other words, use this method to DeSelect a given region for a specific view instead of all the views that used this region via the ‘include library.’

This variant should be overloaded if the matching ‘Select’ method has been overloaded.

Parameters
  • oShell – The HShellObject to which the region belongs.

  • num_include_keys – The number of include keys in the path upto the driver key

  • include_keys – An array of include keys

  • region – The region in the shell to deselect

  • emit_message – Indicates that a message should be sent to the emit_message_function, which (if implemented) would typically use the HOOPS/Net ‘Send’ function to dispatch the message to clients

virtual void DeSelectSubentity(HC_KEY key, int num_include_keys, HC_KEY include_keys[], int count, int const faces[], int const vertex1[], int const vertex2[], bool emit_message = false)

Removes a some or all of a subentity selection of a shell or meshfrom the selection list and modifies that item’s attributes so that it is no longer highlighted. It does this via a logical subtraction of the indicated elements from each subentity selection in the selection list. For discussion of arguments, see SelectSubentity().

virtual bool SelectSubentityOOC(HC_KEY key, int num_include_keys, HC_KEY include_keys[], int count, int const faces[] = 0, int const vertex1[] = 0, int const vertex2[] = 0, bool emit_message = false)
virtual bool DeSelectOOC(HC_KEY key, int num_include_keys, HC_KEY include_keys[], bool emit_message = false)
inline virtual bool HighlightRegionEdges()

Returns true if the edges in region selection will be highlighted. The default is true.

inline virtual void HighlightRegionEdges(bool yesno)

Sets whether or not edges in region selection will be highlighted.

inline virtual bool HighlightAnnotations()

Returns true if annotations will be highlighted. The default is true.

inline virtual void HighlightAnnotations(bool yesno)

Sets whether or MVO annotations will be highlighted.

inline virtual HRegionEdgeHighlightMode HighlightRegionEdgesAutoVisibility()

Returns the state of the edges in region selection. The default is visible.

inline virtual void HighlightRegionEdgesAutoVisibility(bool yesno)

Sets whether or not edges in region selection will be visible.

inline virtual void HighlightRegionEdgesAutoVisibility(HRegionEdgeHighlightMode edge_state)

Sets the state of the edges in region selection.

inline virtual void HighlightRegionFacesAutoVisibility(HRegionFaceHighlightMode face_state)

Sets the state of the edges in region selection.

inline virtual HRegionFaceHighlightMode HighlightRegionFacesAutoVisibility()

Returns the state of the edges in region selection. The default is visible.

virtual void DeSelectAll()

Removes all item from a list and modifies those items so that they are no longer highlighted. The base implementation of this method does NOT call the DeSelect method, due to performance concerns. If it is necessary for customized DeSelect logic to be executed for each item, then that should be handled in the overloaded implementation of this method. (The overloaded implementation should loop through the objects similar to the base method’s implementation, and perform custom DeSelect logic on each item as desired.)

virtual bool IsSelected(HC_KEY key) const

Determines if an item identified by ‘key’ is already in the current selection list.

If it is desirable to check if a particular instance of an item is selected, then call the IsSelected variant that accepts arguments for number of include keys (num_include_keys) and list of include keys (include_keys)

Parameters

key – The HOOPS key to the item to be checked.

Returns

True if the item is already selected, false if not.

virtual bool IsSelected(HC_KEY key, int num_include_keys, const HC_KEY include_keys[]) const

Determines if a specific selection instance of an item identified by ‘key’ is already in the current selection list.

This variant determines if a specific instance of a segment/geometric-primitive is selected (typically, this would be desirable if a driver segment/subsegment with ‘view’ attributes is including a segment in the ‘include library’, and you only want that particular reference of the item to be selected/deselected (so that the item will highlight/dehighlight in 1 view rather than all views).

This variant should be overloaded if the matching Select and DeSelect methods have been overloaded.

Parameters
  • key – The HOOPS key to the item to be checked.

  • num_include_keys – The number of include keys in the path upto the driver key.

  • include_keys – An array of include keys.

Returns

True if the item is already selected, false if not.

virtual bool IsSelected(HSelectionItem const *item) const

Determines if a specific selection item is already in the current selection list.

This variant determines if the exact HSelectionItem (or derived class) is already in the selection list. It does not examine sub-components to determine if an equivalent item is selected.

This variant should be overloaded if the matching Select and DeSelect methods have been overloaded.

Parameters

item – The HSelectionItem (or derived class) to be searched for.

Returns

True if the item is already selected, false if not.

virtual bool IsRegionSelected(HC_KEY key, int num_include_keys, const HC_KEY include_keys[], int region) const

Determines if a specific selection instance of a region identified by ‘key’ and ‘region’ is already in the current selection list.

This variant determines if a specific instance of a segment/geometric-primitive is selected (typically, this would be desirable if a driver segment/subsegment with ‘view’ attributes is including a segment in the ‘include library’, and you only want that particular reference of the item to be selected/deselected (so that the item will highlight/dehighlight in 1 view rather than all views).

This variant should be overloaded if the matching Select and DeSelect methods have been overloaded.

Parameters
  • key – The HOOPS shell key to the item to be checked.

  • num_include_keys – The number of include keys in the path upto the driver key

  • include_keys – An array of include keys

  • region – the region number we’re checking for

Returns

True if the item is already selected, false if not.

virtual bool IsHighlightSegment(HC_KEY segment_key) const

Determines if the segment key passed is the temporary highlight segment.

Parameters

segment_key – The HOOPS segment key to be checked.

Returns

true if the segment key is a temporary highlight segment

inline virtual void SetSelectionFaceColor(HPixelRGBA &rgba)

Sets the color to use for selected faces

Parameters

rgba – The color used to highlight selected faces.

virtual void SetGrayScale(bool grayScale)

Use this method to cause the scene to be drawn in grayscale.

Parameters

grayScale – Pass if true if you wish the scene to be drawn in grayscale and false if otherwise.

virtual void SetInvisible(bool Invisible)

Use this method to cause the highlighted item to be invisible.

Parameters

Invisible – Pass if true if you wish the items to beinvisible and false if otherwise.

inline virtual bool GetInvisible()

Use this method to find out if highlighted items will be invisible.

Returns

True if HOOPS will hide selected items.

inline virtual void SetAllowDisplacement(bool allowDisplacement)

Use this method to allow or disallow HOOPS to draw selected segments in front of coincident geometry.

inline virtual bool GetAllowDisplacement()

Use this method to find out if HOOPS will push back coincident geometry and draw selected items in front.

Returns

True if HOOPS will draw selected segments in front of coincident geometry.

virtual HSelList *GetSelectionList()

Returns the current selection list pointer. This function is deprecated and should not be used. To retrieve members from the selection list, use GetAt() instead.

Returns

A HSelList pointer to current selection list.

inline virtual void GetSelectionFaceColor(HPixelRGBA &rgba)

Returns the current color for selected faces

Parameters

rgba – This method populates this parameter with the color used to highlight selected faces.

inline virtual void SetSelectionEdgeColor(HPixelRGBA &rgb)

Sets the color to use for selected edges

Parameters

rgb – The color used to highlight selected edges.

inline virtual void GetSelectionEdgeColor(HPixelRGBA &rgba)

Returns the current color for selected Edges.

Parameters

rgba – This method populates this parameter with the color used to highlight selected edges.

inline virtual void SetSelectionCutEdgeColor(HPixelRGBA &rgb)

Sets the color to use for selected cutting edges.

Parameters

rgb – The color used to highlight selected cutting edges.

inline virtual void GetSelectionCutEdgeColor(HPixelRGBA &rgba)

Returns the current color for selected cutting edges.

Parameters

rgba – This method populates this parameter with the color used to highlight selected cutting edges.

inline virtual void SetSelectionCutFaceColor(HPixelRGBA &rgb)

Sets the color to use for selected cutting faces.

Parameters

rgb – The highlight color for selected cutting faces.

inline virtual void GetSelectionCutFaceColor(HPixelRGBA &rgba)

Returns the current color for selected cutting faces.

Parameters

rgba – This method populates this parameter with the color used to highlight selected cutting faces.

inline virtual void SetSelectionMarkerColor(HPixelRGBA &rgb)

Sets the color to use for selected markers.

Parameters

rgb – The highlight color you want to use for selected markers.

inline virtual void GetSelectionMarkerColor(HPixelRGBA &rgba)

Returns the current color for selected Markers.

Parameters

rgba – The method populates this parameter with the highlight color for selected markers.

inline virtual void SetSelectionEdgeWeight(float weight)

Sets the weight to use for highlighting selected edges.

Parameters

weight – The edge weight used for highlighting.

inline virtual float GetSelectionEdgeWeight()

Returns the current edge weight used to highlight selected edges.

Returns

Selection edge weight.

inline virtual void SetSelectionMarkerSize(float size)

Sets the size to use for selected markers.

Parameters

sizeSize of the current marker used for highlighting

inline virtual float GetSelectionMarkerSize()

Returns the current marker size used to highlight selected markers.

Returns

Selection marker size

virtual HC_KEY GetAt(unsigned int index)

Returns the value of a given list item. Note: if it is important that the list order be the same as the selection order, call SetSortSelectionList first.

Parameters

index – The index into the list.

Returns

The item at a given offset within the list. Returns INVALID_KEY if no item is found.

virtual bool GetAll(HC_KEY out_array[])

Fills the keys of the selection list in to an array. Note: if it is important that the list order be the same as the selection order, call SetSortSelectionList first.

Parameters

out_array – A key array that is pre-sized to receive all the selection keys.

Returns

This returns true if it succeeds or false if it fails.

HSelectionItem const *GetSelectionItemAt(unsigned int index)

Returns the selection item object pointer at the given offset.

Parameters

index – The index into the list.

Returns

The item at a given offset within the list. Returns 0, if no item is found.

HSelectionItem const *GetSelectionItem(HC_KEY key)

Returns the selection item object pointer with the given key.

Parameters

key – The key of the selection item you are interested in.

Returns

The item with the given key within the list. Returns 0, if no item is found.

unsigned int GetSize() const
Returns

The length of the current selection list.

virtual void Reset()

Resets the selection list length to zero.

virtual bool DeleteSelection(bool emit_message = false)

Deletes all the items currently selected.

Parameters

emit_message – Indicates that a message should be sent to the emit_message_function, which (if implemented) would typically use the HOOPS/Net ‘Send’ function to dispatch the message to clients.

Returns

True if the currently selected items were successfully deleted.

inline HC_KEY GetHighlightStyle() const

Returns the key to style segment which is being used to highlight the selection items.

Returns

HC_KEY to highlight style segment.

inline void SetHighlightStyle(HC_KEY key)
inline char const *GetHighlightStyleName() const
bool DeInstance(HSelectionItem *sel_item)

If the selected item is a shared segment or entity, this method will make a copy of it so that it is not shared anymore. Use this method when you want to physically modify the selection (delete, transform, color) and, at the same time, only

affect the selected entity (even if it is shared). Once the method is finished, the sel_item will be the selection item itself which with the newly changed data. Using GetKey function, you can access the new key to de-instanced segment/entity. The function will copy every segment that is include from top (except for the topmost which is assumed to be model segment included by view).

NOTE:

  1. This will change the segment hierarchy of the model and hence will update any other selection made.

  2. The selection item has to be a part of current selection list to be able to de-instance.

Parameters

sel_item – The HSelectionItem item you wish to deinstance.

Returns

True if successful and false if otherwise.

bool DeInstance(unsigned int index)

Deinstances the item located at index in the selection list.

Parameters

index – the index in the selection list of the item you wish to deinstance.

Returns

True if successful and false if otherwise.

inline virtual bool GetSubwindowPenetration()
Returns

A boolean indicating whether the HSelectionSet allows Selection through Subwindows. Note that this behavior is undefined in conjunction with reference selection. Default setting is false.

virtual void SetSubwindowPenetration(bool allow)

Sets the entity selection mode for the HSelectionSet.

Parameters

allow – If true, then Selection through Subwindows is enabled. Otherwise, subwindows block the selection from walking the tree below them. Note that this behavior is undefined in conjunction with reference selection. Default setting is false.

inline virtual bool GetAllowSubentitySelection()
Returns

A boolean indicating whether the HSelectionSet allows Subentity Selection.

virtual void SetAllowSubentitySelection(bool allow)

Sets the subentity selection mode for the HSelectionSet.

Parameters

allow – If true, then Subentity Selection is enabled.

inline virtual HSelectLevel GetSelectionLevel() const
Returns

An enumeration indicating whether the HSelectionSet allows segment, entity, region, or subentity selection.

virtual void SetSelectionLevel(HSelectLevel level)
Parameters

level – An enumeration indicating whether the HSelectionSet should allow segment, entity, region, or subentity selection.

inline virtual bool GetAllowEntitySelection()
Returns

A boolean indicating whether the HSelectionSet allows Entity Selection.

virtual void SetAllowEntitySelection(bool allow)

Sets the entity selection mode for the HSelectionSet.

Parameters

allow – If true, then Entity Selection is enabled.

inline virtual bool GetAllowRegionSelection() const
Returns

A boolean indicating whether the HSelectionSet allows Region Selection.

virtual void SetAllowRegionSelection(bool allow)

Call this method to enable or disable region selection mode for the HSelectionSet.

Parameters

allow – If true, then Region Selection is allowed.

void RegisterHighlightSeg(HC_KEY seg_key)

Used by HSelectionItem to add a segment to the list when it has been highlighted.

Parameters

segment_key – The HOOPS segment key to be registered.

void UnRegisterHighlightSeg(HC_KEY seg_key)

Used by HSelectionItem removed segment from the list once it has been unhighlighted.

Parameters

segment_key – The HOOPS segment key to be unregistered.

inline virtual const HSelectionHighlightMode GetHighlightMode()
Returns

The selection highlight mode.

virtual void SetHighlightMode(HSelectionHighlightMode m)

This function determines the behavior when an object is selected.

Setting the mode to HighlightDefault is the classical HOOPS behavior whereby highlighting is achieved by using a conditional include to modify the color of the actual geometry. This is very robust and time-tested, but has the disadvantage of modifying the actual segment structure. As a result, a full update is typically required and, if the static model is being used, it will need to be regenerated.

HighlightQuickmoves, on the other hand, uses quick moves to draw another copy of the selected geometry over the top of the existing one. This has two benefits. It does not require a full update, improving behavior on large models. Further, because it does not modify the segment structure, static models do not need to be regenerated.

InverseTransparency uses the same mechanics as HighlightDefault — and inherits all its benefits and drawbacks — to achieve a very different effect. When an object is selected with this highlight mode, the selected object does not change. Instead the rest of the model becomes transparent (use SetHighlightTransparency() to set how transparent). Use of this mode has the largest performance implications. Not only does it modify the segment structure, but it also creates a potentially large amount of transparent geometry which can be computationally intensive to render.

ColoredInverseTransparency is identical to InverseTransparency highlighting detailed above except the selected object(s) are highlighted in the highlight color.

Parameters

m – the new highlight mode (see the SelectionHighlightMode enumeration for possible values)

virtual void SetHighlightTransparency(float trans)

Sets the transparency level of unselected geometry in inverse transparency selection mode.

inline virtual HC_KEY GetSelectionSegment()

Returns the key to the selection segment

Returns

key to selection segment.

void ToggleHighlightStyle()

Unhighlights all selection items, toggles the highlight style between quickmoves and conditional highlighting, and re-highlights them all in the new style. This method is deprecated. It has no effect if the highlight mode is not either quickmoves or conditional.

virtual bool GetIsSelection(HC_KEY key)

Returns true if the key is the selection segment or a child of it

Parameters

key – key of the object to be queried.

inline virtual bool GetReferenceSelection() const

Returns true if either inverse transparency or quickmoves highlighting are being used.reference selection is currently being used.

Returns

the current reference selection state.

inline virtual void SetReferenceSelection(bool ref_sel)

This function is deprecated. The correct way to do this is to call SetHighlightMode(HighlightQuickmoves) or SetHighlightMode(HighlightDefault).

Parameters

ref_sel – the new reference selection state.

void SetUseDefinedHighlight(bool use_defined_highlight)

If this is set then HighlightQuickmoves will use 3dgs built in defined highlighting rather than MVO highlighting code.

Parameters

use_defined_highlight – the new use defined highlight state.

inline bool GetUseDefinedHighlight()

Returns true if 3dgs built in defined highlighting is going to be used for HighlightQuickmoves.

Returns

the current use defined highlight state.

virtual void SetReferenceSelectionType(HRefSelType type)

Overwrites the default quick moves type (spriting) with type

Parameters

type – the new reference selection type.

inline virtual HRefSelType GetReferenceSelectionType()
virtual void UpdateHighlightStyle()

Updates all the attributes of the highlight style segment from the members

inline HVHashPShowCache *GetPShowCache()

Gets a pointer to the PShow cache hash table used for improving performance of area selection.

Returns

PShow cache hash pointer

inline void SetPShowCache(HVHashPShowCache *new_cache)

Replaces the current PShow cache (if any) with a new one. If one already exists, FlushPShowCache() should be called before replacing it.

Parameters

new_cache – the new cache hash table to use

void FlushPShowCache()

Discards the current PShow cache hash and frees all the elements.

void UpdateHighlighting()

Updates all reference highlighting. This can be slow with large selection sets.

inline HBaseView *GetView()
inline void SetSortSelectionList(bool sort)

If set, the selection list will be sorted before it is returned via GetSelectionList()

inline bool GetSortSelectionList()

If set, the selection list will be sorted before it is returned via GetSelectionList()

inline virtual bool GetSubentityFaceSelection()

Will faces be highlighted if subentity selection is enabled?

inline virtual void SetSubentityFaceSelection(bool select)

Set whether faces be highlighted if subentity selection is enabled.

inline virtual bool GetSubentityEdgeSelection()

Will edges be highlighted if subentity selection is enabled?

inline virtual void SetSubentityEdgeSelection(bool select)

Set whether edges be highlighted if subentity selection is enabled.

inline virtual bool GetSubentityVertexSelection()

Will vertices be highlighted if subentity selection is enabled?

inline virtual void SetSubentityVertexSelection(bool select)

Set whether vertices be highlighted if subentity selection is enabled.

inline virtual void SetAllowSubentityDeselection(bool allow)

Alias for SetSubentityTracking().

inline virtual bool GetAllowSubentityDeselection()

Alias for GetSubentityTracking().

inline virtual void SetSubentityTracking(bool allow)

This method controls whether subentity selections can be deleted or partially deselected. By default this is set to true which means selection information for the source geometry will be retained. If this is set to false, no deletion can occur and subentity selections can only be de-selected as a whole. Doing so does, however, reduce memory requirements which can be potentially large, depending on the size of the source geometry and the number of subentity selections.

inline virtual bool GetSubentityTracking()

Returns whether subentity selections can be deleted or partially deselected. See SetSubentityTracking() for details.

void GetSelectionBounding(HPoint *minimum, HPoint *maximum) const

Retrieves a bounding box for the currently selected geometry in world space.

Parameters
  • minimum – the minimum values for the x, y, and z components of the bounding box.

  • maximum – the maximum values for the x, y, and z components of the bounding box.

inline virtual void SetSelectWillNotify(bool notify)
Parameters

allow – If true, then Select() will notify is enabled.

inline virtual bool GetSelectWillNotify() const
Returns

A boolean indicating whether Select() will notify.

int GetAttrLookupID(char const *attribute_string)
HSelectionSegmentConditionInfo *GetSelectionSegmentConditionInfo()
HConditionStyleKeyInfoHash *GetConditionStyleKeyInfo()