# Visualization
TKV3d
SelectMgr

# 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.
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.
.

`#include <SelectMgr_ViewerSelector.hxx>`

Inheritance diagram for SelectMgr_ViewerSelector:

[legend]

## Public Member Functions

virtual Standard_EXPORT void | Convert (const Handle(SelectMgr_Selection)&aSelection)
| to be redefined if conversion is necessary for SensitiveEntities...
Standard_EXPORT void | Clear ()
| Empties all the tables, removes all selections... .
Standard_EXPORT void | UpdateConversion ()
| converts all the sensitive entities ;
Standard_EXPORT void | SetSensitivity (const Standard_Real aTol)
| changes the Sensitivity of picking Input value is Real.
Standard_EXPORT 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
Standard_EXPORT void | SetClipping (const Bnd_Box2d &aRectangle)
| sets the clipping limits of dynamic picking input value are Real
Standard_EXPORT 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. .
Standard_EXPORT 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. .
Standard_EXPORT void | InitSelect (const Standard_Real Xmin, const Standard_Real Ymin, const Standard_Real Xmax, const Standard_Real Ymax)
| Performs a pick action - Xmin, Ymin define the coordinates of the minimum point in the lower left hand corner of the selection box, and XMax, YMax define the coordinates of the maximum point in the upper right hand corner of the selection box. The selector looks for areas and owners that are touched. .
Standard_EXPORT void | InitSelect (const TColgp_Array1OfPnt2d &Polyline)
| pick action - input values of a polyline selection for selection.
virtual Standard_EXPORT void | SortResult ()
| Sorts the detected entites by priority and distance. to be redefined if other criterion are used... .
void | Init ()
| Begins an iteration scanning for the owners detected at a position in the view. .
Standard_EXPORT 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. .
void | Next ()
| Returns the next owner found in the iteration. This is a scan for the owners detected at a position in the view. .
Standard_EXPORT Handle_SelectMgr_EntityOwner | Picked () const
| Returns the current selected entity detected by the selector; .
Standard_EXPORT Handle_SelectMgr_EntityOwner | OnePicked ()
| Returns the picked element with the highest priority, and which is the closest to the last successful mouse position. .
Standard_EXPORT Standard_Integer | NbPicked () const
| Returns the number of owners found at a position in the view by the Init - More - Next - Picked iteration. .
Standard_EXPORT Handle_SelectMgr_EntityOwner | Picked (const Standard_Integer aRank) const
| Returns the entity which is at rank <arank> in the list of stored ones. .
Standard_EXPORT Standard_Boolean | HasStored ()
| Returns True if a successful pick was stored, i.e. LastPosition method means something... .
Standard_EXPORT void | LastPosition (Standard_Real &Xr, Standard_Real &Yr) const
| Gives the last successful pick position; is useful to get objects really picked .
Standard_EXPORT Standard_Boolean | Contains (const Handle(SelectMgr_SelectableObject)&aSelectableObject) const
Standard_EXPORT 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. .
Standard_EXPORT 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. .
Standard_EXPORT 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. .
Standard_EXPORT SelectMgr_StateOfSelection | Status (const Handle(SelectMgr_Selection)&aSelection) const
| Returns the selection status Status of the selection aSelection. .
Standard_EXPORT void | Dump (Standard_OStream &S) const
Standard_EXPORT TCollection_AsciiString | Status (const Handle(SelectMgr_SelectableObject)&aSelectableObject) const
Standard_EXPORT TCollection_AsciiString | Status () const
| gives general information about the Selector
Standard_EXPORT void | UpdateSort ()
Standard_EXPORT Handle_SelectBasics_SensitiveEntity | Primitive (const Standard_Integer Rank) const
const SelectMgr_DataMapOfIntegerSensitive & | Primitives () const
Standard_EXPORT void | SetUpdateSortPossible (const Standard_Boolean possible)
Standard_EXPORT Standard_Boolean | IsUpdateSortPossible () const
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Protected Member Functions

Standard_EXPORT | SelectMgr_ViewerSelector ()
virtual Standard_EXPORT void | LoadResult ()
virtual Standard_EXPORT void | LoadResult (const Bnd_Box2d &aBox)
virtual Standard_EXPORT void | LoadResult (const TColgp_Array1OfPnt2d &Polyline)

## Protected Attributes

SelectMgr_DataMapOfIntegerSensitive | myentities
SelectMgr_DataMapOfSelectionActivation | myselections
Standard_Boolean | toupdate
Standard_Boolean | tosort
Standard_Real | mytolerance
SelectBasics_SortAlgo | myselector
Bnd_Box2d | myclip
SelectMgr_IndexedDataMapOfOwnerCriterion | mystored

## Private Member Functions

Standard_EXPORT void | Activate (const Handle(SelectMgr_Selection)&aSelection, const Standard_Boolean AutomaticProj=Standard_True)
Standard_EXPORT void | Deactivate (const Handle(SelectMgr_Selection)&aSelection)
Standard_EXPORT void | Sleep ()
| Desactivates all the objects of the view; no object in this view will be selectable; .
Standard_EXPORT void | Awake (const Standard_Boolean AutomaticProj=Standard_True)
| reactivates all the selection which were sleeping....
Standard_EXPORT void | Sleep (const Handle(SelectMgr_SelectableObject)&anObject)
Standard_EXPORT void | Awake (const Handle(SelectMgr_SelectableObject)&anObject, const Standard_Boolean AutomaticProj=Standard_True)
Standard_EXPORT void | Remove (const Handle(SelectMgr_Selection)&aSelection)
| removes a Selection from the Selector
Standard_EXPORT Standard_Integer | NbBoxes ()

## Private Attributes

Standard_Integer | myactivenb
Handle_TColStd_HArray1OfInteger | myIndexes
TColStd_SequenceOfInteger | myprim
Standard_Integer | myCurRank
Standard_Real | lastx
Standard_Real | lasty
Standard_Boolean | myUpdateSortPossible

## Constructor & Destructor Documentation

Standard_EXPORT SelectMgr_ViewerSelector::SelectMgr_ViewerSelector | ( |  | ) | `[protected]`

## Member Function Documentation

Standard_EXPORT void SelectMgr_ViewerSelector::Activate | ( | const Handle(SelectMgr_Selection)& | aSelection,
|  | const Standard_Boolean | AutomaticProj = `Standard_True`
| ) | `[private]`

Standard_EXPORT void SelectMgr_ViewerSelector::Awake | ( | const Handle(SelectMgr_SelectableObject)& | anObject,
|  | const Standard_Boolean | AutomaticProj = `Standard_True`
| ) | `[private]`

Standard_EXPORT void SelectMgr_ViewerSelector::Awake | ( | const Standard_Boolean | AutomaticProj = `Standard_True` | ) | `[private]`

Standard_EXPORT void SelectMgr_ViewerSelector::Clear | ( |  | ) |

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::Contains | ( | const Handle(SelectMgr_SelectableObject)& | aSelectableObject | ) | const

virtual Standard_EXPORT void SelectMgr_ViewerSelector::Convert | ( | const Handle(SelectMgr_Selection)& | aSelection | ) | `[virtual]`

| Reimplemented in StdSelect_ViewerSelector2d, and StdSelect_ViewerSelector3d.

Standard_EXPORT void SelectMgr_ViewerSelector::Deactivate | ( | const Handle(SelectMgr_Selection)& | aSelection | ) | `[private]`

Standard_EXPORT void SelectMgr_ViewerSelector::Dump | ( | Standard_OStream & | S | ) | const

Standard_EXPORT const SelectMgr_ViewerSelector::Handle | ( | Standard_Type |  | ) | const

| Reimplemented in StdSelect_ViewerSelector2d, and StdSelect_ViewerSelector3d.

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::HasStored | ( |  | ) |

void SelectMgr_ViewerSelector::Init | ( |  | ) | `[inline]`

Standard_EXPORT void SelectMgr_ViewerSelector::InitSelect | ( | const TColgp_Array1OfPnt2d & | Polyline | ) |

Standard_EXPORT void SelectMgr_ViewerSelector::InitSelect | ( | const Standard_Real | Xmin,
|  | const Standard_Real | Ymin,
|  | const Standard_Real | Xmax,
|  | const Standard_Real | Ymax
| ) |

Standard_EXPORT void SelectMgr_ViewerSelector::InitSelect | ( | const Bnd_Box2d & | aRect | ) |

Standard_EXPORT void SelectMgr_ViewerSelector::InitSelect | ( | const Standard_Real | Xr,
|  | const Standard_Real | Yr
| ) |

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::IsActive | ( | const Handle(SelectMgr_SelectableObject)& | aSelectableObject,
|  | const Standard_Integer | aMode
| ) | const

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::IsInside | ( | const Handle(SelectMgr_SelectableObject)& | aSelectableObject,
|  | const Standard_Integer | aMode
| ) | const

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::IsUpdateSortPossible | ( |  | ) | const

Standard_EXPORT void SelectMgr_ViewerSelector::LastPosition | ( | Standard_Real & | Xr,
|  | Standard_Real & | Yr
| ) | const

virtual Standard_EXPORT void SelectMgr_ViewerSelector::LoadResult | ( | const TColgp_Array1OfPnt2d & | Polyline | ) | `[protected, virtual]`

virtual Standard_EXPORT void SelectMgr_ViewerSelector::LoadResult | ( | const Bnd_Box2d & | aBox | ) | `[protected, virtual]`

virtual Standard_EXPORT void SelectMgr_ViewerSelector::LoadResult | ( |  | ) | `[protected, virtual]`

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::Modes | ( | const Handle(SelectMgr_SelectableObject)& | aSelectableObject,
|  | TColStd_ListOfInteger & | ModeList,
|  | const SelectMgr_StateOfSelection | WantedState = `SelectMgr_SOS_Any`
| ) | const

Standard_EXPORT Standard_Boolean SelectMgr_ViewerSelector::More | ( |  | ) |

Standard_EXPORT Standard_Integer SelectMgr_ViewerSelector::NbBoxes | ( |  | ) | `[private]`

Standard_EXPORT Standard_Integer SelectMgr_ViewerSelector::NbPicked | ( |  | ) | const

void SelectMgr_ViewerSelector::Next | ( |  | ) | `[inline]`

Standard_EXPORT Handle_SelectMgr_EntityOwner SelectMgr_ViewerSelector::OnePicked | ( |  | ) |

Standard_EXPORT Handle_SelectMgr_EntityOwner SelectMgr_ViewerSelector::Picked | ( | const Standard_Integer | aRank | ) | const

Standard_EXPORT Handle_SelectMgr_EntityOwner SelectMgr_ViewerSelector::Picked | ( |  | ) | const

Standard_EXPORT Handle_SelectBasics_SensitiveEntity SelectMgr_ViewerSelector::Primitive | ( | const Standard_Integer | Rank | ) | const

const SelectMgr_DataMapOfIntegerSensitive & SelectMgr_ViewerSelector::Primitives | ( |  | ) | const`[inline]`

Standard_EXPORT void SelectMgr_ViewerSelector::Remove | ( | const Handle(SelectMgr_Selection)& | aSelection | ) | `[private]`

Standard_EXPORT void SelectMgr_ViewerSelector::SetClipping | ( | const Bnd_Box2d & | aRectangle | ) |

Standard_EXPORT void SelectMgr_ViewerSelector::SetClipping | ( | const Standard_Real | Xc,
|  | const Standard_Real | Yc,
|  | const Standard_Real | Height,
|  | const Standard_Real | Width
| ) |

Standard_EXPORT void SelectMgr_ViewerSelector::SetSensitivity | ( | const Standard_Real | aTol | ) |

Standard_EXPORT void SelectMgr_ViewerSelector::SetUpdateSortPossible | ( | const Standard_Boolean | possible | ) |

Standard_EXPORT void SelectMgr_ViewerSelector::Sleep | ( | const Handle(SelectMgr_SelectableObject)& | anObject | ) | `[private]`

Standard_EXPORT void SelectMgr_ViewerSelector::Sleep | ( |  | ) | `[private]`

virtual Standard_EXPORT void SelectMgr_ViewerSelector::SortResult | ( |  | ) | `[virtual]`

Standard_EXPORT TCollection_AsciiString SelectMgr_ViewerSelector::Status | ( |  | ) | const

Standard_EXPORT TCollection_AsciiString SelectMgr_ViewerSelector::Status | ( | const Handle(SelectMgr_SelectableObject)& | aSelectableObject | ) | const

Standard_EXPORT SelectMgr_StateOfSelection SelectMgr_ViewerSelector::Status | ( | const Handle(SelectMgr_Selection)& | aSelection | ) | const

Standard_EXPORT void SelectMgr_ViewerSelector::UpdateConversion | ( |  | ) |

Standard_EXPORT void SelectMgr_ViewerSelector::UpdateSort | ( |  | ) |

## Field Documentation

Standard_Real SelectMgr_ViewerSelector::lastx `[private]`

Standard_Real SelectMgr_ViewerSelector::lasty `[private]`

Standard_Integer SelectMgr_ViewerSelector::myactivenb `[private]`

Bnd_Box2d SelectMgr_ViewerSelector::myclip `[protected]`

Standard_Integer SelectMgr_ViewerSelector::myCurRank `[private]`

SelectMgr_DataMapOfIntegerSensitive SelectMgr_ViewerSelector::myentities `[protected]`

Handle_TColStd_HArray1OfInteger SelectMgr_ViewerSelector::myIndexes `[private]`

TColStd_SequenceOfInteger SelectMgr_ViewerSelector::myprim `[private]`

SelectMgr_DataMapOfSelectionActivation SelectMgr_ViewerSelector::myselections `[protected]`

SelectBasics_SortAlgo SelectMgr_ViewerSelector::myselector `[protected]`

SelectMgr_IndexedDataMapOfOwnerCriterion SelectMgr_ViewerSelector::mystored `[protected]`

Standard_Real SelectMgr_ViewerSelector::mytolerance `[protected]`

Standard_Boolean SelectMgr_ViewerSelector::myUpdateSortPossible `[private]`

Standard_Boolean SelectMgr_ViewerSelector::tosort `[protected]`

Standard_Boolean SelectMgr_ViewerSelector::toupdate `[protected]`

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

- SelectMgr_ViewerSelector.hxx
- SelectMgr_ViewerSelector.lxx