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...
|
void | Clear () |
| Empties all the tables, removes all selections... More...
|
|
Standard_Integer | CustomPixelTolerance () const |
| Returns custom pixel tolerance value. More...
|
|
void | SetPixelTolerance (const Standard_Integer theTolerance) |
| Sets the pixel tolerance <theTolerance>. More...
|
|
Standard_Real | Sensitivity () const |
| Returns the largest sensitivity of picking. More...
|
|
Standard_Integer | PixelTolerance () const |
| Returns the largest pixel tolerance. More...
|
|
virtual void | SortResult () |
| Sorts the detected entites by priority and distance. More...
|
|
Handle< SelectMgr_EntityOwner > | OnePicked () const |
| Returns the picked element with the highest priority, and which is the closest to the last successful mouse position. More...
|
|
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). More...
|
|
void | SetPickClosest (bool theToPreferClosest) |
| Set flag determining precedence of picked depth over entity priority in sorted results. More...
|
|
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. More...
|
|
Standard_Real | DepthTolerance () const |
| Return the tolerance for considering two entities having a similar depth (distance from eye to entity). More...
|
|
void | SetDepthTolerance (SelectMgr_TypeOfDepthTolerance theType, Standard_Real theTolerance) |
| Set the tolerance for considering two entities having a similar depth (distance from eye to entity). More...
|
|
Standard_Integer | NbPicked () const |
| Returns the number of detected owners. More...
|
|
void | ClearPicked () |
| Clears picking results. More...
|
|
Handle< SelectMgr_EntityOwner > | Picked (const Standard_Integer theRank) const |
| Returns the entity Owner for the object picked at specified position. More...
|
|
const SelectMgr_SortCriterion & | PickedData (const Standard_Integer theRank) const |
| Returns the Entity for the object picked at specified position. More...
|
|
const Handle< Select3D_SensitiveEntity > & | PickedEntity (const Standard_Integer theRank) const |
| Returns the Entity for the object picked at specified position. More...
|
|
gp_Pnt | PickedPoint (const Standard_Integer theRank) const |
| Returns the 3D point (intersection of picking axis with the object nearest to eye) for the object picked at specified position. More...
|
|
Standard_Boolean | Contains (const Handle< SelectMgr_SelectableObject > &theObject) const |
|
const Handle< Select3D_BVHBuilder3d > | EntitySetBuilder () |
| Returns the default builder used to construct BVH of entity set. More...
|
|
void | SetEntitySetBuilder (const 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. More...
|
|
Standard_Boolean | Modes (const Handle< SelectMgr_SelectableObject > &theSelectableObject, TColStd_ListOfInteger &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. More...
|
|
Standard_Boolean | IsActive (const Handle< SelectMgr_SelectableObject > &theSelectableObject, const Standard_Integer theMode) const |
| Returns true if the selectable object aSelectableObject having the selection mode aMode is active in this selector. More...
|
|
Standard_Boolean | IsInside (const Handle< SelectMgr_SelectableObject > &theSelectableObject, const Standard_Integer theMode) const |
| Returns true if the selectable object aSelectableObject having the selection mode aMode is in this selector. More...
|
|
SelectMgr_StateOfSelection | Status (const Handle< SelectMgr_Selection > &theSelection) const |
| Returns the selection status Status of the selection aSelection. More...
|
|
TCollection_AsciiString | Status (const Handle< SelectMgr_SelectableObject > &theSelectableObject) const |
|
void | ActiveOwners (NCollection_List< Handle< SelectMgr_EntityOwner >> &theOwners) const |
| Returns the list of active entity owners. More...
|
|
void | AddSelectableObject (const Handle< SelectMgr_SelectableObject > &theObject) |
| Adds new object to the map of selectable objects. More...
|
|
void | AddSelectionToObject (const Handle< SelectMgr_SelectableObject > &theObject, const Handle< SelectMgr_Selection > &theSelection) |
| Adds new selection to the object and builds its BVH tree. More...
|
|
void | MoveSelectableObject (const Handle< SelectMgr_SelectableObject > &theObject) |
| Moves existing object from set of not transform persistence objects to set of transform persistence objects (or vice versa). More...
|
|
void | RemoveSelectableObject (const Handle< SelectMgr_SelectableObject > &theObject) |
| Removes selectable object from map of selectable ones. More...
|
|
void | RemoveSelectionOfObject (const Handle< SelectMgr_SelectableObject > &theObject, const Handle< SelectMgr_Selection > &theSelection) |
| Removes selection of the object and marks its BVH tree for rebuild. More...
|
|
void | RebuildObjectsTree (const Standard_Boolean theIsForce=Standard_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. More...
|
|
void | RebuildSensitivesTree (const Handle< SelectMgr_SelectableObject > &theObject, const Standard_Boolean theIsForce=Standard_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. More...
|
|
SelectMgr_SelectingVolumeManager & | GetManager () |
| Returns instance of selecting volume manager of the viewer selector. More...
|
|
const SelectMgr_SelectableObjectSet & | SelectableObjects () const |
| Return map of selectable objects. More...
|
|
void | ResetSelectionActivationStatus () |
| Marks all added sensitive entities of all objects as non-selectable. More...
|
|
void | AllowOverlapDetection (const Standard_Boolean 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. More...
|
|
void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const |
| Dumps the content of me into the stream. More...
|
|
void | Init () |
| Begins an iteration scanning for the owners detected at a position in the view. More...
|
|
Standard_Boolean | More () |
| Continues the interation scanning for the owners detected at a position in the view, or continues the iteration scanning for the owner closest to the position in the view. More...
|
|
void | Next () |
| Returns the next owner found in the iteration. This is a scan for the owners detected at a position in the view. More...
|
|
Handle< SelectMgr_EntityOwner > | Picked () const |
| Returns the current selected entity detected by the selector;. More...
|
|
void | InitDetected () |
| Initializes internal iterator for stored detected sensitive entities. More...
|
|
void | NextDetected () |
| Makes a step along the map of detected sensitive entities and their owners. More...
|
|
Standard_Boolean | MoreDetected () |
| Returns true if iterator of map of detected sensitive entities has reached its end. More...
|
|
const Handle< Select3D_SensitiveEntity > & | DetectedEntity () const |
| Returns sensitive entity that was detected during the previous run of selection algorithm. More...
|
|
void | SetToPrebuildBVH (Standard_Boolean theToPrebuild, Standard_Integer theThreadsNum=-1) |
| Enables/disables building BVH for sensitives in separate threads. More...
|
|
void | QueueBVHBuild (const Handle< Select3D_SensitiveEntity > &theEntity) |
| Queues a sensitive entity to build its BVH. More...
|
|
void | WaitForBVHBuild () |
| Waits BVH threads finished building. More...
|
|
Standard_Boolean | ToPrebuildBVH () const |
| Returns TRUE if building BVH for sensitives in separate threads is enabled. More...
|
|
Public Member Functions inherited from Standard_Transient |
| Standard_Transient () |
| Empty constructor. More...
|
|
| Standard_Transient (const Standard_Transient &) |
| Copy constructor – does nothing. More...
|
|
Standard_Transient & | operator= (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_Transient * | This () 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...
|
|
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:
- tolerance value stored in mytolerance will be used to calculate initial selecting frustum, which will be applied for intersection testing during BVH traverse;
- if tolerance of sensitive entity is less than mytolerance, the frustum for intersection detection will be resized according to its sensitivity.