Open CASCADE Technology  7.2.0
Public Member Functions | Protected Member Functions | Protected Attributes
StdSelect_ViewerSelector3d Class Reference

Selector Usable by Viewers from V3d. More...

#include <StdSelect_ViewerSelector3d.hxx>

Inheritance diagram for StdSelect_ViewerSelector3d:
Inheritance graph
[legend]

Public Member Functions

 StdSelect_ViewerSelector3d ()
 Constructs an empty 3D selector object. More...
 
void SetPixelTolerance (const Standard_Integer theTolerance)
 Sets the pixel tolerance <theTolerance>. More...
 
Standard_Integer PixelTolerance () const
 Returns the pixel tolerance. More...
 
void Pick (const Standard_Integer theXPix, const Standard_Integer theYPix, const 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. More...
 
void Pick (const Standard_Integer theXPMin, const Standard_Integer theYPMin, const Standard_Integer theXPMax, const Standard_Integer theYPMax, const 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. More...
 
void Pick (const TColgp_Array1OfPnt2d &thePolyline, const Handle< V3d_View > &theView)
 pick action - input pixel values for polyline selection for selection. More...
 
Standard_Boolean ToPixMap (Image_PixMap &theImage, const Handle< V3d_View > &theView, const StdSelect_TypeOfSelectionImage theType, const Standard_Integer 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. More...
 
void DisplaySensitive (const Handle< V3d_View > &theView)
 Displays sensitives in view <theView>. More...
 
void ClearSensitive (const Handle< V3d_View > &theView)
 
void DisplaySensitive (const Handle< SelectMgr_Selection > &theSel, const gp_Trsf &theTrsf, const Handle< V3d_View > &theView, const Standard_Boolean theToClearOthers=Standard_True)
 
virtual Standard_Boolean HasDepthClipping (const Handle< SelectMgr_EntityOwner > &theOwner) const override
 Returns True if the owner provides clipping by depth for its sensitives. Override this method to tell the selector to use the DepthClipping method for the owner. Default implementation returns False for every owner. More...
 
- Public Member Functions inherited from SelectMgr_ViewerSelector
void Clear ()
 Empties all the tables, removes all selections... More...
 
Standard_Real Sensitivity () const
 returns the Sensitivity of picking More...
 
void SortResult ()
 Sorts the detected entites by priority and distance. to be redefined if other criterion are used... More...
 
Handle< SelectMgr_EntityOwnerOnePicked () const
 Returns the picked element with the highest priority, and which is the closest to the last successful mouse position. More...
 
void SetPickClosest (const Standard_Boolean theToPreferClosest)
 Set preference of selecting one object for OnePicked() method: More...
 
Standard_Integer NbPicked () const
 Returns the number of detected owners. More...
 
Handle< SelectMgr_EntityOwnerPicked (const Standard_Integer theRank) const
 Returns the entity Owner for the object picked at specified position. More...
 
const SelectMgr_SortCriterionPickedData (const Standard_Integer theRank) const
 Returns the Entity for the object picked at specified position. More...
 
const Handle< SelectBasics_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_BVHBuilder3dEntitySetBuilder ()
 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< SelectBasics_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_SelectingVolumeManagerGetManager ()
 Returns instance of selecting volume manager of the viewer selector. 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...
 
 Standard_DEPRECATED ("Deprecated method Init()") void Init()
 Begins an iteration scanning for the owners detected at a position in the view. More...
 
 Standard_DEPRECATED ("Deprecated method More()") 1 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...
 
 Standard_DEPRECATED ("Deprecated method Next()") 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...
 
 Standard_DEPRECATED ("Deprecated method Picked()") 1 Handle< SelectMgr_EntityOwner > Picked() const
 Returns the current selected entity detected by the selector;. More...
 
 Standard_DEPRECATED ("Deprecated method InitDetected()") void InitDetected()
 Initializes internal iterator for stored detected sensitive entities. More...
 
 Standard_DEPRECATED ("Deprecated method NextDetected()") void NextDetected()
 Makes a step along the map of detected sensitive entities and their owners. More...
 
 Standard_DEPRECATED ("Deprecated method MoreDetected()") Standard_Boolean MoreDetected()
 Returns true if iterator of map of detected sensitive entities has reached its end. More...
 
 Standard_DEPRECATED ("Deprecated method DetectedEntity() should be replaced by DetectedEntity(int)") 1 const Handle< SelectBasics_SensitiveEntity > &DetectedEntity() const
 Returns sensitive entity that was detected during the previous run of selection algorithm. 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 computeSensitivePrs (const Handle< Graphic3d_Structure > &theStructure, const Handle< SelectMgr_Selection > &theSel, const gp_Trsf &theLoc, const Handle< Graphic3d_TransformPers > &theTrsfPers)
 
void updateZLayers (const Handle< V3d_View > &theView)
 Update z-layers order map. More...
 
- Protected Member Functions inherited from SelectMgr_ViewerSelector
 SelectMgr_ViewerSelector ()
 
void TraverseSensitives ()
 Traverses BVH containing all added selectable objects and finds candidates for further search of overlap. More...
 
void traverseObject (const Handle< SelectMgr_SelectableObject > &theObject, const SelectMgr_SelectingVolumeManager &theMgr, const Handle< Graphic3d_Camera > &theCamera, const Graphic3d_Mat4d &theProjectionMat, const Graphic3d_Mat4d &theWorldViewMat, const Standard_Integer theViewportWidth, const Standard_Integer theViewportHeight)
 Internal function that checks if there is possible overlap between some entity of selectable object theObject and current selecting volume. More...
 
void checkOverlap (const Handle< SelectBasics_SensitiveEntity > &theEntity, const gp_GTrsf &theInversedTrsf, SelectMgr_SelectingVolumeManager &theMgr)
 Internal function that checks if a particular sensitive entity theEntity overlaps current selecting volume precisely. More...
 

Protected Attributes

Graphic3d_SequenceOfStructure myStructs
 
- Protected Attributes inherited from SelectMgr_ViewerSelector
Standard_Boolean preferclosest
 
Standard_Boolean myToUpdateTolerance
 
SelectMgr_IndexedDataMapOfOwnerCriterion mystored
 
SelectMgr_SelectingVolumeManager mySelectingVolumeMgr
 
SelectMgr_SelectableObjectSet mySelectableObjects
 
SelectMgr_ToleranceMap myTolerances
 
NCollection_DataMap< Graphic3d_ZLayerId, Standard_IntegermyZLayerOrderMap
 
Handle< Select3D_BVHBuilder3dmyEntitySetBuilder
 

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

Selector Usable by Viewers from V3d.

Constructor & Destructor Documentation

◆ StdSelect_ViewerSelector3d()

StdSelect_ViewerSelector3d::StdSelect_ViewerSelector3d ( )

Constructs an empty 3D selector object.

Member Function Documentation

◆ ClearSensitive()

void StdSelect_ViewerSelector3d::ClearSensitive ( const Handle< V3d_View > &  theView)

◆ computeSensitivePrs()

void StdSelect_ViewerSelector3d::computeSensitivePrs ( const Handle< Graphic3d_Structure > &  theStructure,
const Handle< SelectMgr_Selection > &  theSel,
const gp_Trsf theLoc,
const Handle< Graphic3d_TransformPers > &  theTrsfPers 
)
protected

◆ DisplaySensitive() [1/2]

void StdSelect_ViewerSelector3d::DisplaySensitive ( const Handle< V3d_View > &  theView)

Displays sensitives in view <theView>.

◆ DisplaySensitive() [2/2]

void StdSelect_ViewerSelector3d::DisplaySensitive ( const Handle< SelectMgr_Selection > &  theSel,
const gp_Trsf theTrsf,
const Handle< V3d_View > &  theView,
const Standard_Boolean  theToClearOthers = Standard_True 
)

◆ HasDepthClipping()

virtual Standard_Boolean StdSelect_ViewerSelector3d::HasDepthClipping ( const Handle< SelectMgr_EntityOwner > &  theOwner) const
overridevirtual

Returns True if the owner provides clipping by depth for its sensitives. Override this method to tell the selector to use the DepthClipping method for the owner. Default implementation returns False for every owner.

Parameters
theOwner[in] the onwer to check.
Returns
True if owner provides depth limits for sensitive clipping.

Reimplemented from SelectMgr_ViewerSelector.

◆ Pick() [1/3]

void StdSelect_ViewerSelector3d::Pick ( const Standard_Integer  theXPix,
const Standard_Integer  theYPix,
const 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() [2/3]

void StdSelect_ViewerSelector3d::Pick ( const Standard_Integer  theXPMin,
const Standard_Integer  theYPMin,
const Standard_Integer  theXPMax,
const Standard_Integer  theYPMax,
const 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() [3/3]

void StdSelect_ViewerSelector3d::Pick ( const TColgp_Array1OfPnt2d thePolyline,
const Handle< V3d_View > &  theView 
)

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

◆ PixelTolerance()

Standard_Integer StdSelect_ViewerSelector3d::PixelTolerance ( ) const
inline

Returns the pixel tolerance.

◆ SetPixelTolerance()

void StdSelect_ViewerSelector3d::SetPixelTolerance ( const Standard_Integer  theTolerance)

Sets the pixel tolerance <theTolerance>.

◆ ToPixMap()

Standard_Boolean StdSelect_ViewerSelector3d::ToPixMap ( Image_PixMap theImage,
const Handle< V3d_View > &  theView,
const StdSelect_TypeOfSelectionImage  theType,
const Standard_Integer  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)

◆ updateZLayers()

void StdSelect_ViewerSelector3d::updateZLayers ( const Handle< V3d_View > &  theView)
protected

Update z-layers order map.

Field Documentation

◆ myStructs

Graphic3d_SequenceOfStructure StdSelect_ViewerSelector3d::myStructs
protected

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