SHAPER  9.12.0
XGUI_SelectionActivate Class Reference

A class which implements activation/deactivate selection modes and using selection filters. More...

Inheritance diagram for XGUI_SelectionActivate:
Inheritance graph

Public Types

enum  SelectionPlace { Workshop , PropertyPanel , FacesPanel }
 Types of the activation place. More...
 

Public Member Functions

 XGUI_SelectionActivate (ModuleBase_IWorkshop *theWorkshop)
 Constructor. More...
 
 ~XGUI_SelectionActivate ()
 Destructor. More...
 
SelectionPlace activeSelectionPlace () const
 Returns place of activation modes that now is active. More...
 
virtual void updateSelectionModes ()
 Updates active selection modes in the viewer depending on the application state. More...
 
virtual void updateSelectionFilters ()
 Updates active selection filters in the viewer depending on the application state. More...
 
virtual void activateSelectionFilters (const SelectMgr_ListOfFilter &theSelectionFilters)
 Activates parameter filters in the workshop, deactivate active out of the container Please find a possibility to use updateSelectionFilters instead of direct call this method. More...
 
QIntList activeSelectionModes () const
 Returns list of currently active selection modes Selection modes will be returned according to TopAbs_ShapeEnum. More...
 
bool isActive (ObjectPtr theObject) const
 Returns true if the given object can be selected. More...
 
void activateObjects (const QIntList &theModes, const QObjectPtrList &theObjList, const bool theUpdateViewer=true)
 Activates in local context displayed outside of the context. More...
 
void setSelectionModes (const QIntList &theModes)
 Fill container of current selection modes. More...
 
void activateOnDisplay (const Handle &&theIO, const bool theUpdateViewer)
 Activate object in the selection modes. More...
 
void activateAIS (const Handle &&theIO, const int theMode, const bool theUpdateViewer) const
 Activate interactive object. More...
 
void deactivateAIS (const Handle &&theIO, const int theMode=-1) const
 Activate interactive object. More...
 
bool activate (const Handle &&theIO, const bool theUpdateViewer) const
 Activates the interactive object in the local context. More...
 
void deactivate (const std::shared_ptr< ModelAPI_Object > &theObject, const bool theUpdateViewer)
 Deactivates the given object (not allow selection) More...
 
bool isTrihedronActive () const
 Returns true if the trihedron should be activated in current selection modes. More...
 
void activateTrihedron (bool theIsActive)
 Set trihedron active (used in selection) or non active. More...
 
void deactivateTrihedron (const bool theUpdateViewer) const
 Find a trihedron in a list of displayed presentations and deactivate it. More...
 
void deactivateTrihedronInSelectionModes ()
 Get selection modes of trihedron and deactivate it in it. More...
 

Protected Member Functions

void getSelectionModes (ModuleBase_ModelWidget *theWidget, QIntList &theModes)
 Returns selection modes of the widget. More...
 
 HandleggetTrihedron () const
 Returns Trihedron object if it is displayed. More...
 
 HandleAAISContext () const
 Returns context of the 3D viewer. More...
 
XGUI_DisplayergetDisplayer () const
 Returns displayer. More...
 
AISObjectPtr getDisplayedAISObject (std::shared_ptr< ModelAPI_Object > theObject) const
 Returns AIS object displayed in 3D viewer for the given model object. More...
 

Static Protected Member Functions

static int getSelectionMode (int theShapeType)
 Converts shape type (TopAbs_ShapeEnum) to selection mode. More...
 

Protected Attributes

QIntList myActiveSelectionModes
 Current activated selection modes. More...
 
bool myIsTrihedronActive
 Flag: use trihedgon for selection or not. More...
 
ModuleBase_IWorkshopmyWorkshop
 active workshop More...
 

Detailed Description

A class which implements activation/deactivate selection modes and using selection filters.

Member Enumeration Documentation

◆ SelectionPlace

Types of the activation place.

Constructor & Destructor Documentation

◆ XGUI_SelectionActivate()

XGUI_SelectionActivate::XGUI_SelectionActivate ( ModuleBase_IWorkshop theWorkshop)

Constructor.

◆ ~XGUI_SelectionActivate()

XGUI_SelectionActivate::~XGUI_SelectionActivate ( )
inline

Destructor.

Member Function Documentation

◆ activeSelectionPlace()

XGUI_SelectionActivate::SelectionPlace XGUI_SelectionActivate::activeSelectionPlace ( ) const

Returns place of activation modes that now is active.

Returns
place

◆ updateSelectionModes()

void XGUI_SelectionActivate::updateSelectionModes ( )
virtual

Updates active selection modes in the viewer depending on the application state.

Implements ModuleBase_ISelectionActivate.

◆ updateSelectionFilters()

void XGUI_SelectionActivate::updateSelectionFilters ( )
virtual

Updates active selection filters in the viewer depending on the application state.

Implements ModuleBase_ISelectionActivate.

◆ activateSelectionFilters()

void XGUI_SelectionActivate::activateSelectionFilters ( const SelectMgr_ListOfFilter &  theSelectionFilters)
virtual

Activates parameter filters in the workshop, deactivate active out of the container Please find a possibility to use updateSelectionFilters instead of direct call this method.

Parameters
theSelectionFiltersa filtes

Implements ModuleBase_ISelectionActivate.

◆ activeSelectionModes()

QIntList XGUI_SelectionActivate::activeSelectionModes ( ) const

Returns list of currently active selection modes Selection modes will be returned according to TopAbs_ShapeEnum.

◆ isActive()

bool XGUI_SelectionActivate::isActive ( ObjectPtr  theObject) const

Returns true if the given object can be selected.

Parameters
theObjectobject to check

◆ activateObjects()

void XGUI_SelectionActivate::activateObjects ( const QIntList &  theModes,
const QObjectPtrList &  theObjList,
const bool  theUpdateViewer = true 
)

Activates in local context displayed outside of the context.

Parameters
theModes- modes on which it has to be activated (can be empty)
theObjList- list of objects which has to be activated.
theUpdateVieweran update viewer flag

◆ setSelectionModes()

void XGUI_SelectionActivate::setSelectionModes ( const QIntList &  theModes)

Fill container of current selection modes.

Parameters
theModesselection modes

◆ activateOnDisplay()

void XGUI_SelectionActivate::activateOnDisplay ( const Handle &&  theIO,
const bool  theUpdateViewer 
)

Activate object in the selection modes.

Parameters
theIOan object
theUpdateVieweran update viewer flag

◆ activateAIS()

void XGUI_SelectionActivate::activateAIS ( const Handle &&  theIO,
const int  theMode,
const bool  theUpdateViewer 
) const

Activate interactive object.

Parameters
theIOan interactive object
theModeactivation mode
theUpdateViewerupdate viewer flag

◆ deactivateAIS()

void XGUI_SelectionActivate::deactivateAIS ( const Handle &&  theIO,
const int  theMode = -1 
) const

Activate interactive object.

It is necessary to call ClearOutdatedSelection after deactivation

Parameters
theIOan interactive object
theModea mode to deactivate. When theMode=-1 then all modes will be deactivated

◆ activate()

bool XGUI_SelectionActivate::activate ( const Handle &&  theIO,
const bool  theUpdateViewer 
) const

Activates the interactive object in the local context.

Parameters
theIOan interactive object
theUpdateViewerthe parameter whether the viewer should be update immediatelly
Returns
a flag is object activated or not

◆ deactivate()

void XGUI_SelectionActivate::deactivate ( const std::shared_ptr< ModelAPI_Object > &  theObject,
const bool  theUpdateViewer 
)

Deactivates the given object (not allow selection)

Parameters
theObjectobject to deactivate
theUpdateViewerthe parameter whether the viewer should be update immediatelly

◆ isTrihedronActive()

bool XGUI_SelectionActivate::isTrihedronActive ( ) const
inline

Returns true if the trihedron should be activated in current selection modes.

◆ activateTrihedron()

void XGUI_SelectionActivate::activateTrihedron ( bool  theIsActive)

Set trihedron active (used in selection) or non active.

#1136 hidden axis are selected in sketch

◆ deactivateTrihedron()

void XGUI_SelectionActivate::deactivateTrihedron ( const bool  theUpdateViewer) const

Find a trihedron in a list of displayed presentations and deactivate it.

Parameters
theUpdateViewerthe parameter whether the viewer should be update immediatelly

#1136 hidden axis are selected in sketch

◆ deactivateTrihedronInSelectionModes()

void XGUI_SelectionActivate::deactivateTrihedronInSelectionModes ( )

Get selection modes of trihedron and deactivate it in it.

deactivate trihedron in selection modes

◆ getSelectionModes()

void XGUI_SelectionActivate::getSelectionModes ( ModuleBase_ModelWidget theWidget,
QIntList &  theModes 
)
protected

Returns selection modes of the widget.

Parameters
theWidgetmodel widget
theModesselection modes

◆ HandleggetTrihedron()

XGUI_SelectionActivate::HandleggetTrihedron ( ) const
protected

Returns Trihedron object if it is displayed.

◆ HandleAAISContext()

XGUI_SelectionActivate::HandleAAISContext ( ) const
protected

Returns context of the 3D viewer.

Returns
context instance

◆ getDisplayer()

XGUI_Displayer * XGUI_SelectionActivate::getDisplayer ( ) const
protected

Returns displayer.

Returns
displayer

◆ getDisplayedAISObject()

AISObjectPtr XGUI_SelectionActivate::getDisplayedAISObject ( std::shared_ptr< ModelAPI_Object theObject) const
protected

Returns AIS object displayed in 3D viewer for the given model object.

Parameters
theObjectsource object
Returns
interactive object

◆ getSelectionMode()

int XGUI_SelectionActivate::getSelectionMode ( int  theShapeType)
staticprotected

Converts shape type (TopAbs_ShapeEnum) to selection mode.

Parameters
theShapeTypea shape type from TopAbs_ShapeEnum

Field Documentation

◆ myActiveSelectionModes

QIntList XGUI_SelectionActivate::myActiveSelectionModes
protected

Current activated selection modes.

◆ myIsTrihedronActive

bool XGUI_SelectionActivate::myIsTrihedronActive
protected

Flag: use trihedgon for selection or not.

◆ myWorkshop

ModuleBase_IWorkshop* ModuleBase_ISelectionActivate::myWorkshop
protectedinherited

active workshop