Open CASCADE Technology
6.8.0
|
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. This framework is undefined for either 2D or 3D, and is consequently used by both StdSelect_ViewerSelector2d and StdSelect_ViewerSelector3d, which inherit it, and which in turn, return 2D and 3D owners of sensitive primitives respectively. 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. In 2D, you will, however, need the services provided by the StdSelect_ViewerSelector2d. 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, 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>
Public Member Functions | |
virtual void | Convert (const Handle< SelectMgr_Selection > &aSelection) |
to be redefined if conversion is necessary for SensitiveEntities... More... | |
void | Clear () |
Empties all the tables, removes all selections... More... | |
void | UpdateConversion () |
converts all the sensitive entities ; More... | |
void | SetSensitivity (const Standard_Real aTol) |
changes the Sensitivity of picking Input value is Real. More... | |
Standard_Real | Sensitivity () const |
returns the Sensitivity of picking More... | |
void | SetClipping (const Standard_Real Xc, const Standard_Real Yc, const Standard_Real Height, const Standard_Real Width) |
sets the clipping limits of dynamic picking input value are Real More... | |
void | SetClipping (const Bnd_Box2d &aRectangle) |
sets the clipping limits of dynamic picking input value are Real More... | |
void | InitSelect (const Standard_Real Xr, const Standard_Real Yr) |
Performs a pick action. Xr, Yr are the real 2D mouse coordinates in the view. The selector looks for areas and owners that are touched. More... | |
void | InitSelect (const Bnd_Box2d &aRect) |
Performs a pick action. aRect is a Box2d (real coordinates) for the selection. The selector looks for areas and owners that are touched. More... | |
void | InitSelect (const Standard_Real Xmin, const Standard_Real Ymin, const Standard_Real Xmax, const Standard_Real Ymax) |
Performs a pick action. More... | |
void | InitSelect (const TColgp_Array1OfPnt2d &Polyline) |
pick action - input values of a polyline selection for selection. More... | |
virtual void | SortResult () |
Sorts the detected entites by priority and distance. to be redefined if other criterion are used... 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. 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... | |
Handle< SelectMgr_EntityOwner > | OnePicked () |
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 preferClosest) |
Set preference of selecting one object for OnePicked() method: More... | |
Standard_Integer | NbPicked () const |
Returns the number of owners found at a position in the view by the Init - More - Next - Picked iteration. More... | |
Handle< SelectMgr_EntityOwner > | Picked (const Standard_Integer aRank) const |
Returns the entity which is at rank <aRank> in the list of stored ones. More... | |
Standard_Boolean | HasStored () |
Returns True if a successful pick was stored, i.e. LastPosition method means something... More... | |
void | LastPosition (Standard_Real &Xr, Standard_Real &Yr) const |
Gives the last successful pick position; is useful to get objects really picked. More... | |
Standard_Boolean | Contains (const Handle< SelectMgr_SelectableObject > &aSelectableObject) const |
Standard_Boolean | Modes (const Handle< SelectMgr_SelectableObject > &aSelectableObject, TColStd_ListOfInteger &ModeList, const SelectMgr_StateOfSelection WantedState=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 > &aSelectableObject, const Standard_Integer aMode) 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 > &aSelectableObject, const Standard_Integer aMode) 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 > &aSelection) const |
Returns the selection status Status of the selection aSelection. More... | |
void | Dump (Standard_OStream &S) const |
TCollection_AsciiString | Status (const Handle< SelectMgr_SelectableObject > &aSelectableObject) const |
TCollection_AsciiString | Status () const |
gives general information about the Selector More... | |
void | UpdateSort () |
Handle < SelectBasics_SensitiveEntity > | Primitive (const Standard_Integer Rank) const |
const SelectMgr_DataMapOfIntegerSensitive & | Primitives () const |
void | SetUpdateSortPossible (const Standard_Boolean possible) |
Standard_Boolean | IsUpdateSortPossible () const |
const SelectBasics_PickArgs & | LastPickingArguments () const |
![]() | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
![]() | |
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 const Handle_Standard_Type & | DynamicType () const |
Returns a type information object about this object. More... | |
Standard_Boolean | IsInstance (const 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 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... | |
virtual Handle_Standard_Transient | This () const |
Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
Protected Member Functions | |
SelectMgr_ViewerSelector () | |
virtual void | LoadResult () |
virtual void | LoadResult (const Bnd_Box2d &aBox) |
virtual void | LoadResult (const TColgp_Array1OfPnt2d &Polyline) |
virtual gp_Lin | PickingLine (const Standard_Real theX, const Standard_Real theY) const |
Returns picking line along which the depth value should be computed. Override this method to compute picking line by the same which is used for projecting sensitive entities to selection space. More... | |
virtual void | DepthClipping (const Standard_Real theX, const Standard_Real theY, Standard_Real &theMin, Standard_Real &theMax) const |
Returns global depth clipping limits applied to every sensitive. Override this method to convert clippings defined by application into selection space for mouse picking detection. Default implementation returns infinite clip limits (no clipping). More... | |
virtual void | DepthClipping (const Standard_Real theX, const Standard_Real theY, const Handle< SelectMgr_EntityOwner > &theOwner, Standard_Real &theMin, Standard_Real &theMax) const |
Returns depth clipping limits applied to sensitives of entity owner. Override this method to convert clippings defined by application owners into selection space for mouse picking detection. Default implementation returns infinite clip limits (no clipping). More... | |
virtual Standard_Boolean | HasDepthClipping (const Handle< SelectMgr_EntityOwner > &theOwner) const |
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... | |
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. This framework is undefined for either 2D or 3D, and is consequently used by both StdSelect_ViewerSelector2d and StdSelect_ViewerSelector3d, which inherit it, and which in turn, return 2D and 3D owners of sensitive primitives respectively. 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. In 2D, you will, however, need the services provided by the StdSelect_ViewerSelector2d. 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, 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.
|
protected |
void SelectMgr_ViewerSelector::Clear | ( | ) |
Empties all the tables, removes all selections...
Standard_Boolean SelectMgr_ViewerSelector::Contains | ( | const Handle< SelectMgr_SelectableObject > & | aSelectableObject | ) | const |
|
virtual |
to be redefined if conversion is necessary for SensitiveEntities...
Reimplemented in StdSelect_ViewerSelector3d.
|
protectedvirtual |
Returns global depth clipping limits applied to every sensitive. Override this method to convert clippings defined by application into selection space for mouse picking detection. Default implementation returns infinite clip limits (no clipping).
theX | [in] the x picking coordinate. |
theY | [in] the y picking coordinate. |
theMin | [out] the minimum depth. Default is RealFirst() |
theMax | [out] the maximum depth. Default is RealLast() |
Reimplemented in StdSelect_ViewerSelector3d.
|
protectedvirtual |
Returns depth clipping limits applied to sensitives of entity owner. Override this method to convert clippings defined by application owners into selection space for mouse picking detection. Default implementation returns infinite clip limits (no clipping).
theX | [in] the x picking coordinate. |
theY | [in] the y picking coordinate. |
theOwner | [in] the sensitive owner. |
theMin | [out] the minimum depth. Default is RealFirst() |
theMax | [out] the maximum depth. Default is RealLast() |
Reimplemented in StdSelect_ViewerSelector3d.
void SelectMgr_ViewerSelector::Dump | ( | Standard_OStream & | S | ) | const |
|
protectedvirtual |
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.
theOwner | [in] the onwer to check. |
Reimplemented in StdSelect_ViewerSelector3d.
Standard_Boolean SelectMgr_ViewerSelector::HasStored | ( | ) |
Returns True if a successful pick was stored, i.e. LastPosition method means something...
void SelectMgr_ViewerSelector::Init | ( | ) |
Begins an iteration scanning for the owners detected at a position in the view.
void SelectMgr_ViewerSelector::InitSelect | ( | const Standard_Real | Xr, |
const Standard_Real | Yr | ||
) |
Performs a pick action. Xr, Yr are the real 2D mouse coordinates in the view. The selector looks for areas and owners that are touched.
void SelectMgr_ViewerSelector::InitSelect | ( | const Bnd_Box2d & | aRect | ) |
Performs a pick action. aRect is a Box2d (real coordinates) for the selection. The selector looks for areas and owners that are touched.
void SelectMgr_ViewerSelector::InitSelect | ( | const Standard_Real | Xmin, |
const Standard_Real | Ymin, | ||
const Standard_Real | Xmax, | ||
const Standard_Real | Ymax | ||
) |
Performs a pick action.
void SelectMgr_ViewerSelector::InitSelect | ( | const TColgp_Array1OfPnt2d & | Polyline | ) |
pick action - input values of a polyline selection for selection.
Standard_Boolean SelectMgr_ViewerSelector::IsActive | ( | const Handle< SelectMgr_SelectableObject > & | aSelectableObject, |
const Standard_Integer | aMode | ||
) | const |
Returns true if the selectable object aSelectableObject having the selection mode aMode is active in this selector.
Standard_Boolean SelectMgr_ViewerSelector::IsInside | ( | const Handle< SelectMgr_SelectableObject > & | aSelectableObject, |
const Standard_Integer | aMode | ||
) | const |
Returns true if the selectable object aSelectableObject having the selection mode aMode is in this selector.
Standard_Boolean SelectMgr_ViewerSelector::IsUpdateSortPossible | ( | ) | const |
const SelectBasics_PickArgs& SelectMgr_ViewerSelector::LastPickingArguments | ( | ) | const |
void SelectMgr_ViewerSelector::LastPosition | ( | Standard_Real & | Xr, |
Standard_Real & | Yr | ||
) | const |
Gives the last successful pick position; is useful to get objects really picked.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Standard_Boolean SelectMgr_ViewerSelector::Modes | ( | const Handle< SelectMgr_SelectableObject > & | aSelectableObject, |
TColStd_ListOfInteger & | ModeList, | ||
const SelectMgr_StateOfSelection | WantedState = 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.
Standard_Boolean SelectMgr_ViewerSelector::More | ( | ) |
Continues the interation scanning for the owners detected at a position in the view, or.
Standard_Integer SelectMgr_ViewerSelector::NbPicked | ( | ) | const |
Returns the number of owners found at a position in the view by the Init - More - Next - Picked iteration.
void SelectMgr_ViewerSelector::Next | ( | ) |
Returns the next owner found in the iteration. This is a scan for the owners detected at a position in the view.
Handle< SelectMgr_EntityOwner > SelectMgr_ViewerSelector::OnePicked | ( | ) |
Returns the picked element with the highest priority, and which is the closest to the last successful mouse position.
Handle< SelectMgr_EntityOwner > SelectMgr_ViewerSelector::Picked | ( | ) | const |
Returns the current selected entity detected by the selector;.
Handle< SelectMgr_EntityOwner > SelectMgr_ViewerSelector::Picked | ( | const Standard_Integer | aRank | ) | const |
Returns the entity which is at rank <aRank> in the list of stored ones.
|
protectedvirtual |
Returns picking line along which the depth value should be computed. Override this method to compute picking line by the same which is used for projecting sensitive entities to selection space.
theX | [in] the x picking coordinate. |
theY | [in] the y picking coordinate. |
Reimplemented in StdSelect_ViewerSelector3d.
Handle< SelectBasics_SensitiveEntity > SelectMgr_ViewerSelector::Primitive | ( | const Standard_Integer | Rank | ) | const |
const SelectMgr_DataMapOfIntegerSensitive& SelectMgr_ViewerSelector::Primitives | ( | ) | const |
Standard_Real SelectMgr_ViewerSelector::Sensitivity | ( | ) | const |
returns the Sensitivity of picking
void SelectMgr_ViewerSelector::SetClipping | ( | const Standard_Real | Xc, |
const Standard_Real | Yc, | ||
const Standard_Real | Height, | ||
const Standard_Real | Width | ||
) |
sets the clipping limits of dynamic picking input value are Real
void SelectMgr_ViewerSelector::SetClipping | ( | const Bnd_Box2d & | aRectangle | ) |
sets the clipping limits of dynamic picking input value are Real
void SelectMgr_ViewerSelector::SetPickClosest | ( | const Standard_Boolean | preferClosest | ) |
Set preference of selecting one object for OnePicked() method:
void SelectMgr_ViewerSelector::SetSensitivity | ( | const Standard_Real | aTol | ) |
changes the Sensitivity of picking Input value is Real.
void SelectMgr_ViewerSelector::SetUpdateSortPossible | ( | const Standard_Boolean | possible | ) |
|
virtual |
Sorts the detected entites by priority and distance. to be redefined if other criterion are used...
SelectMgr_StateOfSelection SelectMgr_ViewerSelector::Status | ( | const Handle< SelectMgr_Selection > & | aSelection | ) | const |
Returns the selection status Status of the selection aSelection.
TCollection_AsciiString SelectMgr_ViewerSelector::Status | ( | const Handle< SelectMgr_SelectableObject > & | aSelectableObject | ) | const |
TCollection_AsciiString SelectMgr_ViewerSelector::Status | ( | ) | const |
gives general information about the Selector
void SelectMgr_ViewerSelector::UpdateConversion | ( | ) |
converts all the sensitive entities ;
void SelectMgr_ViewerSelector::UpdateSort | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |