SHAPER  9.12.0
ModuleBase_ISelection Class Referenceabstract

A class which provides access to selection. More...

Inheritance diagram for ModuleBase_ISelection:
Inheritance graph

Public Types

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

Public Member Functions

virtual QList< std::shared_ptr< ModuleBase_ViewerPrs > > getSelected (const SelectionPlace &thePlace=Browser) const =0
 Returns a list of viewer selected presentations. More...
 
virtual QList< std::shared_ptr< ModuleBase_ViewerPrs > > getHighlighted () const =0
 Returns a list of viewer highlited presentations. More...
 
virtual void fillPresentation (std::shared_ptr< ModuleBase_ViewerPrs > &thePrs, const Handle &&theOwner) const =0
 Fills the viewer presentation parameters by the parameters from the owner. More...
 
virtual QObjectPtrList selectedObjects () const =0
 Returns list of features currently selected in object browser. More...
 
virtual QObjectPtrList selectedPresentations () const =0
 Returns list of currently selected results. More...
 
virtual QModelIndexList selectedIndexes () const =0
 Returns list of currently selected QModelIndexes. 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...
 
virtual HandleggetIO (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs)=0
 Return the IO 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

virtual ObjectPtr getSelectableObject (const Handle &&theOwner) const =0
 Returns list of currently selected QModelIndexes. More...
 

Detailed Description

A class which provides access to selection.

A selection can be obtained as from a viewer as from Object browser in various forms

Member Enumeration Documentation

◆ SelectionPlace

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

Member Function Documentation

◆ getSelected()

virtual QList<std::shared_ptr<ModuleBase_ViewerPrs> > ModuleBase_ISelection::getSelected ( const SelectionPlace thePlace = Browser) const
pure virtual

Returns a list of viewer selected presentations.

Returns
list of presentations

Implemented in XGUI_Selection.

◆ appendSelected()

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

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

◆ getHighlighted()

virtual QList<std::shared_ptr<ModuleBase_ViewerPrs> > ModuleBase_ISelection::getHighlighted ( ) const
pure virtual

Returns a list of viewer highlited presentations.

Returns
list of presentations

Implemented in XGUI_Selection.

◆ fillPresentation()

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

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

Parameters
thePrsa container for selection
theOwnera selection owner

Implemented in XGUI_Selection.

◆ selectedObjects()

virtual QObjectPtrList ModuleBase_ISelection::selectedObjects ( ) const
pure virtual

Returns list of features currently selected in object browser.

Implemented in XGUI_Selection.

◆ selectedPresentations()

virtual QObjectPtrList ModuleBase_ISelection::selectedPresentations ( ) const
pure virtual

Returns list of currently selected results.

Implemented in XGUI_Selection.

◆ selectedIndexes()

virtual QModelIndexList ModuleBase_ISelection::selectedIndexes ( ) const
pure virtual

Returns list of currently selected QModelIndexes.

Implemented in XGUI_Selection.

◆ getResult()

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

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)

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

◆ HandleggetIO()

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

Return the IO from the viewer presentation.

Parameters
thePrsa selected object
Returns
an interactive object

Implemented in XGUI_Selection.

◆ getViewerPrs()

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

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)
static

Removes selection items where owners have equal vertices.

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

◆ getSelectableObject()

virtual ObjectPtr ModuleBase_ISelection::getSelectableObject ( const Handle &&  theOwner) const
protectedpure virtual

Returns list of currently selected QModelIndexes.

Implemented in XGUI_Selection.