Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
SelectMgr_EntityOwner Class Reference

A framework to define classes of owners of sensitive primitives. The owner is the link between application and selection data structures. For the application to make its own objects selectable, it must define owner classes inheriting this framework. More...

#include <SelectMgr_EntityOwner.hxx>

Inheritance diagram for SelectMgr_EntityOwner:
Inheritance graph
[legend]

Public Member Functions

 SelectMgr_EntityOwner (const int aPriority=0)
 Initializes the selection priority aPriority.
 
 SelectMgr_EntityOwner (const occ::handle< SelectMgr_SelectableObject > &aSO, const int aPriority=0)
 Constructs a framework with the selectable object anSO being attributed the selection priority aPriority.
 
 SelectMgr_EntityOwner (const occ::handle< SelectMgr_EntityOwner > &theOwner, const int aPriority=0)
 Constructs a framework from existing one anSO being attributed the selection priority aPriority.
 
int Priority () const
 Return selection priority (within range [0-9]) for results with the same depth; 0 by default. Example - selection of shapes: the owners are selectable objects (presentations) a user can give vertex priority [3], edges [2] faces [1] shape [0], so that if during selection one vertex one edge and one face are simultaneously detected, the vertex will only be hilighted.
 
void SetPriority (int thePriority)
 Sets the selectable priority of the owner within range [0-9].
 
bool HasSelectable () const
 Returns true if there is a selectable object to serve as an owner.
 
virtual occ::handle< SelectMgr_SelectableObjectSelectable () const
 Returns a selectable object detected in the working context.
 
virtual void SetSelectable (const occ::handle< SelectMgr_SelectableObject > &theSelObj)
 Sets the selectable object.
 
virtual bool HandleMouseClick (const NCollection_Vec2< int > &thePoint, Aspect_VKeyMouse theButton, Aspect_VKeyFlags theModifiers, bool theIsDoubleClick)
 Handle mouse button click event. Does nothing by default and returns FALSE.
 
virtual bool IsHilighted (const occ::handle< PrsMgr_PresentationManager > &thePrsMgr, const int theMode=0) const
 Returns true if the presentation manager highlights selections corresponding to the selection mode.
 
virtual void HilightWithColor (const occ::handle< PrsMgr_PresentationManager > &thePrsMgr, const occ::handle< Prs3d_Drawer > &theStyle, const int theMode=0)
 Highlights selectable object's presentation with display mode in presentation manager with given highlight style. Also a check for auto-highlight is performed - if selectable object manages highlighting on its own, execution will be passed to SelectMgr_SelectableObject::HilightOwnerWithColor method.
 
virtual void Unhilight (const occ::handle< PrsMgr_PresentationManager > &thePrsMgr, const int theMode=0)
 Removes highlighting from the owner of a detected selectable object in the presentation manager. This object could be the owner of a sensitive primitive.
 
virtual void Clear (const occ::handle< PrsMgr_PresentationManager > &thePrsMgr, const int theMode=0)
 Clears the owners matching the value of the selection mode aMode from the presentation manager object aPM.
 
virtual bool HasLocation () const
 Returns TRUE if selectable has transformation.
 
virtual TopLoc_Location Location () const
 Returns transformation of selectable.
 
virtual void SetLocation (const TopLoc_Location &theLocation)
 Change owner location (callback for handling change of location of selectable object).
 
bool IsSelected () const
 
void SetSelected (const bool theIsSelected)
 Set the state of the owner.
 
bool Select (const AIS_SelectionScheme theSelScheme, const bool theIsDetected) const
 If the object needs to be selected, it returns true.
 
int State () const
 Returns selection state.
 
void State (const int theStatus)
 Set the state of the owner. The method is deprecated. Use SetSelected() instead.
 
virtual bool IsAutoHilight () const
 if owner is not auto hilighted, for group contains many such owners will be called one method HilightSelected of SelectableObject
 
virtual bool IsForcedHilight () const
 if this method returns TRUE the owner will always call method Hilight for SelectableObject when the owner is detected. By default it always return FALSE.
 
virtual void SetZLayer (const Graphic3d_ZLayerId theLayerId)
 Set Z layer ID and update all presentations.
 
virtual void UpdateHighlightTrsf (const occ::handle< V3d_Viewer > &theViewer, const occ::handle< PrsMgr_PresentationManager > &theManager, const int theDispMode)
 Implements immediate application of location transformation of parent object to dynamic highlight structure.
 
bool IsSameSelectable (const occ::handle< SelectMgr_SelectableObject > &theOther) const
 Returns true if pointer to selectable object of this owner is equal to the given one.
 
bool ComesFromDecomposition () const
 Returns TRUE if this owner points to a part of object and FALSE for entire object.
 
void SetComesFromDecomposition (const bool theIsFromDecomposition)
 Sets flag indicating this owner points to a part of object (TRUE) or to entire object (FALSE).
 
virtual void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
void Set (const occ::handle< SelectMgr_SelectableObject > &theSelObj)
 Sets the selectable object.
 
void Set (const int thePriority)
 sets the selectable priority of the owner
 
- 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 Attributes

SelectMgr_SelectableObjectmySelectable
 raw pointer to selectable object
 
int mypriority
 selection priority (for result with the same depth)
 
bool myIsSelected
 flag indicating selected state
 
bool myFromDecomposition
 flag indicating this owner points to a part of object (TRUE) or to entire object (FALSE)
 

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 define classes of owners of sensitive primitives. The owner is the link between application and selection data structures. For the application to make its own objects selectable, it must define owner classes inheriting this framework.

Constructor & Destructor Documentation

◆ SelectMgr_EntityOwner() [1/3]

SelectMgr_EntityOwner::SelectMgr_EntityOwner ( const int aPriority = 0)

Initializes the selection priority aPriority.

◆ SelectMgr_EntityOwner() [2/3]

SelectMgr_EntityOwner::SelectMgr_EntityOwner ( const occ::handle< SelectMgr_SelectableObject > & aSO,
const int aPriority = 0 )

Constructs a framework with the selectable object anSO being attributed the selection priority aPriority.

◆ SelectMgr_EntityOwner() [3/3]

SelectMgr_EntityOwner::SelectMgr_EntityOwner ( const occ::handle< SelectMgr_EntityOwner > & theOwner,
const int aPriority = 0 )

Constructs a framework from existing one anSO being attributed the selection priority aPriority.

Member Function Documentation

◆ Clear()

virtual void SelectMgr_EntityOwner::Clear ( const occ::handle< PrsMgr_PresentationManager > & thePrsMgr,
const int theMode = 0 )
inlinevirtual

Clears the owners matching the value of the selection mode aMode from the presentation manager object aPM.

TODO

Reimplemented in StdSelect_BRepOwner, MeshVS_MeshEntityOwner, and AIS_PointCloudOwner.

◆ ComesFromDecomposition()

bool SelectMgr_EntityOwner::ComesFromDecomposition ( ) const
inline

Returns TRUE if this owner points to a part of object and FALSE for entire object.

◆ DumpJson()

virtual void SelectMgr_EntityOwner::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const
virtual

Dumps the content of me into the stream.

Reimplemented in StdSelect_BRepOwner.

◆ HandleMouseClick()

virtual bool SelectMgr_EntityOwner::HandleMouseClick ( const NCollection_Vec2< int > & thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick )
inlinevirtual

Handle mouse button click event. Does nothing by default and returns FALSE.

Parameters
thePointmouse cursor position
theButtonclicked button
theModifierskey modifiers
theIsDoubleClickflag indicating double mouse click
Returns
TRUE if object handled click For all selection schemes, allowing to select an object, it's available

Reimplemented in AIS_LightSourceOwner, and AIS_ViewCubeOwner.

◆ HasLocation()

virtual bool SelectMgr_EntityOwner::HasLocation ( ) const
inlinevirtual

Returns TRUE if selectable has transformation.

◆ HasSelectable()

bool SelectMgr_EntityOwner::HasSelectable ( ) const
inline

Returns true if there is a selectable object to serve as an owner.

◆ HilightWithColor()

virtual void SelectMgr_EntityOwner::HilightWithColor ( const occ::handle< PrsMgr_PresentationManager > & thePrsMgr,
const occ::handle< Prs3d_Drawer > & theStyle,
const int theMode = 0 )
virtual

Highlights selectable object's presentation with display mode in presentation manager with given highlight style. Also a check for auto-highlight is performed - if selectable object manages highlighting on its own, execution will be passed to SelectMgr_SelectableObject::HilightOwnerWithColor method.

Reimplemented in MeshVS_MeshOwner, MeshVS_MeshEntityOwner, AIS_ManipulatorOwner, AIS_TrihedronOwner, PrsDim_DimensionOwner, StdSelect_BRepOwner, AIS_LightSourceOwner, and AIS_PointCloudOwner.

◆ IsAutoHilight()

virtual bool SelectMgr_EntityOwner::IsAutoHilight ( ) const
inlinevirtual

if owner is not auto hilighted, for group contains many such owners will be called one method HilightSelected of SelectableObject

◆ IsForcedHilight()

virtual bool SelectMgr_EntityOwner::IsForcedHilight ( ) const
inlinevirtual

if this method returns TRUE the owner will always call method Hilight for SelectableObject when the owner is detected. By default it always return FALSE.

Reimplemented in MeshVS_MeshOwner, AIS_LightSourceOwner, AIS_PointCloudOwner, and AIS_ViewCubeOwner.

◆ IsHilighted()

virtual bool SelectMgr_EntityOwner::IsHilighted ( const occ::handle< PrsMgr_PresentationManager > & thePrsMgr,
const int theMode = 0 ) const
inlinevirtual

Returns true if the presentation manager highlights selections corresponding to the selection mode.

Reimplemented in StdSelect_BRepOwner, MeshVS_MeshEntityOwner, AIS_ManipulatorOwner, AIS_TrihedronOwner, and PrsDim_DimensionOwner.

◆ IsSameSelectable()

bool SelectMgr_EntityOwner::IsSameSelectable ( const occ::handle< SelectMgr_SelectableObject > & theOther) const
inline

Returns true if pointer to selectable object of this owner is equal to the given one.

◆ IsSelected()

bool SelectMgr_EntityOwner::IsSelected ( ) const
inline
Returns
true if the owner is selected.

◆ Location()

virtual TopLoc_Location SelectMgr_EntityOwner::Location ( ) const
inlinevirtual

Returns transformation of selectable.

◆ Priority()

int SelectMgr_EntityOwner::Priority ( ) const
inline

Return selection priority (within range [0-9]) for results with the same depth; 0 by default. Example - selection of shapes: the owners are selectable objects (presentations) a user can give vertex priority [3], edges [2] faces [1] shape [0], so that if during selection one vertex one edge and one face are simultaneously detected, the vertex will only be hilighted.

◆ Select()

bool SelectMgr_EntityOwner::Select ( const AIS_SelectionScheme theSelScheme,
const bool theIsDetected ) const

If the object needs to be selected, it returns true.

Parameters
[in]theSelSchemeselection scheme
[in]theIsDetectedflag of object detection

◆ Selectable()

virtual occ::handle< SelectMgr_SelectableObject > SelectMgr_EntityOwner::Selectable ( ) const
inlinevirtual

Returns a selectable object detected in the working context.

◆ Set() [1/2]

void SelectMgr_EntityOwner::Set ( const int thePriority)
inline

sets the selectable priority of the owner

Deprecated
("Deprecated method - SetPriority() should be used instead")

◆ Set() [2/2]

void SelectMgr_EntityOwner::Set ( const occ::handle< SelectMgr_SelectableObject > & theSelObj)
inline

Sets the selectable object.

Deprecated
("Deprecated method - SetSelectable() should be used instead")

◆ SetComesFromDecomposition()

void SelectMgr_EntityOwner::SetComesFromDecomposition ( const bool theIsFromDecomposition)
inline

Sets flag indicating this owner points to a part of object (TRUE) or to entire object (FALSE).

◆ SetLocation()

virtual void SelectMgr_EntityOwner::SetLocation ( const TopLoc_Location & theLocation)
inlinevirtual

Change owner location (callback for handling change of location of selectable object).

Reimplemented in StdSelect_BRepOwner.

◆ SetPriority()

void SelectMgr_EntityOwner::SetPriority ( int thePriority)
inline

Sets the selectable priority of the owner within range [0-9].

◆ SetSelectable()

virtual void SelectMgr_EntityOwner::SetSelectable ( const occ::handle< SelectMgr_SelectableObject > & theSelObj)
inlinevirtual

Sets the selectable object.

◆ SetSelected()

void SelectMgr_EntityOwner::SetSelected ( const bool theIsSelected)
inline

Set the state of the owner.

Parameters
[in]theIsSelectedshows if owner is selected.

◆ SetZLayer()

virtual void SelectMgr_EntityOwner::SetZLayer ( const Graphic3d_ZLayerId theLayerId)
inlinevirtual

Set Z layer ID and update all presentations.

◆ State() [1/2]

int SelectMgr_EntityOwner::State ( ) const
inline

Returns selection state.

Deprecated
("Deprecated method - IsSelected() should be used instead")

◆ State() [2/2]

void SelectMgr_EntityOwner::State ( const int theStatus)
inline

Set the state of the owner. The method is deprecated. Use SetSelected() instead.

◆ Unhilight()

virtual void SelectMgr_EntityOwner::Unhilight ( const occ::handle< PrsMgr_PresentationManager > & thePrsMgr,
const int theMode = 0 )
inlinevirtual

Removes highlighting from the owner of a detected selectable object in the presentation manager. This object could be the owner of a sensitive primitive.

Parameters
thePrsMgrpresentation manager
theModeobsolete argument for compatibility, should be ignored by implementations

Reimplemented in StdSelect_BRepOwner, MeshVS_MeshEntityOwner, MeshVS_MeshOwner, AIS_ManipulatorOwner, AIS_TrihedronOwner, PrsDim_DimensionOwner, and AIS_PointCloudOwner.

◆ UpdateHighlightTrsf()

virtual void SelectMgr_EntityOwner::UpdateHighlightTrsf ( const occ::handle< V3d_Viewer > & theViewer,
const occ::handle< PrsMgr_PresentationManager > & theManager,
const int theDispMode )
inlinevirtual

Implements immediate application of location transformation of parent object to dynamic highlight structure.

Reimplemented in StdSelect_BRepOwner.

Field Documentation

◆ myFromDecomposition

bool SelectMgr_EntityOwner::myFromDecomposition
protected

flag indicating this owner points to a part of object (TRUE) or to entire object (FALSE)

◆ myIsSelected

bool SelectMgr_EntityOwner::myIsSelected
protected

flag indicating selected state

◆ mypriority

int SelectMgr_EntityOwner::mypriority
protected

selection priority (for result with the same depth)

◆ mySelectable

SelectMgr_SelectableObject* SelectMgr_EntityOwner::mySelectable
protected

raw pointer to selectable object


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