The HSelectionSet class manages a list of selected items. More...
#include <HSelectionSet.h>
Public Member Functions | |
bool | DeInstance (HSelectionItem *sel_item) |
bool | DeInstance (unsigned int index) |
virtual bool | DeleteSelection (bool emit_message=false) |
virtual void | DeSelect (HC_KEY key, bool emit_message=false) |
virtual void | DeSelect (HC_KEY key, int num_include_keys, HC_KEY include_keys[], bool emit_message=false) |
virtual void | DeSelect (HSelectionItem *remove_sel, bool emit_message=false) |
virtual void | DeSelectAll () |
virtual bool | DeSelectOOC (HC_KEY key, int num_include_keys, HC_KEY include_keys[], bool emit_message=false) |
virtual void | DeSelectRegion (HShellObject const &oShell, int region, bool emit_messag) |
virtual void | DeSelectRegion (HShellObject const &oShell, int num_include_keys, HC_KEY include_keys[], int region, bool emit_message=false) |
virtual void | DeSelectSubentity (HC_KEY key, int num_include_keys, HC_KEY include_keys[], int count, const int faces[], const int vertex1[], const int vertex2[], bool emit_message=false) |
void | FlushPShowCache () |
virtual bool | GetAll (HC_KEY out_array[]) |
virtual bool | GetAllowDisplacement () |
virtual bool | GetAllowEntitySelection () |
virtual bool | GetAllowRegionSelection () const |
virtual bool | GetAllowSubentityDeselection () |
virtual bool | GetAllowSubentitySelection () |
virtual HC_KEY | GetAt (unsigned int index) |
int | GetAttrLookupID (const char *attribute_string) |
HConditionStyleKeyInfoHash * | GetConditionStyleKeyInfo () |
virtual const HSelectionHighlightMode | GetHighlightMode () |
HC_KEY | GetHighlightStyle () const |
const char * | GetHighlightStyleName () const |
virtual bool | GetInvisible () |
virtual bool | GetIsSelection (HC_KEY key) |
HVHashPShowCache * | GetPShowCache () |
virtual bool | GetReferenceSelection () const |
virtual HRefSelType | GetReferenceSelectionType () |
void | GetSelectionBounding (HPoint *minimum, HPoint *maximum) const |
virtual void | GetSelectionCutEdgeColor (HPixelRGBA &rgba) |
virtual void | GetSelectionCutFaceColor (HPixelRGBA &rgba) |
virtual void | GetSelectionEdgeColor (HPixelRGBA &rgba) |
virtual float | GetSelectionEdgeWeight () |
virtual void | GetSelectionFaceColor (HPixelRGBA &rgba) |
const HSelectionItem * | GetSelectionItem (HC_KEY key) |
const HSelectionItem * | GetSelectionItemAt (unsigned int index) |
virtual HSelectLevel | GetSelectionLevel () const |
virtual HSelList * | GetSelectionList () |
virtual void | GetSelectionMarkerColor (HPixelRGBA &rgba) |
virtual float | GetSelectionMarkerSize () |
virtual HC_KEY | GetSelectionSegment () |
HSelectionSegmentConditionInfo * | GetSelectionSegmentConditionInfo () |
virtual bool | GetSelectWillNotify () const |
unsigned int | GetSize () const |
bool | GetSortSelectionList () |
virtual bool | GetSubentityEdgeSelection () |
virtual bool | GetSubentityFaceSelection () |
virtual bool | GetSubentityTracking () |
virtual bool | GetSubentityVertexSelection () |
virtual bool | GetSubwindowPenetration () |
bool | GetUseDefinedHighlight () |
HBaseView * | GetView () |
virtual bool | HighlightAnnotations () |
virtual void | HighlightAnnotations (bool yesno) |
virtual bool | HighlightRegionEdges () |
virtual void | HighlightRegionEdges (bool yesno) |
virtual HRegionEdgeHighlightMode | HighlightRegionEdgesAutoVisibility () |
virtual void | HighlightRegionEdgesAutoVisibility (bool yesno) |
virtual void | HighlightRegionEdgesAutoVisibility (HRegionEdgeHighlightMode edge_state) |
virtual void | HighlightRegionFacesAutoVisibility (HRegionFaceHighlightMode face_state) |
virtual HRegionFaceHighlightMode | HighlightRegionFacesAutoVisibility () |
HSelectionSet (HBaseView *view, bool bReferenceSelection=false) | |
virtual void | Init () |
virtual bool | IsHighlightSegment (HC_KEY segment_key) const |
virtual bool | IsRegionSelected (HC_KEY key, int num_include_keys, const HC_KEY include_keys[], int region) const |
virtual bool | IsSelected (HC_KEY key) const |
virtual bool | IsSelected (HC_KEY key, int num_include_keys, const HC_KEY include_keys[]) const |
virtual bool | IsSelected (const HSelectionItem *item) const |
void | RegisterHighlightSeg (HC_KEY seg_key) |
virtual void | Reset () |
virtual void | Select (HC_KEY key, int num_include_keys, HC_KEY include_keys[], bool emit_message=false) |
virtual void | Select (HSelectionItem *new_sel, bool emit_message=false) |
virtual void | Select (HC_KEY key, const char *segpath, HC_KEY include_key, HC_KEY includer_key, bool emit_message=false) |
virtual void | SelectRegion (HShellObject const &oShell, int num_include_keys, HC_KEY include_keys[], int region, bool emit_message) |
virtual void | SelectSubentity (HC_KEY key, int num_include_keys, HC_KEY include_keys[], int count, const int faces[]=0, const int vertex1[]=0, const int vertex2[]=0, bool emit_message=false) |
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 void | SetAllowDisplacement (bool allowDisplacement) |
virtual void | SetAllowEntitySelection (bool allow) |
virtual void | SetAllowRegionSelection (bool allow) |
virtual void | SetAllowSubentityDeselection (bool allow) |
virtual void | SetAllowSubentitySelection (bool allow) |
virtual void | SetGrayScale (bool grayScale) |
virtual void | SetHighlightMode (HSelectionHighlightMode m) |
void | SetHighlightStyle (HC_KEY key) |
virtual void | SetHighlightTransparency (float trans) |
virtual void | SetInvisible (bool Invisible) |
void | SetPShowCache (HVHashPShowCache *new_cache) |
virtual void | SetReferenceSelection (bool ref_sel) |
virtual void | SetReferenceSelectionType (HRefSelType type) |
virtual void | SetSelectionCutEdgeColor (HPixelRGBA &rgb) |
virtual void | SetSelectionCutFaceColor (HPixelRGBA &rgb) |
virtual void | SetSelectionEdgeColor (HPixelRGBA &rgb) |
virtual void | SetSelectionEdgeWeight (float weight) |
virtual void | SetSelectionFaceColor (HPixelRGBA &rgba) |
virtual void | SetSelectionLevel (HSelectLevel level) |
virtual void | SetSelectionMarkerColor (HPixelRGBA &rgb) |
virtual void | SetSelectionMarkerSize (float size) |
virtual void | SetSelectWillNotify (bool notify) |
void | SetSortSelectionList (bool sort) |
virtual void | SetSubentityEdgeSelection (bool select) |
virtual void | SetSubentityFaceSelection (bool select) |
virtual void | SetSubentityTracking (bool allow) |
virtual void | SetSubentityVertexSelection (bool select) |
virtual void | SetSubwindowPenetration (bool allow) |
void | SetUseDefinedHighlight (bool use_defined_highlight) |
void | ToggleHighlightStyle () |
void | UnRegisterHighlightSeg (HC_KEY seg_key) |
void | UpdateHighlighting () |
virtual void | UpdateHighlightStyle () |
Protected Member Functions | |
virtual void | UpdateTransparency (bool force_flush=false) |
Protected Attributes | |
bool | m_bAllowDisplacement |
This indicates whether selected segments should be drawn in front of coincident geometry. | |
bool | m_bForceGrayScale |
This flag indicating whether to use gray scale selection. | |
bool | m_bForceInvisible |
This flag indicating whether to make the selected items invisible. | |
bool | m_bHighlightAnnotations |
This indicates whether MVO annotations should be highlighted. | |
bool | m_bHighlightRegionEdges |
This indicates whether edges in a region should be highlighted. | |
HRegionEdgeHighlightMode | m_bHighlightRegionEdgesAutoVisibility |
This indicates whether edges in a region should be automatically made visible when highlighted. | |
HRegionFaceHighlightMode | m_bHighlightRegionFacesAutoVisibility |
This indicates whether faces in a region should be automatically made visible when highlighted. | |
bool | m_bNotify |
If this is set Select() will send HSignalSelected for each item. | |
bool | m_bSortSelectionList |
If this is set, the selection list will be sorted before returning it. | |
bool | m_bUseDefinedHighlight |
float | m_fselectedEdgeWeight |
The line thickness used for selected edges. | |
float | m_fselectedMarkerSize |
The marker size used for selected markers. | |
float | m_fTransmission |
the transmission value used in Inverse Transparency highlighting | |
HSelectionHighlightMode | m_HighlightMode |
Stores the current highlighting mode. | |
struct vhash_s * | m_pHighlightSegsHash |
The list of highlighted segment keys. | |
HSelList * | m_pSelItemsList |
The list of selected HOOPS entities (HSelectionItem pointers). | |
HBaseView * | m_pView |
The HOOPS HBaseView associated with to this HSelectionSet. | |
HPixelRGBA | m_selectedCutEdgeColor |
The color used for selected cut edges. | |
HPixelRGBA | m_selectedCutFaceColor |
The color used for selected cut faces. | |
HPixelRGBA | m_selectedEdgeColor |
The color used for selected edges. | |
HPixelRGBA | m_selectedFaceColor |
The color used for selected faces. | |
HPixelRGBA | m_selectedMarkerColor |
The color used for selected markers. | |
HC_KEY | m_SelectionSegment |
The key of the reference selection segment. | |
HC_KEY | m_TransparencyStyle |
The key to a style used in inverse transparency highlighting. | |
Friends | |
class | HBaseView |
Detailed Description
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).
Constructor & Destructor Documentation
◆ HSelectionSet()
HSelectionSet::HSelectionSet | ( | HBaseView * | view, |
bool | bReferenceSelection = false |
||
) |
Construct an HSelectionSet object.
Member Function Documentation
◆ DeInstance() [1/2]
bool HSelectionSet::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:
- This will change the segment hierarchy of the model and hence will update any other selection made.
- 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.
◆ DeInstance() [2/2]
bool HSelectionSet::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.
◆ DeleteSelection()
|
virtual |
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.
◆ DeSelect() [1/3]
|
virtual |
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
◆ DeSelect() [2/3]
|
virtual |
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
◆ DeSelect() [3/3]
|
virtual |
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
◆ DeSelectAll()
|
virtual |
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.)
◆ DeSelectRegion() [1/2]
|
virtual |
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
◆ DeSelectRegion() [2/2]
|
virtual |
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
◆ DeSelectSubentity()
|
virtual |
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().
◆ FlushPShowCache()
void HSelectionSet::FlushPShowCache | ( | ) |
Discards the current PShow cache hash and frees all the elements.
◆ GetAll()
|
virtual |
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.
◆ GetAllowDisplacement()
|
inlinevirtual |
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.
◆ GetAllowEntitySelection()
|
inlinevirtual |
- Returns
- A boolean indicating whether the HSelectionSet allows Entity Selection.
References HSelectEntity.
◆ GetAllowRegionSelection()
|
inlinevirtual |
- Returns
- A boolean indicating whether the HSelectionSet allows Region Selection.
References HSelectRegion.
◆ GetAllowSubentityDeselection()
|
inlinevirtual |
Alias for GetSubentityTracking().
◆ GetAllowSubentitySelection()
|
inlinevirtual |
- Returns
- A boolean indicating whether the HSelectionSet allows Subentity Selection.
References HSelectSubentity.
◆ GetAt()
|
virtual |
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.
◆ GetHighlightMode()
|
inlinevirtual |
- Returns
- The selection highlight mode.
◆ GetHighlightStyle()
|
inline |
Returns the key to style segment which is being used to highlight the selection items.
- Returns
- HC_KEY to highlight style segment.
◆ GetInvisible()
|
inlinevirtual |
Use this method to find out if highlighted items will be invisible.
- Returns
- True if HOOPS will hide selected items.
◆ GetIsSelection()
|
virtual |
Returns true if the key is the selection segment or a child of it
- Parameters
-
key key of the object to be queried.
◆ GetPShowCache()
|
inline |
Gets a pointer to the PShow cache hash table used for improving performance of area selection.
- Returns
- PShow cache hash pointer
◆ GetReferenceSelection()
|
inlinevirtual |
Returns true if either inverse transparency or quickmoves highlighting are being used.reference selection is currently being used.
- Returns
- the current reference selection state.
References HighlightDefault, and HSelectSubentity.
◆ GetSelectionBounding()
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.
◆ GetSelectionCutEdgeColor()
|
inlinevirtual |
Returns the current color for selected cutting edges.
- Parameters
-
rgba This method populates this parameter with the color used to highlight selected cutting edges.
◆ GetSelectionCutFaceColor()
|
inlinevirtual |
Returns the current color for selected cutting faces.
- Parameters
-
rgba This method populates this parameter with the color used to highlight selected cutting faces.
◆ GetSelectionEdgeColor()
|
inlinevirtual |
Returns the current color for selected Edges.
- Parameters
-
rgba This method populates this parameter with the color used to highlight selected edges.
◆ GetSelectionEdgeWeight()
|
inlinevirtual |
Returns the current edge weight used to highlight selected edges.
- Returns
- Selection edge weight.
◆ GetSelectionFaceColor()
|
inlinevirtual |
Returns the current color for selected faces
- Parameters
-
rgba This method populates this parameter with the color used to highlight selected faces.
◆ GetSelectionItem()
const HSelectionItem* HSelectionSet::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.
◆ GetSelectionItemAt()
const HSelectionItem* HSelectionSet::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.
◆ GetSelectionLevel()
|
inlinevirtual |
- Returns
- An enumeration indicating whether the HSelectionSet allows segment, entity, region, or subentity selection.
◆ GetSelectionList()
|
virtual |
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.
◆ GetSelectionMarkerColor()
|
inlinevirtual |
Returns the current color for selected Markers.
- Parameters
-
rgba The method populates this parameter with the highlight color for selected markers.
◆ GetSelectionMarkerSize()
|
inlinevirtual |
Returns the current marker size used to highlight selected markers.
- Returns
- Selection marker size
◆ GetSelectionSegment()
|
inlinevirtual |
Returns the key to the selection segment
- Returns
- key to selection segment.
◆ GetSelectWillNotify()
|
inlinevirtual |
- Returns
- A boolean indicating whether Select() will notify.
◆ GetSize()
unsigned int HSelectionSet::GetSize | ( | ) | const |
- Returns
- The length of the current selection list.
◆ GetSortSelectionList()
|
inline |
If set, the selection list will be sorted before it is returned via GetSelectionList()
◆ GetSubentityEdgeSelection()
|
inlinevirtual |
Will edges be highlighted if subentity selection is enabled?
◆ GetSubentityFaceSelection()
|
inlinevirtual |
Will faces be highlighted if subentity selection is enabled?
◆ GetSubentityTracking()
|
inlinevirtual |
Returns whether subentity selections can be deleted or partially deselected. See SetSubentityTracking() for details.
◆ GetSubentityVertexSelection()
|
inlinevirtual |
Will vertices be highlighted if subentity selection is enabled?
◆ GetSubwindowPenetration()
|
inlinevirtual |
- 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.
◆ GetUseDefinedHighlight()
|
inline |
Returns true if 3dgs built in defined highlighting is going to be used for HighlightQuickmoves.
- Returns
- the current use defined highlight state.
◆ HighlightAnnotations() [1/2]
|
inlinevirtual |
Returns true if annotations will be highlighted. The default is true.
◆ HighlightAnnotations() [2/2]
|
inlinevirtual |
Sets whether or MVO annotations will be highlighted.
◆ HighlightRegionEdges() [1/2]
|
inlinevirtual |
Returns true if the edges in region selection will be highlighted. The default is true.
◆ HighlightRegionEdges() [2/2]
|
inlinevirtual |
Sets whether or not edges in region selection will be highlighted.
◆ HighlightRegionEdgesAutoVisibility() [1/3]
|
inlinevirtual |
Returns the state of the edges in region selection. The default is visible.
◆ HighlightRegionEdgesAutoVisibility() [2/3]
|
inlinevirtual |
Sets whether or not edges in region selection will be visible.
◆ HighlightRegionEdgesAutoVisibility() [3/3]
|
inlinevirtual |
Sets the state of the edges in region selection.
◆ HighlightRegionFacesAutoVisibility() [1/2]
|
inlinevirtual |
Sets the state of the edges in region selection.
◆ HighlightRegionFacesAutoVisibility() [2/2]
|
inlinevirtual |
Returns the state of the edges in region selection. The default is visible.
◆ Init()
|
virtual |
Initializes the selection list and updates all selection attributes in the associated view.
◆ IsHighlightSegment()
|
virtual |
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
◆ IsRegionSelected()
|
virtual |
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.
◆ IsSelected() [1/3]
|
virtual |
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.
◆ IsSelected() [2/3]
|
virtual |
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.
◆ IsSelected() [3/3]
|
virtual |
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.
◆ RegisterHighlightSeg()
void HSelectionSet::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.
◆ Reset()
|
virtual |
Resets the selection list length to zero.
◆ Select() [1/3]
|
virtual |
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
◆ Select() [2/3]
|
virtual |
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
◆ Select() [3/3]
|
virtual |
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
◆ SelectRegion()
|
virtual |
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
◆ SelectSubentity()
|
virtual |
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
◆ SetAllowDisplacement()
|
inlinevirtual |
Use this method to allow or disallow HOOPS to draw selected segments in front of coincident geometry.
◆ SetAllowEntitySelection()
|
virtual |
Sets the entity selection mode for the HSelectionSet.
- Parameters
-
allow If true, then Entity Selection is enabled.
◆ SetAllowRegionSelection()
|
virtual |
Call this method to enable or disable region selection mode for the HSelectionSet.
- Parameters
-
allow If true, then Region Selection is allowed.
◆ SetAllowSubentityDeselection()
|
inlinevirtual |
Alias for SetSubentityTracking().
◆ SetAllowSubentitySelection()
|
virtual |
Sets the subentity selection mode for the HSelectionSet.
- Parameters
-
allow If true, then Subentity Selection is enabled.
◆ SetGrayScale()
|
virtual |
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.
◆ SetHighlightMode()
|
virtual |
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)
◆ SetHighlightTransparency()
|
virtual |
Sets the transparency level of unselected geometry in inverse transparency selection mode.
◆ SetInvisible()
|
virtual |
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.
◆ SetPShowCache()
|
inline |
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
◆ SetReferenceSelection()
|
inlinevirtual |
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.
References HighlightDefault, and HighlightQuickmoves.
◆ SetReferenceSelectionType()
|
virtual |
Overwrites the default quick moves type (spriting) with type
- Parameters
-
type the new reference selection type.
◆ SetSelectionCutEdgeColor()
|
inlinevirtual |
Sets the color to use for selected cutting edges.
- Parameters
-
rgb The color used to highlight selected cutting edges.
◆ SetSelectionCutFaceColor()
|
inlinevirtual |
Sets the color to use for selected cutting faces.
- Parameters
-
rgb The highlight color for selected cutting faces.
◆ SetSelectionEdgeColor()
|
inlinevirtual |
Sets the color to use for selected edges
- Parameters
-
rgb The color used to highlight selected edges.
◆ SetSelectionEdgeWeight()
|
inlinevirtual |
Sets the weight to use for highlighting selected edges.
- Parameters
-
weight The edge weight used for highlighting.
◆ SetSelectionFaceColor()
|
inlinevirtual |
Sets the color to use for selected faces
- Parameters
-
rgba The color used to highlight selected faces.
◆ SetSelectionLevel()
|
virtual |
- Parameters
-
level An enumeration indicating whether the HSelectionSet should allow segment, entity, region, or subentity selection.
◆ SetSelectionMarkerColor()
|
inlinevirtual |
Sets the color to use for selected markers.
- Parameters
-
rgb The highlight color you want to use for selected markers.
◆ SetSelectionMarkerSize()
|
inlinevirtual |
Sets the size to use for selected markers.
- Parameters
-
size Size of the current marker used for highlighting
◆ SetSelectWillNotify()
|
inlinevirtual |
- Parameters
-
allow If true, then Select() will notify is enabled.
◆ SetSortSelectionList()
|
inline |
If set, the selection list will be sorted before it is returned via GetSelectionList()
◆ SetSubentityEdgeSelection()
|
inlinevirtual |
Set whether edges be highlighted if subentity selection is enabled.
◆ SetSubentityFaceSelection()
|
inlinevirtual |
Set whether faces be highlighted if subentity selection is enabled.
◆ SetSubentityTracking()
|
inlinevirtual |
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.
◆ SetSubentityVertexSelection()
|
inlinevirtual |
Set whether vertices be highlighted if subentity selection is enabled.
◆ SetSubwindowPenetration()
|
virtual |
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.
◆ SetUseDefinedHighlight()
void HSelectionSet::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.
◆ ToggleHighlightStyle()
void HSelectionSet::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.
◆ UnRegisterHighlightSeg()
void HSelectionSet::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.
◆ UpdateHighlighting()
void HSelectionSet::UpdateHighlighting | ( | ) |
Updates all reference highlighting. This can be slow with large selection sets.
◆ UpdateHighlightStyle()
|
virtual |
Updates all the attributes of the highlight style segment from the members
◆ UpdateTransparency()
|
protectedvirtual |
Used internally to update the transparency used in inverse transparency highlighting
- Parameters
-
force_flush If true, the transparency will be removed even if there are still selected items.
The documentation for this class was generated from the following file: