SHAPER  9.12.0
XGUI_Selection Class Reference

Implementation of ModuleBase_ISelection interface. More...

Inheritance diagram for XGUI_Selection:
Inheritance graph

Public Types

enum  SelectionPlace { Browser , Viewer , AllControls }
 Types of the selection place, where the selection is obtained. More...
 

Public Member Functions

 XGUI_Selection (XGUI_Workshop *theWorkshop)
 Constructor. More...
 
virtual QList< std::shared_ptr< ModuleBase_ViewerPrs > > getSelected (const SelectionPlace &thePlace=Browser) const
 Returns a list of viewer selected presentations. More...
 
virtual void fillPresentation (std::shared_ptr< ModuleBase_ViewerPrs > &thePrs, const Handle &&theOwner) const
 Fills the viewer presentation parameters by the parameters from the owner. More...
 
virtual QList< std::shared_ptr< ModuleBase_ViewerPrs > > getHighlighted () const
 Returns a list of viewer highlited presentations. More...
 
virtual QObjectPtrList selectedObjects () const
 Returns list of currently selected objects in object browser. More...
 
virtual QObjectPtrList selectedPresentations () const
 Returns list of currently selected results. More...
 
virtual QModelIndexList selectedIndexes () const
 Returns list of currently selected QModelIndexes. More...
 
void selectedOwners (SelectMgr_IndexedMapOfOwner &theSelectedOwners) const
 Returns list of currently selected owners. More...
 
void entityOwners (const Handle &&theObject, SelectMgr_IndexedMapOfOwner &theOwners) const
 Returns a list of selection entity owners of the interactive object It depends on the modes, in which the object is activated in the context. More...
 
virtual HandleggetIO (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs)
 Return the IO from the viewer presentation. More...
 
ResultPtr getResult (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs)
 Return the shape from the viewer presentation. More...
 
GeomShapePtr getShape (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs)
 Return the shape from the viewer presentation. More...
 

Static Public Member Functions

static void appendSelected (const QList< std::shared_ptr< ModuleBase_ViewerPrs >> theValues, QList< std::shared_ptr< ModuleBase_ViewerPrs >> &theValuesTo)
 The values are appended to the first parameter list if the first list does not contain an item with the same object. More...
 
static QList< std::shared_ptr< ModuleBase_ViewerPrs > > getViewerPrs (const QObjectPtrList &theObjects)
 Wraps the object list into the viewer prs list. More...
 
static void filterSelectionOnEqualPoints (QList< std::shared_ptr< ModuleBase_ViewerPrs >> &theSelected)
 Removes selection items where owners have equal vertices. More...
 

Protected Member Functions

ObjectPtr getSelectableObject (const Handle &&theOwner) const
 Return a selectable object by the entity owner. More...
 
void getSelectedInViewer (QList< std::shared_ptr< ModuleBase_ViewerPrs >> &thePresentations) const
 Fills the list of presentations by objects selected in the viewer. More...
 
void getSelectedInBrowser (QList< std::shared_ptr< ModuleBase_ViewerPrs >> &thePresentations) const
 Fills the list of presentations by objects selected in the object browser. More...
 

Detailed Description

Implementation of ModuleBase_ISelection interface.

Member Enumeration Documentation

◆ SelectionPlace

Types of the selection place, where the selection is obtained.

Constructor & Destructor Documentation

◆ XGUI_Selection()

XGUI_Selection::XGUI_Selection ( XGUI_Workshop theWorkshop)

Constructor.

Parameters
theWorkshopreference to workshop instance

Member Function Documentation

◆ getSelected()

QList< ModuleBase_ViewerPrsPtr > XGUI_Selection::getSelected ( const SelectionPlace thePlace = Browser) const
virtual

Returns a list of viewer selected presentations.

Returns
list of presentations

Implements ModuleBase_ISelection.

◆ fillPresentation()

void XGUI_Selection::fillPresentation ( std::shared_ptr< ModuleBase_ViewerPrs > &  thePrs,
const Handle &&  theOwner 
) const
virtual

Fills the viewer presentation parameters by the parameters from the owner.

Parameters
thePrsa container for selection
theOwnera selection owner

find axis direction

Implements ModuleBase_ISelection.

◆ getHighlighted()

QList< ModuleBase_ViewerPrsPtr > XGUI_Selection::getHighlighted ( ) const
virtual

Returns a list of viewer highlited presentations.

Returns
list of presentations

Implements ModuleBase_ISelection.

◆ selectedObjects()

QObjectPtrList XGUI_Selection::selectedObjects ( ) const
virtual

Returns list of currently selected objects in object browser.

Implements ModuleBase_ISelection.

◆ selectedPresentations()

QObjectPtrList XGUI_Selection::selectedPresentations ( ) const
virtual

Returns list of currently selected results.

Implements ModuleBase_ISelection.

◆ selectedIndexes()

QModelIndexList XGUI_Selection::selectedIndexes ( ) const
virtual

Returns list of currently selected QModelIndexes.

Implements ModuleBase_ISelection.

◆ selectedOwners()

void XGUI_Selection::selectedOwners ( SelectMgr_IndexedMapOfOwner &  theSelectedOwners) const

Returns list of currently selected owners.

Returns
list of owners

◆ entityOwners()

void XGUI_Selection::entityOwners ( const Handle &&  theObject,
SelectMgr_IndexedMapOfOwner &  theOwners 
) const

Returns a list of selection entity owners of the interactive object It depends on the modes, in which the object is activated in the context.

Parameters
theObjectan object
theOwnersa map of entity owners

◆ HandleggetIO()

virtual XGUI_Selection::HandleggetIO ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePrs)
virtual

Return the IO from the viewer presentation.

Parameters
thePrsa selected object
Returns
an interactive object

Implements ModuleBase_ISelection.

◆ getSelectableObject()

ObjectPtr XGUI_Selection::getSelectableObject ( const Handle &&  theOwner) const
protectedvirtual

Return a selectable object by the entity owner.

It founds AIS object in the viewer and returns the corresponded object

Parameters
theOwneran entity owner
Returns
a found object or NULL

Implements ModuleBase_ISelection.

◆ getSelectedInViewer()

void XGUI_Selection::getSelectedInViewer ( QList< std::shared_ptr< ModuleBase_ViewerPrs >> &  thePresentations) const
protected

Fills the list of presentations by objects selected in the viewer.

Parameters
thePresentationsan output list of presentation

◆ getSelectedInBrowser()

void XGUI_Selection::getSelectedInBrowser ( QList< std::shared_ptr< ModuleBase_ViewerPrs >> &  thePresentations) const
protected

Fills the list of presentations by objects selected in the object browser.

ViewerPrs contains only object parameter not empty. If the given list of presentations already has a viewer presentation with the same object as selected in the browser, a new item is not appended to the list of presentations.

Parameters
thePresentationsan output list of presentation

◆ appendSelected()

void ModuleBase_ISelection::appendSelected ( const QList< std::shared_ptr< ModuleBase_ViewerPrs >>  theValues,
QList< std::shared_ptr< ModuleBase_ViewerPrs >> &  theValuesTo 
)
staticinherited

The values are appended to the first parameter list if the first list does not contain an item with the same object.

Parameters
theValuesa list of new values
theValuesToa list, that will be changed

◆ getResult()

ResultPtr ModuleBase_ISelection::getResult ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePrs)
inherited

Return the shape from the viewer presentation.

If the shape is equal to the shape of selected object, it returns an empty shape

Parameters
thePrsa selected object
Returns
a shape

◆ getShape()

GeomShapePtr ModuleBase_ISelection::getShape ( const std::shared_ptr< ModuleBase_ViewerPrs > &  thePrs)
inherited

Return the shape from the viewer presentation.

If the shape is equal to the shape of selected object, it returns an empty shape

Parameters
thePrsa selected object
Returns
a shape

◆ getViewerPrs()

QList< ModuleBase_ViewerPrsPtr > ModuleBase_ISelection::getViewerPrs ( const QObjectPtrList &  theObjects)
staticinherited

Wraps the object list into the viewer prs list.

Parameters
theObjectsa list of objects
Returns
a list of prs, where only object is not empty

◆ filterSelectionOnEqualPoints()

void ModuleBase_ISelection::filterSelectionOnEqualPoints ( QList< std::shared_ptr< ModuleBase_ViewerPrs >> &  theSelected)
staticinherited

Removes selection items where owners have equal vertices.

The first owner with the qual vertex stays in the list.