Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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 (const occ::handle< SelectMgr_ViewerSelector > &theSelector)
 Constructs an empty selection manager object.
 
const occ::handle< SelectMgr_ViewerSelector > & Selector () const
 Return the Selector.
 
bool Contains (const occ::handle< SelectMgr_SelectableObject > &theObject) const
 Returns true if the manager contains the selectable object theObject.
 
void Load (const occ::handle< SelectMgr_SelectableObject > &theObject, const int 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.
 
void Remove (const occ::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.
 
void Activate (const occ::handle< SelectMgr_SelectableObject > &theObject, const int theMode=0)
 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.
 
void Deactivate (const occ::handle< SelectMgr_SelectableObject > &theObject, const int theMode=-1)
 Deactivates mode theMode of theObject in theSelector. If theMode value is set to default (-1), all active selection modes will be deactivated. Likewise, if theSelector value is set to default (NULL), theMode will be deactivated in all viewer selectors.
 
bool IsActivated (const occ::handle< SelectMgr_SelectableObject > &theObject, const int theMode=-1) 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.
 
void ClearSelectionStructures (const occ::handle< SelectMgr_SelectableObject > &theObj, const int theMode=-1)
 Removes sensitive entities from all viewer selectors after method Clear() was called to the selection they belonged to or it was recomputed somehow.
 
void RestoreSelectionStructures (const occ::handle< SelectMgr_SelectableObject > &theObj, const int theMode=-1)
 Re-adds newly calculated sensitive entities of recomputed selection defined by mode theMode to all viewer selectors contained that selection.
 
void RecomputeSelection (const occ::handle< SelectMgr_SelectableObject > &theObject, const bool theIsForce=false, const int 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.
 
void Update (const occ::handle< SelectMgr_SelectableObject > &theObject, const bool theIsForce=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.
 
void SetUpdateMode (const occ::handle< SelectMgr_SelectableObject > &theObject, const SelectMgr_TypeOfUpdate theType)
 Sets type of update of all selections of theObject to the given theType.
 
void SetUpdateMode (const occ::handle< SelectMgr_SelectableObject > &theObject, const int theMode, const SelectMgr_TypeOfUpdate theType)
 Sets type of update of selection with theMode of theObject to the given theType.
 
void SetSelectionSensitivity (const occ::handle< SelectMgr_SelectableObject > &theObject, const int theMode, const int 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.
 
void UpdateSelection (const occ::handle< SelectMgr_SelectableObject > &theObj)
 Re-adds selectable object in BVHs in all viewer selectors.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool 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.
 
bool IsKind (const char *const 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.
 
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.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Member Functions

void recomputeSelectionMode (const occ::handle< SelectMgr_SelectableObject > &theObject, const occ::handle< SelectMgr_Selection > &theSelection, const int theMode)
 Recomputes given selection mode and updates BVHs in all viewer selectors.
 

Additional Inherited Members

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

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 ( const occ::handle< SelectMgr_ViewerSelector > & theSelector)

Constructs an empty selection manager object.

Member Function Documentation

◆ Activate()

void SelectMgr_SelectionManager::Activate ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const int theMode = 0 )

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.

◆ ClearSelectionStructures()

void SelectMgr_SelectionManager::ClearSelectionStructures ( const occ::handle< SelectMgr_SelectableObject > & theObj,
const int theMode = -1 )

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

◆ Contains()

bool SelectMgr_SelectionManager::Contains ( const occ::handle< SelectMgr_SelectableObject > & theObject) const

Returns true if the manager contains the selectable object theObject.

◆ Deactivate()

void SelectMgr_SelectionManager::Deactivate ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const int theMode = -1 )

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

◆ IsActivated()

bool SelectMgr_SelectionManager::IsActivated ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const int theMode = -1 ) 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()

void SelectMgr_SelectionManager::Load ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const int 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.

◆ RecomputeSelection()

void SelectMgr_SelectionManager::RecomputeSelection ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const bool theIsForce = false,
const int 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 occ::handle< SelectMgr_SelectableObject > & theObject,
const occ::handle< SelectMgr_Selection > & theSelection,
const int theMode )
protected

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

◆ Remove()

void SelectMgr_SelectionManager::Remove ( const occ::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.

◆ RestoreSelectionStructures()

void SelectMgr_SelectionManager::RestoreSelectionStructures ( const occ::handle< SelectMgr_SelectableObject > & theObj,
const int theMode = -1 )

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

◆ Selector()

const occ::handle< SelectMgr_ViewerSelector > & SelectMgr_SelectionManager::Selector ( ) const
inline

Return the Selector.

◆ SetSelectionSensitivity()

void SelectMgr_SelectionManager::SetSelectionSensitivity ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const int theMode,
const int 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 occ::handle< SelectMgr_SelectableObject > & theObject,
const int theMode,
const SelectMgr_TypeOfUpdate theType )

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

◆ SetUpdateMode() [2/2]

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

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

◆ Update()

void SelectMgr_SelectionManager::Update ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const bool theIsForce = 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.

◆ UpdateSelection()

void SelectMgr_SelectionManager::UpdateSelection ( const occ::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: