Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- 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...
 

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

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

Constructor & Destructor Documentation

LightApp_Module::LightApp_Module ( const QString &  name)

Constructor.

LightApp_Module::~LightApp_Module ( )
virtual

Destructor.

References mySwitchOp.

Member Function Documentation

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

Add preference to preferences.

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

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().

bool LightApp_Module::canCopy ( ) const
virtual

virtual method

Returns
true if module can copy the current selection
bool LightApp_Module::canPaste ( ) const
virtual

virtual method

Returns
true if module can paste previously copied data
void LightApp_Module::contextMenuPopup ( const QString &  client,
QMenu menu,
QString &   
)
virtual
void LightApp_Module::copy ( )
virtual

virtual method

CAM_DataModel * LightApp_Module::createDataModel ( )
protectedvirtual

Create new instance of data model and return it.

Reimplemented from CAM_Module.

Reimplemented in SALOME_PYQT_ModuleLight, and SalomeApp_Module.

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

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.

void LightApp_Module::createPreferences ( )
virtual

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

LightApp_Selection * LightApp_Module::createSelection ( ) const
virtual

Create and return instance of LightApp_Selection.

Reimplemented in SalomeApp_Module.

LightApp_Displayer * LightApp_Module::displayer ( )
virtual

Must be redefined in order to use standard displayer mechanism

Returns
displayer of module
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.

LightApp_Application * LightApp_Module::getApp ( ) const

Gets application.

References CAM_Module::application().

void LightApp_Module::initialize ( CAM_Application app)
virtual
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.

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.

void LightApp_Module::MenuItem ( )
slot

NOT IMPLEMENTED

void LightApp_Module::message ( const QString &  )
virtual

NOT IMPLEMENTED

void LightApp_Module::onModelClosed ( )
protectedvirtualslot

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight.

void LightApp_Module::onModelOpened ( )
protectedvirtualslot

NOT IMPLEMENTED

void LightApp_Module::onModelSaved ( )
protectedvirtualslot

NOT IMPLEMENTED

void LightApp_Module::onOBDestroyed ( )
slot

References myIsFirstActivate.

void LightApp_Module::onObjectClicked ( SUIT_DataObject theObject,
int  theColumn 
)
virtualslot
void LightApp_Module::onOperationDestroyed ( )
protectedvirtualslot
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, and s.

void LightApp_Module::onOperationStopped ( SUIT_Operation )
protectedvirtualslot
Parameters
theOp- stopped operation

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

void LightApp_Module::onShowHide ( )
protectedvirtualslot

SLOT: called on activating of standard operations show/hide

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

void LightApp_Module::onViewManagerAdded ( SUIT_ViewManager )
protectedvirtualslot

virtual SLOT: called on view manager adding

void LightApp_Module::onViewManagerRemoved ( SUIT_ViewManager )
protectedvirtualslot

virtual SLOT: called on view manager removing

LightApp_Operation * LightApp_Module::operation ( const int  id) const
protected
Parameters
id- operation id
Returns
operation instance

References myOperations.

void LightApp_Module::paste ( )
virtual

virtual method

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

Gets property of preferences.

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

LightApp_Preferences * LightApp_Module::preferences ( ) const
protected

Gets preferences.

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

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

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

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

Rename object by entry.

Parameters
entryentry of the object
namenew name of the object
bool LightApp_Module::reusableOperation ( const int  id)
protectedvirtual

virtual method called to manage the same operations

void LightApp_Module::selectionChanged ( )
virtual

NOT IMPLEMENTED

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

Set property of preferences.

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

void LightApp_Module::startOperation ( const int  id)
protected

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().

virtual void LightApp_Module::studyActivated ( )
inlinevirtual
void LightApp_Module::studyClosed ( SUIT_Study theStudy)
virtualslot

Redefined to reset internal flags valid for study instance

Reimplemented in SALOME_PYQT_Module.

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

void LightApp_Module::update ( const int  theFlags)
virtual
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().

void LightApp_Module::updateControls ( )
protectedvirtual

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.

void LightApp_Module::updateObjBrowser ( bool  theIsUpdateDataModel = true,
SUIT_DataObject theDataObject = 0 
)
virtual
void LightApp_Module::viewManagers ( QStringList &  ) const
virtual

NOT IMPLEMENTED

Reimplemented in SALOME_PYQT_ModuleLight, and SALOME_PYQT_Module.

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

int LightApp_Module::myDisplay
protected
int LightApp_Module::myDisplayOnly
protected
int LightApp_Module::myErase
protected
int LightApp_Module::myEraseAll
protected
bool LightApp_Module::myIsFirstActivate
protected
MapOfOperation LightApp_Module::myOperations
private
QtxPopupMgr* LightApp_Module::myPopupMgr
private
LightApp_SwitchOp* LightApp_Module::mySwitchOp
private

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