Open CASCADE Technology  7.2.0
Public Member Functions | Protected Member Functions

SelectMgr_SelectionManager Class Reference

A framework to manage selection from the point of view of viewer selectors. These can be added and removed, and selection modes can be activated and deactivated. In addition, objects may be known to all selectors or only to some. More...

#include <SelectMgr_SelectionManager.hxx>

Inheritance diagram for SelectMgr_SelectionManager:
Inheritance graph
[legend]

Public Member Functions

 SelectMgr_SelectionManager ()
 Constructs an empty selection manager object. More...
 
void Add (const Handle< SelectMgr_ViewerSelector > &theSelector)
 Adds the viewer selector theSelector to the list of known items. More...
 
void Remove (const Handle< SelectMgr_ViewerSelector > &theSelector)
 Removes viewer selector theSelector from the list of known items. More...
 
Standard_Boolean Contains (const Handle< SelectMgr_ViewerSelector > &theSelector) const
 Returns true if the manager contains the viewer selector theSelector in a list of known items. More...
 
Standard_Boolean Contains (const Handle< SelectMgr_SelectableObject > &theObject) const
 Returns true if the manager contains the selectable object theObject. More...
 
void Load (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Integer theMode=-1)
 Loads and computes selection mode theMode (if it is not equal to -1) in global context and adds selectable object to BVH tree. If the object theObject has an already calculated selection with mode theMode and it was removed, the selection will be recalculated. More...
 
void Load (const Handle< SelectMgr_SelectableObject > &theObject, const Handle< SelectMgr_ViewerSelector > &theSelector, const Standard_Integer theMode=-1)
 Loads and computes selection mode theMode (if it is not equal to -1) and adds selectable object to BVH tree. Does not perform check of existance of theObject in global context before addition, but adds theSelector to local context. More...
 
void Remove (const Handle< SelectMgr_SelectableObject > &theObject)
 Removes selectable object theObject from all viewer selectors it was added to previously, removes it from all contexts and clears all computed selections of theObject. More...
 
void Remove (const Handle< SelectMgr_SelectableObject > &theObject, const Handle< SelectMgr_ViewerSelector > &theSelector)
 Removes theObject from theSelector, does not clear selections and unbind theObject from context maps. More...
 
void Activate (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Integer theMode=0, const Handle< SelectMgr_ViewerSelector > &theSelector=NULL)
 Activates the selection mode theMode in the selector theSelector for the selectable object anObject. By default, theMode is equal to 0. If theSelector is set to default (NULL), the selection with the mode theMode will be activated in all the viewers available. More...
 
void Deactivate (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Integer theMode=-1, const Handle< SelectMgr_ViewerSelector > &theSelector=NULL)
 Deactivates mode theMode of theObject in theSelector. If theMode value is set to default (-1), all avtive selection modes will be deactivated. Likewise, if theSelector value is set to default (NULL), theMode will be deactivated in all viewer selectors. More...
 
Standard_Boolean IsActivated (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Integer theMode=-1, const Handle< SelectMgr_ViewerSelector > &theSelector=NULL) const
 Returns true if the selection with theMode is active for the selectable object theObject and selector theSelector. If all parameters are set to default values, it returns it there is any active selection in any known viewer selector for object theObject. More...
 
void ClearSelectionStructures (const Handle< SelectMgr_SelectableObject > &theObj, const Standard_Integer theMode=-1, const Handle< SelectMgr_ViewerSelector > &theSelector=NULL)
 Removes sensitive entities from all viewer selectors after method Clear() was called to the selection they belonged to or it was recomputed somehow. More...
 
void RestoreSelectionStructures (const Handle< SelectMgr_SelectableObject > &theObj, const Standard_Integer theMode=-1, const Handle< SelectMgr_ViewerSelector > &theSelector=NULL)
 Re-adds newely calculated sensitive entities of recomputed selection defined by mode theMode to all viewer selectors contained that selection. More...
 
void RecomputeSelection (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Boolean theIsForce=Standard_False, const Standard_Integer theMode=-1)
 Recomputes activated selections of theObject for all known viewer selectors according to theMode specified. If theMode is set to default (-1), then all activated selections will be recomputed. If theIsForce is set to true, then selection mode theMode for object theObject will be recomputed regardless of its activation status. More...
 
void Update (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Boolean theIsForce=Standard_True)
 Updates all selections of theObject in all viewer selectors according to its current update status. If theIsForce is set to true, the call is equal to recomputation. More...
 
void Update (const Handle< SelectMgr_SelectableObject > &theObject, const Handle< SelectMgr_ViewerSelector > &theSelector, const Standard_Boolean theIsForce=Standard_True)
 Updates all selections of theObject in specified viewer selector according to its current update status. If theIsForce is set to true, the call is equal to recomputation. More...
 
void SetUpdateMode (const Handle< SelectMgr_SelectableObject > &theObject, const SelectMgr_TypeOfUpdate theType)
 Sets type of update of all selections of theObject to the given theType. More...
 
void SetUpdateMode (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Integer theMode, const SelectMgr_TypeOfUpdate theType)
 Sets type of update of selection with theMode of theObject to the given theType. More...
 
void SetSelectionSensitivity (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Integer theMode, const Standard_Integer theNewSens)
 Allows to manage sensitivity of a particular selection of interactive object theObject and changes previous sensitivity value of all sensitive entities in selection with theMode to the given theNewSensitivity. More...
 
void UpdateSelection (const Handle< SelectMgr_SelectableObject > &theObj)
 Re-adds selectable object in BVHs in all viewer selectors. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

void recomputeSelectionMode (const Handle< SelectMgr_SelectableObject > &theObject, const Handle< SelectMgr_Selection > &theSelection, const Standard_Integer theMode)
 Recomputes given selection mode and updates BVHs in all viewer selectors. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

A framework to manage selection from the point of view of viewer selectors. These can be added and removed, and selection modes can be activated and deactivated. In addition, objects may be known to all selectors or only to some.

Constructor & Destructor Documentation

◆ SelectMgr_SelectionManager()

SelectMgr_SelectionManager::SelectMgr_SelectionManager ( )

Constructs an empty selection manager object.

Member Function Documentation

◆ Activate()

void SelectMgr_SelectionManager::Activate ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Integer  theMode = 0,
const Handle< SelectMgr_ViewerSelector > &  theSelector = NULL 
)

Activates the selection mode theMode in the selector theSelector for the selectable object anObject. By default, theMode is equal to 0. If theSelector is set to default (NULL), the selection with the mode theMode will be activated in all the viewers available.

◆ Add()

void SelectMgr_SelectionManager::Add ( const Handle< SelectMgr_ViewerSelector > &  theSelector)

Adds the viewer selector theSelector to the list of known items.

◆ ClearSelectionStructures()

void SelectMgr_SelectionManager::ClearSelectionStructures ( const Handle< SelectMgr_SelectableObject > &  theObj,
const Standard_Integer  theMode = -1,
const Handle< SelectMgr_ViewerSelector > &  theSelector = NULL 
)

Removes sensitive entities from all viewer selectors after method Clear() was called to the selection they belonged to or it was recomputed somehow.

◆ Contains() [1/2]

Standard_Boolean SelectMgr_SelectionManager::Contains ( const Handle< SelectMgr_ViewerSelector > &  theSelector) const

Returns true if the manager contains the viewer selector theSelector in a list of known items.

◆ Contains() [2/2]

Standard_Boolean SelectMgr_SelectionManager::Contains ( const Handle< SelectMgr_SelectableObject > &  theObject) const

Returns true if the manager contains the selectable object theObject.

◆ Deactivate()

void SelectMgr_SelectionManager::Deactivate ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Integer  theMode = -1,
const Handle< SelectMgr_ViewerSelector > &  theSelector = NULL 
)

Deactivates mode theMode of theObject in theSelector. If theMode value is set to default (-1), all avtive selection modes will be deactivated. Likewise, if theSelector value is set to default (NULL), theMode will be deactivated in all viewer selectors.

◆ IsActivated()

Standard_Boolean SelectMgr_SelectionManager::IsActivated ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Integer  theMode = -1,
const Handle< SelectMgr_ViewerSelector > &  theSelector = NULL 
) const

Returns true if the selection with theMode is active for the selectable object theObject and selector theSelector. If all parameters are set to default values, it returns it there is any active selection in any known viewer selector for object theObject.

◆ Load() [1/2]

void SelectMgr_SelectionManager::Load ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Integer  theMode = -1 
)

Loads and computes selection mode theMode (if it is not equal to -1) in global context and adds selectable object to BVH tree. If the object theObject has an already calculated selection with mode theMode and it was removed, the selection will be recalculated.

◆ Load() [2/2]

void SelectMgr_SelectionManager::Load ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Handle< SelectMgr_ViewerSelector > &  theSelector,
const Standard_Integer  theMode = -1 
)

Loads and computes selection mode theMode (if it is not equal to -1) and adds selectable object to BVH tree. Does not perform check of existance of theObject in global context before addition, but adds theSelector to local context.

◆ RecomputeSelection()

void SelectMgr_SelectionManager::RecomputeSelection ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Boolean  theIsForce = Standard_False,
const Standard_Integer  theMode = -1 
)

Recomputes activated selections of theObject for all known viewer selectors according to theMode specified. If theMode is set to default (-1), then all activated selections will be recomputed. If theIsForce is set to true, then selection mode theMode for object theObject will be recomputed regardless of its activation status.

◆ recomputeSelectionMode()

void SelectMgr_SelectionManager::recomputeSelectionMode ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Handle< SelectMgr_Selection > &  theSelection,
const Standard_Integer  theMode 
)
protected

Recomputes given selection mode and updates BVHs in all viewer selectors.

◆ Remove() [1/3]

void SelectMgr_SelectionManager::Remove ( const Handle< SelectMgr_ViewerSelector > &  theSelector)

Removes viewer selector theSelector from the list of known items.

◆ Remove() [2/3]

void SelectMgr_SelectionManager::Remove ( const Handle< SelectMgr_SelectableObject > &  theObject)

Removes selectable object theObject from all viewer selectors it was added to previously, removes it from all contexts and clears all computed selections of theObject.

◆ Remove() [3/3]

void SelectMgr_SelectionManager::Remove ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Handle< SelectMgr_ViewerSelector > &  theSelector 
)

Removes theObject from theSelector, does not clear selections and unbind theObject from context maps.

◆ RestoreSelectionStructures()

void SelectMgr_SelectionManager::RestoreSelectionStructures ( const Handle< SelectMgr_SelectableObject > &  theObj,
const Standard_Integer  theMode = -1,
const Handle< SelectMgr_ViewerSelector > &  theSelector = NULL 
)

Re-adds newely calculated sensitive entities of recomputed selection defined by mode theMode to all viewer selectors contained that selection.

◆ SetSelectionSensitivity()

void SelectMgr_SelectionManager::SetSelectionSensitivity ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Integer  theMode,
const Standard_Integer  theNewSens 
)

Allows to manage sensitivity of a particular selection of interactive object theObject and changes previous sensitivity value of all sensitive entities in selection with theMode to the given theNewSensitivity.

◆ SetUpdateMode() [1/2]

void SelectMgr_SelectionManager::SetUpdateMode ( const Handle< SelectMgr_SelectableObject > &  theObject,
const SelectMgr_TypeOfUpdate  theType 
)

Sets type of update of all selections of theObject to the given theType.

◆ SetUpdateMode() [2/2]

void SelectMgr_SelectionManager::SetUpdateMode ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Integer  theMode,
const SelectMgr_TypeOfUpdate  theType 
)

Sets type of update of selection with theMode of theObject to the given theType.

◆ Update() [1/2]

void SelectMgr_SelectionManager::Update ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Standard_Boolean  theIsForce = Standard_True 
)

Updates all selections of theObject in all viewer selectors according to its current update status. If theIsForce is set to true, the call is equal to recomputation.

◆ Update() [2/2]

void SelectMgr_SelectionManager::Update ( const Handle< SelectMgr_SelectableObject > &  theObject,
const Handle< SelectMgr_ViewerSelector > &  theSelector,
const Standard_Boolean  theIsForce = Standard_True 
)

Updates all selections of theObject in specified viewer selector according to its current update status. If theIsForce is set to true, the call is equal to recomputation.

◆ UpdateSelection()

void SelectMgr_SelectionManager::UpdateSelection ( const Handle< SelectMgr_SelectableObject > &  theObj)

Re-adds selectable object in BVHs in all viewer selectors.


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