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

A framework to define finding, sorting the sensitive primitives in a view. Services are also provided to define the return of the owners of those primitives selected. The primitives are sorted by criteria such as priority of the primitive or its depth in the view relative to that of other primitives. Note that in 3D, the inheriting framework StdSelect_ViewerSelector3d is only to be used if you do not want to use the services provided by AIS. Two tools are available to find and select objects found at a given position in the view. If you want to select the owners of all the objects detected at point x,y,z you use the Init - More - Next - Picked loop. If, on the other hand, you want to select only one object detected at that point, you use the Init - More - OnePicked loop. In this iteration, More is used to see if an object was picked and OnePicked, to get the object closest to the pick position. Viewer selectors are driven by SelectMgr_SelectionManager, and manipulate the SelectMgr_Selection objects given to them by the selection manager. More...

#include <SelectMgr_ViewerSelector.hxx>

Inheritance diagram for SelectMgr_ViewerSelector:
Inheritance graph
[legend]

Public Member Functions

 SelectMgr_ViewerSelector ()
 Constructs an empty selector object.
 
int CustomPixelTolerance () const
 Returns custom pixel tolerance value.
 
void SetPixelTolerance (const int theTolerance)
 Sets the pixel tolerance <theTolerance>.
 
double Sensitivity () const
 Returns the largest sensitivity of picking.
 
int PixelTolerance () const
 Returns the largest pixel tolerance.
 
virtual void SortResult () const
 Sorts the detected entities by priority and distance.
 
occ::handle< SelectMgr_EntityOwnerOnePicked () const
 Returns the picked element with the highest priority, and which is the closest to the last successful mouse position.
 
bool ToPickClosest () const
 Return the flag determining precedence of picked depth (distance from eye to entity) over entity priority in sorted results; TRUE by default. When flag is TRUE, priority will be considered only if entities have the same depth within the tolerance. When flag is FALSE, entities with higher priority will be in front regardless of their depth (like x-ray).
 
void SetPickClosest (bool theToPreferClosest)
 Set flag determining precedence of picked depth over entity priority in sorted results.
 
SelectMgr_TypeOfDepthTolerance DepthToleranceType () const
 Return the type of tolerance for considering two entities having a similar depth (distance from eye to entity); SelectMgr_TypeOfDepthTolerance_SensitivityFactor by default.
 
double DepthTolerance () const
 Return the tolerance for considering two entities having a similar depth (distance from eye to entity).
 
void SetDepthTolerance (SelectMgr_TypeOfDepthTolerance theType, double theTolerance)
 Set the tolerance for considering two entities having a similar depth (distance from eye to entity).
 
int NbPicked () const
 Returns the number of detected owners.
 
void ClearPicked ()
 Clears picking results.
 
void Clear ()
 Empties all the tables, removes all selections...
 
occ::handle< SelectMgr_EntityOwnerPicked (const int theRank) const
 Returns the entity Owner for the object picked at specified position.
 
const SelectMgr_SortCriterionPickedData (const int theRank) const
 Returns the Entity for the object picked at specified position.
 
const occ::handle< Select3D_SensitiveEntity > & PickedEntity (const int theRank) const
 Returns the Entity for the object picked at specified position.
 
gp_Pnt PickedPoint (const int theRank) const
 Returns the 3D point (intersection of picking axis with the object nearest to eye) for the object picked at specified position.
 
bool RemovePicked (const occ::handle< SelectMgr_SelectableObject > &theObject)
 Remove picked entities associated with specified object.
 
bool Contains (const occ::handle< SelectMgr_SelectableObject > &theObject) const
 
const occ::handle< Select3D_BVHBuilder3dEntitySetBuilder ()
 Returns the default builder used to construct BVH of entity set.
 
void SetEntitySetBuilder (const occ::handle< Select3D_BVHBuilder3d > &theBuilder)
 Sets the default builder used to construct BVH of entity set. The new builder will be also assigned for already defined objects, but computed BVH trees will not be invalidated.
 
bool Modes (const occ::handle< SelectMgr_SelectableObject > &theSelectableObject, NCollection_List< int > &theModeList, const SelectMgr_StateOfSelection theWantedState=SelectMgr_SOS_Any) const
 Returns the list of selection modes ModeList found in this selector for the selectable object aSelectableObject. Returns true if aSelectableObject is referenced inside this selector; returns false if the object is not present in this selector.
 
bool IsActive (const occ::handle< SelectMgr_SelectableObject > &theSelectableObject, const int theMode) const
 Returns true if the selectable object aSelectableObject having the selection mode aMode is active in this selector.
 
bool IsInside (const occ::handle< SelectMgr_SelectableObject > &theSelectableObject, const int theMode) const
 Returns true if the selectable object aSelectableObject having the selection mode aMode is in this selector.
 
SelectMgr_StateOfSelection Status (const occ::handle< SelectMgr_Selection > &theSelection) const
 Returns the selection status Status of the selection aSelection.
 
TCollection_AsciiString Status (const occ::handle< SelectMgr_SelectableObject > &theSelectableObject) const
 
void ActiveOwners (NCollection_List< occ::handle< SelectMgr_EntityOwner > > &theOwners) const
 Returns the list of active entity owners.
 
void AddSelectableObject (const occ::handle< SelectMgr_SelectableObject > &theObject)
 Adds new object to the map of selectable objects.
 
void AddSelectionToObject (const occ::handle< SelectMgr_SelectableObject > &theObject, const occ::handle< SelectMgr_Selection > &theSelection)
 Adds new selection to the object and builds its BVH tree.
 
void MoveSelectableObject (const occ::handle< SelectMgr_SelectableObject > &theObject)
 Moves existing object from set of not transform persistence objects to set of transform persistence objects (or vice versa).
 
void RemoveSelectableObject (const occ::handle< SelectMgr_SelectableObject > &theObject)
 Removes selectable object from map of selectable ones.
 
void RemoveSelectionOfObject (const occ::handle< SelectMgr_SelectableObject > &theObject, const occ::handle< SelectMgr_Selection > &theSelection)
 Removes selection of the object and marks its BVH tree for rebuild.
 
void RebuildObjectsTree (const bool theIsForce=false)
 Marks BVH of selectable objects for rebuild. Parameter theIsForce set as true guarantees that 1st level BVH for the viewer selector will be rebuilt during this call.
 
void RebuildSensitivesTree (const occ::handle< SelectMgr_SelectableObject > &theObject, const bool theIsForce=false)
 Marks BVH of sensitive entities of particular selectable object for rebuild. Parameter theIsForce set as true guarantees that 2nd level BVH for the object given will be rebuilt during this call.
 
SelectMgr_SelectingVolumeManagerGetManager ()
 Returns instance of selecting volume manager of the viewer selector.
 
const SelectMgr_SelectableObjectSetSelectableObjects () const
 Return map of selectable objects.
 
void ResetSelectionActivationStatus ()
 Marks all added sensitive entities of all objects as non-selectable.
 
void AllowOverlapDetection (const bool theIsToAllow)
 Is used for rectangular selection only If theIsToAllow is false, only fully included sensitives will be detected, otherwise the algorithm will mark both included and overlapped entities as matched.
 
void Pick (const int theXPix, const int theYPix, const occ::handle< V3d_View > &theView)
 Picks the sensitive entity at the pixel coordinates of the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
 
void Pick (const int theXPMin, const int theYPMin, const int theXPMax, const int theYPMax, const occ::handle< V3d_View > &theView)
 Picks the sensitive entity according to the minimum and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax> and <theYPMax> defining a 2D area for selection in the 3D view aView.
 
void Pick (const NCollection_Array1< gp_Pnt2d > &thePolyline, const occ::handle< V3d_View > &theView)
 pick action - input pixel values for polyline selection for selection.
 
void Pick (const gp_Ax1 &theAxis, const occ::handle< V3d_View > &theView)
 Picks the sensitive entity according to the input axis. This is geometric intersection 3D objects by axis (camera parameters are ignored and objects with transform persistence are skipped).
 
bool ToPixMap (Image_PixMap &theImage, const occ::handle< V3d_View > &theView, const StdSelect_TypeOfSelectionImage theType, const int thePickedIndex=1)
 Dump of detection results into image. This method performs axis picking for each pixel in the image and generates a color depending on picking results and selection image type.
 
void DisplaySensitive (const occ::handle< V3d_View > &theView)
 Displays sensitives in view <theView>.
 
void ClearSensitive (const occ::handle< V3d_View > &theView)
 
void DisplaySensitive (const occ::handle< SelectMgr_Selection > &theSel, const gp_Trsf &theTrsf, const occ::handle< V3d_View > &theView, const bool theToClearOthers=true)
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
 Dumps the content of me into the stream.
 
void SetToPrebuildBVH (bool theToPrebuild, int theThreadsNum=-1)
 Enables/disables building BVH for sensitives in separate threads.
 
void QueueBVHBuild (const occ::handle< Select3D_SensitiveEntity > &theEntity)
 Queues a sensitive entity to build its BVH.
 
void WaitForBVHBuild ()
 Waits BVH threads finished building.
 
bool ToPrebuildBVH () const
 Returns TRUE if building BVH for sensitives in separate threads is enabled.
 
- 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 TraverseSensitives (const int theViewId=-1)
 Traverses BVH containing all added selectable objects and finds candidates for further search of overlap.
 
void traverseObject (const occ::handle< SelectMgr_SelectableObject > &theObject, const SelectMgr_SelectingVolumeManager &theMgr, const occ::handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< double > &theProjectionMat, const NCollection_Mat4< double > &theWorldViewMat, const NCollection_Vec2< int > &theWinSize)
 Internal function that checks if there is possible overlap between some entity of selectable object theObject and current selecting volume.
 
void checkOverlap (const occ::handle< Select3D_SensitiveEntity > &theEntity, const gp_GTrsf &theInversedTrsf, SelectMgr_SelectingVolumeManager &theMgr)
 Internal function that checks if a particular sensitive entity theEntity overlaps current selecting volume precisely.
 
void updateZLayers (const occ::handle< V3d_View > &theView)
 Update z-layers order map.
 

Protected Attributes

double myDepthTolerance
 
SelectMgr_TypeOfDepthTolerance myDepthTolType
 
bool myToPreferClosest
 
NCollection_IndexedDataMap< occ::handle< SelectMgr_EntityOwner >, SelectMgr_SortCriterionmystored
 
SelectMgr_SelectingVolumeManager mySelectingVolumeMgr
 
SelectMgr_SelectableObjectSet mySelectableObjects
 
SelectMgr_ToleranceMap myTolerances
 
NCollection_DataMap< Graphic3d_ZLayerId, intmyZLayerOrderMap
 
occ::handle< Select3D_BVHBuilder3dmyEntitySetBuilder
 
gp_Pnt myCameraEye
 
gp_Dir myCameraDir
 
double myCameraScale
 
bool myToPrebuildBVH
 
occ::handle< SelectMgr_BVHThreadPoolmyBVHThreadPool
 
NCollection_Array1< intmyIndexes
 
bool myIsSorted
 
bool myIsLeftChildQueuedFirst
 
NCollection_DataMap< occ::handle< SelectMgr_SelectableObject >, occ::handle< SelectMgr_SensitiveEntitySet > > myMapOfObjectSensitives
 
NCollection_Sequence< occ::handle< Graphic3d_Structure > > myStructs
 list of debug presentations
 

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 finding, sorting the sensitive primitives in a view. Services are also provided to define the return of the owners of those primitives selected. The primitives are sorted by criteria such as priority of the primitive or its depth in the view relative to that of other primitives. Note that in 3D, the inheriting framework StdSelect_ViewerSelector3d is only to be used if you do not want to use the services provided by AIS. Two tools are available to find and select objects found at a given position in the view. If you want to select the owners of all the objects detected at point x,y,z you use the Init - More - Next - Picked loop. If, on the other hand, you want to select only one object detected at that point, you use the Init - More - OnePicked loop. In this iteration, More is used to see if an object was picked and OnePicked, to get the object closest to the pick position. Viewer selectors are driven by SelectMgr_SelectionManager, and manipulate the SelectMgr_Selection objects given to them by the selection manager.

Tolerances are applied to the entities in the following way:

  1. tolerance value stored in mytolerance will be used to calculate initial selecting frustum, which will be applied for intersection testing during BVH traverse;
  2. if tolerance of sensitive entity is less than mytolerance, the frustum for intersection detection will be resized according to its sensitivity.

Constructor & Destructor Documentation

◆ SelectMgr_ViewerSelector()

SelectMgr_ViewerSelector::SelectMgr_ViewerSelector ( )

Constructs an empty selector object.

Member Function Documentation

◆ ActiveOwners()

void SelectMgr_ViewerSelector::ActiveOwners ( NCollection_List< occ::handle< SelectMgr_EntityOwner > > & theOwners) const

Returns the list of active entity owners.

◆ AddSelectableObject()

void SelectMgr_ViewerSelector::AddSelectableObject ( const occ::handle< SelectMgr_SelectableObject > & theObject)

Adds new object to the map of selectable objects.

◆ AddSelectionToObject()

void SelectMgr_ViewerSelector::AddSelectionToObject ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const occ::handle< SelectMgr_Selection > & theSelection )

Adds new selection to the object and builds its BVH tree.

◆ AllowOverlapDetection()

void SelectMgr_ViewerSelector::AllowOverlapDetection ( const bool theIsToAllow)

Is used for rectangular selection only If theIsToAllow is false, only fully included sensitives will be detected, otherwise the algorithm will mark both included and overlapped entities as matched.

◆ checkOverlap()

void SelectMgr_ViewerSelector::checkOverlap ( const occ::handle< Select3D_SensitiveEntity > & theEntity,
const gp_GTrsf & theInversedTrsf,
SelectMgr_SelectingVolumeManager & theMgr )
protected

Internal function that checks if a particular sensitive entity theEntity overlaps current selecting volume precisely.

◆ Clear()

void SelectMgr_ViewerSelector::Clear ( )
inline

Empties all the tables, removes all selections...

◆ ClearPicked()

void SelectMgr_ViewerSelector::ClearPicked ( )

Clears picking results.

◆ ClearSensitive()

void SelectMgr_ViewerSelector::ClearSensitive ( const occ::handle< V3d_View > & theView)

◆ Contains()

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

◆ CustomPixelTolerance()

int SelectMgr_ViewerSelector::CustomPixelTolerance ( ) const
inline

Returns custom pixel tolerance value.

◆ DepthTolerance()

double SelectMgr_ViewerSelector::DepthTolerance ( ) const
inline

Return the tolerance for considering two entities having a similar depth (distance from eye to entity).

◆ DepthToleranceType()

SelectMgr_TypeOfDepthTolerance SelectMgr_ViewerSelector::DepthToleranceType ( ) const
inline

Return the type of tolerance for considering two entities having a similar depth (distance from eye to entity); SelectMgr_TypeOfDepthTolerance_SensitivityFactor by default.

◆ DisplaySensitive() [1/2]

void SelectMgr_ViewerSelector::DisplaySensitive ( const occ::handle< SelectMgr_Selection > & theSel,
const gp_Trsf & theTrsf,
const occ::handle< V3d_View > & theView,
const bool theToClearOthers = true )

◆ DisplaySensitive() [2/2]

void SelectMgr_ViewerSelector::DisplaySensitive ( const occ::handle< V3d_View > & theView)

Displays sensitives in view <theView>.

◆ DumpJson()

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

Dumps the content of me into the stream.

◆ EntitySetBuilder()

const occ::handle< Select3D_BVHBuilder3d > SelectMgr_ViewerSelector::EntitySetBuilder ( )
inline

Returns the default builder used to construct BVH of entity set.

◆ GetManager()

SelectMgr_SelectingVolumeManager & SelectMgr_ViewerSelector::GetManager ( )
inline

Returns instance of selecting volume manager of the viewer selector.

◆ IsActive()

bool SelectMgr_ViewerSelector::IsActive ( const occ::handle< SelectMgr_SelectableObject > & theSelectableObject,
const int theMode ) const

Returns true if the selectable object aSelectableObject having the selection mode aMode is active in this selector.

◆ IsInside()

bool SelectMgr_ViewerSelector::IsInside ( const occ::handle< SelectMgr_SelectableObject > & theSelectableObject,
const int theMode ) const

Returns true if the selectable object aSelectableObject having the selection mode aMode is in this selector.

◆ Modes()

bool SelectMgr_ViewerSelector::Modes ( const occ::handle< SelectMgr_SelectableObject > & theSelectableObject,
NCollection_List< int > & theModeList,
const SelectMgr_StateOfSelection theWantedState = SelectMgr_SOS_Any ) const

Returns the list of selection modes ModeList found in this selector for the selectable object aSelectableObject. Returns true if aSelectableObject is referenced inside this selector; returns false if the object is not present in this selector.

◆ MoveSelectableObject()

void SelectMgr_ViewerSelector::MoveSelectableObject ( const occ::handle< SelectMgr_SelectableObject > & theObject)

Moves existing object from set of not transform persistence objects to set of transform persistence objects (or vice versa).

◆ NbPicked()

int SelectMgr_ViewerSelector::NbPicked ( ) const
inline

Returns the number of detected owners.

◆ OnePicked()

occ::handle< SelectMgr_EntityOwner > SelectMgr_ViewerSelector::OnePicked ( ) const
inline

Returns the picked element with the highest priority, and which is the closest to the last successful mouse position.

◆ Pick() [1/4]

void SelectMgr_ViewerSelector::Pick ( const gp_Ax1 & theAxis,
const occ::handle< V3d_View > & theView )

Picks the sensitive entity according to the input axis. This is geometric intersection 3D objects by axis (camera parameters are ignored and objects with transform persistence are skipped).

◆ Pick() [2/4]

void SelectMgr_ViewerSelector::Pick ( const int theXPix,
const int theYPix,
const occ::handle< V3d_View > & theView )

Picks the sensitive entity at the pixel coordinates of the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.

◆ Pick() [3/4]

void SelectMgr_ViewerSelector::Pick ( const int theXPMin,
const int theYPMin,
const int theXPMax,
const int theYPMax,
const occ::handle< V3d_View > & theView )

Picks the sensitive entity according to the minimum and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax> and <theYPMax> defining a 2D area for selection in the 3D view aView.

◆ Pick() [4/4]

void SelectMgr_ViewerSelector::Pick ( const NCollection_Array1< gp_Pnt2d > & thePolyline,
const occ::handle< V3d_View > & theView )

pick action - input pixel values for polyline selection for selection.

◆ Picked()

occ::handle< SelectMgr_EntityOwner > SelectMgr_ViewerSelector::Picked ( const int theRank) const

Returns the entity Owner for the object picked at specified position.

Parameters
theRankrank of detected object within range 1...NbPicked()

◆ PickedData()

const SelectMgr_SortCriterion & SelectMgr_ViewerSelector::PickedData ( const int theRank) const

Returns the Entity for the object picked at specified position.

Parameters
theRankrank of detected object within range 1...NbPicked()

◆ PickedEntity()

const occ::handle< Select3D_SensitiveEntity > & SelectMgr_ViewerSelector::PickedEntity ( const int theRank) const
inline

Returns the Entity for the object picked at specified position.

Parameters
theRankrank of detected object within range 1...NbPicked()

◆ PickedPoint()

gp_Pnt SelectMgr_ViewerSelector::PickedPoint ( const int theRank) const
inline

Returns the 3D point (intersection of picking axis with the object nearest to eye) for the object picked at specified position.

Parameters
theRankrank of detected object within range 1...NbPicked()

◆ PixelTolerance()

int SelectMgr_ViewerSelector::PixelTolerance ( ) const
inline

Returns the largest pixel tolerance.

◆ QueueBVHBuild()

void SelectMgr_ViewerSelector::QueueBVHBuild ( const occ::handle< Select3D_SensitiveEntity > & theEntity)

Queues a sensitive entity to build its BVH.

◆ RebuildObjectsTree()

void SelectMgr_ViewerSelector::RebuildObjectsTree ( const bool theIsForce = false)

Marks BVH of selectable objects for rebuild. Parameter theIsForce set as true guarantees that 1st level BVH for the viewer selector will be rebuilt during this call.

◆ RebuildSensitivesTree()

void SelectMgr_ViewerSelector::RebuildSensitivesTree ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const bool theIsForce = false )

Marks BVH of sensitive entities of particular selectable object for rebuild. Parameter theIsForce set as true guarantees that 2nd level BVH for the object given will be rebuilt during this call.

◆ RemovePicked()

bool SelectMgr_ViewerSelector::RemovePicked ( const occ::handle< SelectMgr_SelectableObject > & theObject)

Remove picked entities associated with specified object.

◆ RemoveSelectableObject()

void SelectMgr_ViewerSelector::RemoveSelectableObject ( const occ::handle< SelectMgr_SelectableObject > & theObject)

Removes selectable object from map of selectable ones.

◆ RemoveSelectionOfObject()

void SelectMgr_ViewerSelector::RemoveSelectionOfObject ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const occ::handle< SelectMgr_Selection > & theSelection )

Removes selection of the object and marks its BVH tree for rebuild.

◆ ResetSelectionActivationStatus()

void SelectMgr_ViewerSelector::ResetSelectionActivationStatus ( )

Marks all added sensitive entities of all objects as non-selectable.

◆ SelectableObjects()

const SelectMgr_SelectableObjectSet & SelectMgr_ViewerSelector::SelectableObjects ( ) const
inline

Return map of selectable objects.

◆ Sensitivity()

double SelectMgr_ViewerSelector::Sensitivity ( ) const
inline

Returns the largest sensitivity of picking.

◆ SetDepthTolerance()

void SelectMgr_ViewerSelector::SetDepthTolerance ( SelectMgr_TypeOfDepthTolerance theType,
double theTolerance )
inline

Set the tolerance for considering two entities having a similar depth (distance from eye to entity).

Parameters
[in]theTypetype of tolerance value
[in]theTolerancetolerance value in 3D scale (SelectMgr_TypeOfDepthTolerance_Uniform) or in pixels (SelectMgr_TypeOfDepthTolerance_UniformPixels); value is ignored in case of SelectMgr_TypeOfDepthTolerance_SensitivityFactor

◆ SetEntitySetBuilder()

void SelectMgr_ViewerSelector::SetEntitySetBuilder ( const occ::handle< Select3D_BVHBuilder3d > & theBuilder)

Sets the default builder used to construct BVH of entity set. The new builder will be also assigned for already defined objects, but computed BVH trees will not be invalidated.

◆ SetPickClosest()

void SelectMgr_ViewerSelector::SetPickClosest ( bool theToPreferClosest)
inline

Set flag determining precedence of picked depth over entity priority in sorted results.

◆ SetPixelTolerance()

void SelectMgr_ViewerSelector::SetPixelTolerance ( const int theTolerance)

Sets the pixel tolerance <theTolerance>.

◆ SetToPrebuildBVH()

void SelectMgr_ViewerSelector::SetToPrebuildBVH ( bool theToPrebuild,
int theThreadsNum = -1 )

Enables/disables building BVH for sensitives in separate threads.

◆ SortResult()

virtual void SelectMgr_ViewerSelector::SortResult ( ) const
virtual

Sorts the detected entities by priority and distance.

◆ Status() [1/2]

TCollection_AsciiString SelectMgr_ViewerSelector::Status ( const occ::handle< SelectMgr_SelectableObject > & theSelectableObject) const

◆ Status() [2/2]

SelectMgr_StateOfSelection SelectMgr_ViewerSelector::Status ( const occ::handle< SelectMgr_Selection > & theSelection) const

Returns the selection status Status of the selection aSelection.

◆ ToPickClosest()

bool SelectMgr_ViewerSelector::ToPickClosest ( ) const
inline

Return the flag determining precedence of picked depth (distance from eye to entity) over entity priority in sorted results; TRUE by default. When flag is TRUE, priority will be considered only if entities have the same depth within the tolerance. When flag is FALSE, entities with higher priority will be in front regardless of their depth (like x-ray).

◆ ToPixMap()

bool SelectMgr_ViewerSelector::ToPixMap ( Image_PixMap & theImage,
const occ::handle< V3d_View > & theView,
const StdSelect_TypeOfSelectionImage theType,
const int thePickedIndex = 1 )

Dump of detection results into image. This method performs axis picking for each pixel in the image and generates a color depending on picking results and selection image type.

Parameters
theImageresult image, should be initialized
theView3D view defining camera position
theTypetype of image to define
thePickedIndexindex of picked entity (1 means topmost)

◆ ToPrebuildBVH()

bool SelectMgr_ViewerSelector::ToPrebuildBVH ( ) const
inline

Returns TRUE if building BVH for sensitives in separate threads is enabled.

◆ traverseObject()

void SelectMgr_ViewerSelector::traverseObject ( const occ::handle< SelectMgr_SelectableObject > & theObject,
const SelectMgr_SelectingVolumeManager & theMgr,
const occ::handle< Graphic3d_Camera > & theCamera,
const NCollection_Mat4< double > & theProjectionMat,
const NCollection_Mat4< double > & theWorldViewMat,
const NCollection_Vec2< int > & theWinSize )
protected

Internal function that checks if there is possible overlap between some entity of selectable object theObject and current selecting volume.

Parameters
[in]theObjectthe selectable object for traversal.
[in]theMgrthe (un)transformed copy of the selecting volume manager representing active selection frustum.
theCamera,theProjectionMat,theWorldViewMat[in]the source camera and matrices for theMgr given.
[in]theWinSizeviewport (window) dimensions for evaluating object's transformation persistence.

◆ TraverseSensitives()

void SelectMgr_ViewerSelector::TraverseSensitives ( const int theViewId = -1)
protected

Traverses BVH containing all added selectable objects and finds candidates for further search of overlap.

◆ updateZLayers()

void SelectMgr_ViewerSelector::updateZLayers ( const occ::handle< V3d_View > & theView)
protected

Update z-layers order map.

◆ WaitForBVHBuild()

void SelectMgr_ViewerSelector::WaitForBVHBuild ( )

Waits BVH threads finished building.

Field Documentation

◆ myBVHThreadPool

occ::handle<SelectMgr_BVHThreadPool> SelectMgr_ViewerSelector::myBVHThreadPool
protected

◆ myCameraDir

gp_Dir SelectMgr_ViewerSelector::myCameraDir
protected

◆ myCameraEye

gp_Pnt SelectMgr_ViewerSelector::myCameraEye
protected

◆ myCameraScale

double SelectMgr_ViewerSelector::myCameraScale
protected

◆ myDepthTolerance

double SelectMgr_ViewerSelector::myDepthTolerance
protected

◆ myDepthTolType

SelectMgr_TypeOfDepthTolerance SelectMgr_ViewerSelector::myDepthTolType
protected

◆ myEntitySetBuilder

occ::handle<Select3D_BVHBuilder3d> SelectMgr_ViewerSelector::myEntitySetBuilder
protected

◆ myIndexes

NCollection_Array1<int> SelectMgr_ViewerSelector::myIndexes
mutableprotected

◆ myIsLeftChildQueuedFirst

bool SelectMgr_ViewerSelector::myIsLeftChildQueuedFirst
protected

◆ myIsSorted

bool SelectMgr_ViewerSelector::myIsSorted
mutableprotected

◆ myMapOfObjectSensitives

NCollection_DataMap<occ::handle<SelectMgr_SelectableObject>, occ::handle<SelectMgr_SensitiveEntitySet> > SelectMgr_ViewerSelector::myMapOfObjectSensitives
protected

◆ mySelectableObjects

SelectMgr_SelectableObjectSet SelectMgr_ViewerSelector::mySelectableObjects
mutableprotected

◆ mySelectingVolumeMgr

SelectMgr_SelectingVolumeManager SelectMgr_ViewerSelector::mySelectingVolumeMgr
protected

◆ mystored

◆ myStructs

NCollection_Sequence<occ::handle<Graphic3d_Structure> > SelectMgr_ViewerSelector::myStructs
protected

list of debug presentations

◆ myTolerances

SelectMgr_ToleranceMap SelectMgr_ViewerSelector::myTolerances
protected

◆ myToPrebuildBVH

bool SelectMgr_ViewerSelector::myToPrebuildBVH
protected

◆ myToPreferClosest

bool SelectMgr_ViewerSelector::myToPreferClosest
protected

◆ myZLayerOrderMap

NCollection_DataMap<Graphic3d_ZLayerId, int> SelectMgr_ViewerSelector::myZLayerOrderMap
protected

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