Version: 9.15.0
LightApp_Module Class Reference

#include <LightApp_Module.h>

Inheritance diagram for LightApp_Module:
Inheritance graph

Public Slots

virtual bool activateModule (SUIT_Study *)
 
virtual bool deactivateModule (SUIT_Study *)
 
virtual void studyClosed (SUIT_Study *)
 
virtual void onObjectClicked (SUIT_DataObject *, int)
 Virtual public slot. More...
 
void onOBDestroyed ()
 
void MenuItem ()
 
virtual void updateInfoPanel ()
 
- Public Slots inherited from CAM_Module
virtual bool activateModule (SUIT_Study *)
 Activate module. More...
 
virtual bool deactivateModule (SUIT_Study *)
 Deactivate module. More...
 
virtual void connectToStudy (CAM_Study *)
 Connect data model of the module to the active study. More...
 
virtual void studyClosed (SUIT_Study *)
 Called when study is closed. More...
 
virtual void studyChanged (SUIT_Study *, SUIT_Study *)
 Called when study is changed (obsolete). More...
 
virtual void onApplicationClosed (SUIT_Application *)
 Called when application is closed. More...
 
virtual void moduleActionActivated ()
 Called when an action is triggered. More...
 

Public Member Functions

 LightApp_Module (const QString &)
 
virtual ~LightApp_Module ()
 
virtual void initialize (CAM_Application *)
 
virtual void windows (QMap< int, int > &) const
 
virtual void viewManagers (QStringList &) const
 
virtual void contextMenuPopup (const QString &, QMenu *, QString &)
 
virtual void createPreferences ()
 
LightApp_ApplicationgetApp () const
 
virtual void update (const int)
 Update something in accordance with update flags. More...
 
virtual void updateObjBrowser (bool=true, SUIT_DataObject *=0)
 
virtual void selectionChanged ()
 
virtual void preferencesChanged (const QString &, const QString &)
 
virtual void message (const QString &)
 
virtual void studyActivated ()
 
virtual LightApp_Displayerdisplayer ()
 
virtual LightApp_SelectioncreateSelection () const
 
virtual bool canCopy () const
 
virtual bool canPaste () const
 
virtual bool isDraggable (const SUIT_DataObject *) const
 
virtual bool isDropAccepted (const SUIT_DataObject *) const
 
virtual void dropObjects (const DataObjectList &, SUIT_DataObject *, const int, Qt::DropAction)
 
virtual void copy ()
 Copies the current selection into clipboard. More...
 
virtual void paste ()
 Pastes the current data in the clipboard. More...
 
virtual bool renameAllowed (const QString &) const
 Return true if object can be renamed. More...
 
virtual bool renameObject (const QString &, const QString &)
 Return true if rename operation finished successfully, false otherwise. More...
 
virtual void updateModuleVisibilityState ()
 
- Public Member Functions inherited from CAM_Module
 CAM_Module ()
 Default constructor. More...
 
 CAM_Module (const QString &)
 Constructor. More...
 
virtual ~CAM_Module ()
 Destructor. More...
 
QString name () const
 Get module (internal) name. More...
 
QString moduleName () const
 Get module title (user name) More...
 
virtual QPixmap moduleIcon () const
 Get module icon. More...
 
virtual QString iconName () const
 Get module icon's name. More...
 
CAM_DataModeldataModel () const
 Get data model. More...
 
CAM_Applicationapplication () const
 Get application. More...
 
virtual void updateCommandsStatus ()
 Update menu/toolbar actions. More...
 
virtual void putInfo (const QString &, const int=-1)
 Put the text message into the status bar of the application main window. More...
 
int showNotification (const QString &message, const QString &title, int timeout=-1)
 Shows the notifications with spectified text, title and automatic close timeout. Notification will be automatically closed after specified timeout in msec. If timeout is zero then automatic closing doesn't performed. More...
 
void hideNotification (const QString &message)
 Closes the notifications with spectified text. More...
 
void hideNotification (int id)
 Closes the notifications with spectified identifier. More...
 
bool isActiveModule () const
 Check if the module is active. More...
 
virtual void setMenuShown (const bool)
 Show/hide all module's menus. More...
 
void setMenuShown (QAction *, const bool)
 Show/hide specified menu item. More...
 
void setMenuShown (const int, const bool)
 Show/hide specified menu item. More...
 
virtual void setToolShown (const bool)
 Show/hide all module's toolbars. More...
 
void setToolShown (QAction *, const bool)
 Show/hide specified toolbar item. More...
 
void setToolShown (const int, const bool)
 Show/hide specified toolbar item. More...
 
virtual bool activateOperation (int actionId)
 Activate GUI operation of module by its ID. This method is called from CAM_Application::startOperation(). More...
 
virtual bool activateOperation (const QString &actionId)
 Activate GUI operation of module by its ID. This method is called from CAM_Application::startOperation(). More...
 
virtual bool activateOperation (const QString &actionId, const QString &pluginName)
 Activate GUI operation of module by its ID and pluginName. This method is called from CAM_Application::startOperation(). More...
 
QtxActionMenuMgrmenuMgr () const
 Get menu manager. More...
 
QtxActionToolMgrtoolMgr () const
 Get toolbar manager. More...
 
QString makeActionID (const QString &theInModuleActionID) const
 
virtual QActionaction (const int) const
 Get action by specified id. More...
 
virtual int actionId (const QAction *) const
 Get action ID. More...
 
virtual QActioncreateAction (const int, const QString &, const QIcon &, const QString &, const QString &, const int, QObject *=0, const bool=false, QObject *=0, const char *=0, const QString &=QString())
 Create new instance of QtxAction and register action with specified id. More...
 
virtual QActioncreateAction (const int, const QString &, const QIcon &, const QString &, const QString &, const QKeySequence &, QObject *=0, const bool=false, QObject *=0, const char *=0, const QString &=QString())
 Create new instance of QtxAction and register action with specified id. More...
 
QtxActionGroupcreateActionGroup (const int, const bool=true)
 Create new action group. More...
 
int createTool (const QString &, const QString &=QString())
 Create toolbar with speicifed name. More...
 
int createTool (const int, const int, const int=-1)
 Add toolbar item. More...
 
int createTool (const int, const QString &, const int=-1)
 Add toolbar item. More...
 
int createTool (QAction *, const int, const int=-1, const int=-1)
 Add toolbar item. More...
 
int createTool (QAction *, const QString &, const int=-1, const int=-1)
 Add toolbar item. More...
 
void clearTool (const QString &title)
 
int createMenu (const QString &, const int, const int=-1, const int=-1, const int=-1, QMenu *=0)
 Create menu or submenu. More...
 
int createMenu (const QString &, const QString &, const int=-1, const int=-1, const int=-1)
 Create menu or submenu. More...
 
int createMenu (const int, const int, const int=-1, const int=-1)
 Add menu item. More...
 
int createMenu (const int, const QString &, const int=-1, const int=-1)
 Add menu item. More...
 
int createMenu (QAction *, const int, const int=-1, const int=-1, const int=-1)
 Add menu item. More...
 
int createMenu (QAction *, const QString &, const int=-1, const int=-1, const int=-1)
 Add menu item. More...
 
virtual void logAction (QAction *)
 Log given action. More...
 
bool isActionLoggingEnabled () const
 Return true if action logging is enabled. More...
 
void setActionLoggingEnabled (bool)
 Enable / disable action logging. More...
 

Protected Slots

virtual void onModelSaved ()
 
virtual void onModelOpened ()
 
virtual void onModelClosed ()
 
virtual void onOperationStopped (SUIT_Operation *)
 Virtual protected slot called when operation stopped. More...
 
virtual void onOperationDestroyed ()
 Virtual protected slot called when operation destroyed. More...
 
virtual void onShowHide ()
 
virtual void onViewManagerAdded (SUIT_ViewManager *)
 
virtual void onViewManagerRemoved (SUIT_ViewManager *)
 

Protected Member Functions

virtual QtxPopupMgrpopupMgr ()
 
LightApp_Preferencespreferences () const
 
virtual CAM_DataModelcreateDataModel ()
 
virtual bool reusableOperation (const int id)
 
int addPreference (const QString &label)
 
int addPreference (const QString &label, const int pId, const int type=LightApp_Preferences::Auto, const QString &section=QString(), const QString &param=QString())
 
QVariant preferenceProperty (const int, const QString &) const
 
void setPreferenceProperty (const int, const QString &, const QVariant &)
 
void startOperation (const int)
 Starts operation with given identifier. More...
 
virtual LightApp_OperationcreateOperation (const int) const
 Creates operation with given identifier. More...
 
virtual void updateControls ()
 Updates controls. More...
 
virtual bool isSelectionCompatible ()
 If return false, selection will be cleared at module activation. More...
 
LightApp_Operationoperation (const int) const
 Returns instance of operation by its id; if there is no operation corresponding to this id, null pointer is returned. More...
 
- Protected Member Functions inherited from CAM_Module
void setName (const QString &)
 Set module (internal) name. More...
 
virtual void setModuleName (const QString &)
 Set module title (user name) More...
 
int registerAction (const int, QAction *)
 Register action in the internal action map. More...
 
bool unregisterAction (const int)
 Unregister action from the internal action map. More...
 
bool unregisterAction (QAction *)
 Unregister action from the internal action map. More...
 
virtual bool abortAllOperations ()
 

Protected Attributes

int myDisplay
 
int myErase
 
int myDisplayOnly
 
int myEraseAll
 
bool myIsFirstActivate
 
- Protected Attributes inherited from CAM_Module
QMap< QAction *, QKeySequence > myActionShortcutMap
 copy actions shortcut map More...
 

Private Types

typedef QMap< int, LightApp_Operation * > MapOfOperation
 

Private Attributes

QtxPopupMgrmyPopupMgr
 
MapOfOperation myOperations
 
LightApp_SwitchOpmySwitchOp
 

Additional Inherited Members

- Static Public Member Functions inherited from CAM_Module
static QActionseparator ()
 Create separator action. More...
 

Detailed Description

Base class for all light modules

Member Typedef Documentation

◆ MapOfOperation

Constructor & Destructor Documentation

◆ LightApp_Module()

LightApp_Module::LightApp_Module ( const QString &  name)

Constructor.

◆ ~LightApp_Module()

LightApp_Module::~LightApp_Module ( )
virtual

Destructor.

References mySwitchOp.

Member Function Documentation

◆ activateModule

◆ addPreference() [1/2]

int LightApp_Module::addPreference ( const QString &  label)
protected

Add preference to preferences.

References LightApp_Preferences::addPreference(), CAM_Module::moduleName(), and preferences().

◆ addPreference() [2/2]

int LightApp_Module::addPreference ( const QString &  label,
const int  pId,
const int  type = LightApp_Preferences::Auto,
const QString &  section = QString(),
const QString &  param = QString() 
)
protected

Add preference to preferences.

References LightApp_Preferences::addPreference(), CAM_Module::moduleName(), and preferences().

◆ canCopy()

bool LightApp_Module::canCopy ( ) const
virtual

virtual method

Returns
true if module can copy the current selection

◆ canPaste()

bool LightApp_Module::canPaste ( ) const
virtual

virtual method

Returns
true if module can paste previously copied data

◆ contextMenuPopup()

void LightApp_Module::contextMenuPopup ( const QString &  client,
QMenu menu,
QString &   
)
virtual

◆ copy()

void LightApp_Module::copy ( )
virtual

Copies the current selection into clipboard.

virtual method

◆ createDataModel()

CAM_DataModel * LightApp_Module::createDataModel ( )
protectedvirtual

Create new instance of data model and return it.

Reimplemented from CAM_Module.

Reimplemented in SalomeApp_Module, and SALOME_PYQT_ModuleLight.

◆ createOperation()

LightApp_Operation * LightApp_Module::createOperation ( const int  id) const
protectedvirtual

Creates operation with given identifier.

Create operation by its id. You must not call this method, it will be called automatically by startOperation. Please redefine this method in current module

Parameters
id- identifier of operation to be started
Returns
Pointer on created operation or NULL if operation is not created

Creates operation with given id. You should not call this method, it will be called automatically from startOperation. You may redefine this method in concrete module to create operations.

References LightApp_ShowHideOp::DISPLAY, LightApp_ShowHideOp::DISPLAY_ONLY, LightApp_ShowHideOp::ERASE, LightApp_ShowHideOp::ERASE_ALL, myDisplay, myDisplayOnly, myErase, and myEraseAll.

◆ createPreferences()

void LightApp_Module::createPreferences ( )
virtual

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

◆ createSelection()

LightApp_Selection * LightApp_Module::createSelection ( ) const
virtual

Create and return instance of LightApp_Selection.

Reimplemented in SalomeApp_Module.

◆ deactivateModule

◆ displayer()

LightApp_Displayer * LightApp_Module::displayer ( )
virtual

Must be redefined in order to use standard displayer mechanism

Returns
displayer of module

◆ dropObjects()

void LightApp_Module::dropObjects ( const DataObjectList ,
SUIT_DataObject ,
const int  ,
Qt::DropAction   
)
virtual

virtual method Complete drag-n-drop operation by processing objects what being dragged, dropped to the line row within the object where. The drop action being performed is specified by action.

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

◆ getApp()

LightApp_Application * LightApp_Module::getApp ( ) const

Gets application.

References CAM_Module::application().

◆ initialize()

void LightApp_Module::initialize ( CAM_Application app)
virtual

◆ isDraggable()

bool LightApp_Module::isDraggable ( const SUIT_DataObject ) const
virtual

virtual method

Returns
true if module allows dragging the given object

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

◆ isDropAccepted()

bool LightApp_Module::isDropAccepted ( const SUIT_DataObject ) const
virtual

virtual method

Returns
true if module allows dropping one or more objects (currently selected) on the object where

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

◆ isSelectionCompatible()

bool LightApp_Module::isSelectionCompatible ( )
protectedvirtual

◆ MenuItem

void LightApp_Module::MenuItem ( )
slot

NOT IMPLEMENTED

◆ message()

void LightApp_Module::message ( const QString &  )
virtual

NOT IMPLEMENTED

◆ onModelClosed

void LightApp_Module::onModelClosed ( )
protectedvirtualslot

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight.

◆ onModelOpened

void LightApp_Module::onModelOpened ( )
protectedvirtualslot

NOT IMPLEMENTED

◆ onModelSaved

void LightApp_Module::onModelSaved ( )
protectedvirtualslot

NOT IMPLEMENTED

◆ onOBDestroyed

void LightApp_Module::onOBDestroyed ( )
slot

References myIsFirstActivate.

◆ onObjectClicked

void LightApp_Module::onObjectClicked ( SUIT_DataObject theObject,
int  theColumn 
)
virtualslot

Virtual public slot.

This method is called after the object inserted into data view to update their visibility state This is default implementation

References SUIT_Session::activeApplication(), SUIT_Application::activeStudy(), LightApp_DataObject::entry(), Qtx::HiddenState, CAM_Module::isActiveModule(), myDisplay, myErase, SUIT_Session::session(), Qtx::ShownState, startOperation(), SUIT_DataObject::VisibilityId, and LightApp_Study::visibilityState().

◆ onOperationDestroyed

void LightApp_Module::onOperationDestroyed ( )
protectedvirtualslot

Virtual protected slot called when operation destroyed.

Parameters
theOp- destroyed operation

Virtual protected slot called when operation destroyed. Redefine this slot if you want to perform actions after destroying operation. Base implementation removes pointer on destroyed operation from the map of operations

References myOperations.

◆ onOperationStopped

void LightApp_Module::onOperationStopped ( SUIT_Operation )
protectedvirtualslot

Virtual protected slot called when operation stopped.

Parameters
theOp- stopped operation

Virtual protected slot called when operation stopped. Redefine this slot if you want to perform actions after stopping operation

◆ onShowHide

void LightApp_Module::onShowHide ( )
protectedvirtualslot

SLOT: called on activating of standard operations show/hide

References CAM_Module::actionId(), popupMgr(), and startOperation().

◆ onViewManagerAdded

void LightApp_Module::onViewManagerAdded ( SUIT_ViewManager )
protectedvirtualslot

virtual SLOT: called on view manager adding

◆ onViewManagerRemoved

void LightApp_Module::onViewManagerRemoved ( SUIT_ViewManager )
protectedvirtualslot

virtual SLOT: called on view manager removing

◆ operation()

LightApp_Operation * LightApp_Module::operation ( const int  id) const
protected

Returns instance of operation by its id; if there is no operation corresponding to this id, null pointer is returned.

Parameters
id- operation id
Returns
operation instance

References myOperations.

◆ paste()

void LightApp_Module::paste ( )
virtual

Pastes the current data in the clipboard.

virtual method

◆ popupMgr()

◆ preferenceProperty()

QVariant LightApp_Module::preferenceProperty ( const int  id,
const QString &  prop 
) const
protected

Gets property of preferences.

References SUIT_PreferenceMgr::itemProperty(), and preferences().

◆ preferences()

LightApp_Preferences * LightApp_Module::preferences ( ) const
protected

Gets preferences.

References getApp(), and LightApp_Application::preferences().

◆ preferencesChanged()

void LightApp_Module::preferencesChanged ( const QString &  ,
const QString &   
)
virtual

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

◆ renameAllowed()

bool LightApp_Module::renameAllowed ( const QString &  ) const
virtual

Return true if object can be renamed.

◆ renameObject()

bool LightApp_Module::renameObject ( const QString &  ,
const QString &   
)
virtual

Return true if rename operation finished successfully, false otherwise.

Rename object by entry.

Parameters
entryentry of the object
namenew name of the object

◆ reusableOperation()

bool LightApp_Module::reusableOperation ( const int  id)
protectedvirtual

virtual method called to manage the same operations

◆ selectionChanged()

void LightApp_Module::selectionChanged ( )
virtual

NOT IMPLEMENTED

◆ setPreferenceProperty()

void LightApp_Module::setPreferenceProperty ( const int  id,
const QString &  prop,
const QVariant &  var 
)
protected

Set property of preferences.

References preferences(), and SUIT_PreferenceMgr::setItemProperty().

◆ startOperation()

void LightApp_Module::startOperation ( const int  id)
protected

Starts operation with given identifier.

Module stores operations in map. This method starts operation by id. If operation isn't in map, then it will be created by createOperation method and will be inserted to map

Parameters
id- identifier of operation to be started

Module stores operations in map. This method starts operation by id. If operation isn't in map, then it will be created by createOperation method and will be inserted to map

References CAM_Module::application(), createOperation(), myOperations, onOperationDestroyed(), onOperationStopped(), reusableOperation(), LightApp_Operation::setModule(), SUIT_Operation::setStudy(), and SUIT_Operation::start().

◆ studyActivated()

virtual void LightApp_Module::studyActivated ( )
inlinevirtual

◆ studyClosed

void LightApp_Module::studyClosed ( SUIT_Study theStudy)
virtualslot

Redefined to reset internal flags valid for study instance

Reimplemented in SALOME_PYQT_Module.

References CAM_Module::application(), OB_Browser::model(), myIsFirstActivate, LightApp_Application::objectBrowser(), onObjectClicked(), and CAM_Module::studyClosed().

◆ update()

void LightApp_Module::update ( const int  theFlags)
virtual

Update something in accordance with update flags.

Parameters
theFlags- update flags

Update viewer or/and object browser etc. in accordance with update flags ( see LightApp_UpdateFlags enumeration ). Derived modules can redefine this method for their own purposes

References CAM_Module::dataModel(), getApp(), LightApp_Application::objectBrowser(), UF_Controls, UF_Model, UF_ObjBrowser, UF_Viewer, updateControls(), and SUIT_DataBrowser::updateTree().

◆ updateControls()

void LightApp_Module::updateControls ( )
protectedvirtual

Updates controls.

Updates (i.e. disable/enable) controls states (menus, tool bars etc.). This method is called from update( UF_Controls ). You may redefine it in concrete module.

◆ updateInfoPanel

void LightApp_Module::updateInfoPanel ( )
virtualslot

NOT IMPLEMENTED

◆ updateModuleVisibilityState()

◆ updateObjBrowser()

void LightApp_Module::updateObjBrowser ( bool  theIsUpdateDataModel = true,
SUIT_DataObject theDataObject = 0 
)
virtual

◆ viewManagers()

void LightApp_Module::viewManagers ( QStringList &  ) const
virtual

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

◆ windows()

void LightApp_Module::windows ( QMap< int, int > &  ) const
virtual

NOT IMPLEMENTED

Reimplemented in StandardApp_Module, SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

Member Data Documentation

◆ myDisplay

int LightApp_Module::myDisplay
protected

◆ myDisplayOnly

int LightApp_Module::myDisplayOnly
protected

◆ myErase

int LightApp_Module::myErase
protected

◆ myEraseAll

int LightApp_Module::myEraseAll
protected

◆ myIsFirstActivate

bool LightApp_Module::myIsFirstActivate
protected

◆ myOperations

MapOfOperation LightApp_Module::myOperations
private

◆ myPopupMgr

QtxPopupMgr* LightApp_Module::myPopupMgr
private

◆ mySwitchOp

LightApp_SwitchOp* LightApp_Module::mySwitchOp
private

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