This class implements GUI module for "light-weight" (no-CORBA-engine) Python-based SALOME modules.
#include <SALOME_PYQT_ModuleLight.h>
Signals | |
void | selectionChanged () |
void | localSelectionChanged () |
Public Member Functions | |
SALOME_PYQT_ModuleLight () | |
Constructor. More... | |
~SALOME_PYQT_ModuleLight () | |
Destructor. More... | |
void | initialize (CAM_Application *) |
Initialization of the module. More... | |
bool | activateModule (SUIT_Study *) |
Activation of the module. More... | |
bool | deactivateModule (SUIT_Study *) |
Deactivation of the module. More... | |
void | onModelClosed () |
Close of the module. More... | |
void | windows (QMap< int, int > &) const |
Get the dockable windows associated with the module. More... | |
void | viewManagers (QStringList &) const |
Define the compatible view windows associated with the module. More... | |
void | studyActivated () |
Process study activation. More... | |
void | contextMenuPopup (const QString &, QMenu *, QString &) |
Process context popup menu request. More... | |
void | createPreferences () |
Export preferences for the Python module. More... | |
void | preferencesChanged (const QString &, const QString &) |
Process module's preferences changing. More... | |
void | save (QStringList &, const QString &) |
Save module data. Called when user saves study. More... | |
bool | load (const QStringList &, const QString &) |
void | dumpPython (QStringList &) |
Dump module data to the Python script. Called when user activates dump study operation. More... | |
bool | isDraggable (const SUIT_DataObject *) const |
Test if object what can be dragged by the user. More... | |
bool | isDropAccepted (const SUIT_DataObject *) const |
Test if drop operation can be done on the where object. More... | |
void | dropObjects (const DataObjectList &, SUIT_DataObject *, const int, Qt::DropAction) |
Perform drop operation. More... | |
QString | createObject (const QString &) |
Create new empty data object. More... | |
QString | createObject (const QString &, const QString &, const QString &, const QString &) |
Create new data object with specified name, icon and tooltip. More... | |
void | setName (const QString &, const QString &) |
Set data object name. More... | |
QString | getName (const QString &) const |
Get data object name. More... | |
void | setIcon (const QString &, const QString &) |
Set data object icon. More... | |
void | setToolTip (const QString &, const QString &) |
Set data object tooltip. More... | |
QString | getToolTip (const QString &) const |
Get data object tooltip. More... | |
void | setColor (const QString &, const QColor &) |
Set data object color. More... | |
QColor | getColor (const QString &) const |
Get data object color. More... | |
void | setReference (const QString &, const QString &) |
Set reference to another data object. More... | |
QString | getReference (const QString &) const |
void | removeObject (const QString &) |
Remove object by entry. More... | |
void | removeChildren (const QString &) |
Remove all child data objects from specified data object. More... | |
void | setObjectPosition (const QString &, int) |
int | getObjectPosition (const QString &) |
QStringList | getChildren (const QString &, const bool=false) const |
Get entries of all child data objects of specified data object. More... | |
void | enableSelector () |
void | disableSelector () |
void | setLocalSelected (const QStringList &) |
called by Python module to notify a list of study entries locally selected (for selection propagation) More... | |
void | getSelected (DataObjectList &) const |
not used yet More... | |
void | setSelected (const QStringList &, const bool=false) |
not used yet More... | |
Public Member Functions inherited from LightApp_Module | |
LightApp_Module (const QString &) | |
virtual | ~LightApp_Module () |
LightApp_Application * | getApp () 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 | message (const QString &) |
virtual LightApp_Displayer * | displayer () |
virtual LightApp_Selection * | createSelection () const |
virtual bool | canCopy () const |
virtual bool | canPaste () const |
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_DataModel * | dataModel () const |
Get data model. More... | |
CAM_Application * | application () 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... | |
QtxActionMenuMgr * | menuMgr () const |
Get menu manager. More... | |
QtxActionToolMgr * | toolMgr () const |
Get toolbar manager. More... | |
virtual QAction * | action (const int) const |
Get action by specified id. More... | |
virtual int | actionId (const QAction *) const |
Get action ID. More... | |
virtual QAction * | createAction (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 QAction * | createAction (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... | |
QtxActionGroup * | createActionGroup (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 Member Functions | |
CAM_DataModel * | createDataModel () |
Create new instance of data model and return it. More... | |
Protected Member Functions inherited from LightApp_Module | |
virtual QtxPopupMgr * | popupMgr () |
LightApp_Preferences * | preferences () const |
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 §ion=QString(), const QString ¶m=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_Operation * | createOperation (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_Operation * | operation (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 () |
Private Member Functions | |
SALOME_PYQT_DataObjectLight * | findObject (const QString &) const |
Find data object by its entry. More... | |
Private Attributes | |
PyModuleHelper * | myHelper |
SALOME_PYQT_Selector * | mySelector |
Additional Inherited Members | |
Public Slots inherited from LightApp_Module | |
virtual void | studyClosed (SUIT_Study *) |
virtual void | onObjectClicked (SUIT_DataObject *, int) |
Virtual public slot. More... | |
void | onOBDestroyed () |
void | MenuItem () |
Static Public Member Functions inherited from CAM_Module | |
static QAction * | separator () |
Create separator action. More... | |
Protected Slots inherited from LightApp_Module | |
virtual void | onModelSaved () |
virtual void | onModelOpened () |
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 Attributes inherited from LightApp_Module | |
int | myDisplay |
int | myErase |
int | myDisplayOnly |
int | myEraseAll |
bool | myIsFirstActivate |
SALOME_PYQT_ModuleLight::SALOME_PYQT_ModuleLight | ( | ) |
References myHelper.
SALOME_PYQT_ModuleLight::~SALOME_PYQT_ModuleLight | ( | ) |
|
virtual |
study | parent study |
true
if activation is successful and false
otherwise Reimplemented from LightApp_Module.
References PyModuleHelper::activate(), LightApp_Module::activateModule(), and myHelper.
|
virtual |
context | popup menu context (e.g. "ObjectBrowser") |
menu | popup menu |
title | popup menu title (not used) |
Reimplemented from LightApp_Module.
References PyModuleHelper::contextMenu(), and myHelper.
|
protectedvirtual |
Reimplemented from LightApp_Module.
QString SALOME_PYQT_ModuleLight::createObject | ( | const QString & | parent | ) |
parent | entry of parent data object |
References CAM_Module::dataModel(), SALOME_PYQT_DataObjectLight::entry(), findObject(), SALOME_PYQT_DataModelLight::getRoot(), and obj.
QString SALOME_PYQT_ModuleLight::createObject | ( | const QString & | name, |
const QString & | icon, | ||
const QString & | toolTip, | ||
const QString & | parent | ||
) |
name | data object name |
icon | data object icon |
toolTip | data object tooltip |
parent | entry of parent data object |
References createObject(), findObject(), obj, SALOME_PYQT_DataObjectLight::setIcon(), SALOME_PYQT_DataObjectLight::setName(), and SALOME_PYQT_DataObjectLight::setToolTip().
|
virtual |
Reimplemented from LightApp_Module.
References PyModuleHelper::createPreferences(), and myHelper.
|
virtual |
study | parent study |
true
if deactivation is successful and false
otherwise Reimplemented from LightApp_Module.
References PyModuleHelper::deactivate(), LightApp_Module::deactivateModule(), and myHelper.
void SALOME_PYQT_ModuleLight::disableSelector | ( | ) |
References mySelector, and SUIT_Selector::setEnabled().
|
virtual |
what | list of data objects being dropped |
where | target data object for drop operation |
row | line (child item index) where drop operation is performed to |
action | current drop action (copy or move) |
Reimplemented from LightApp_Module.
References PyModuleHelper::dropObjects(), and myHelper.
void SALOME_PYQT_ModuleLight::dumpPython | ( | QStringList & | files | ) |
files | output list of files where module stores python script |
References PyModuleHelper::dumpPython(), and myHelper.
void SALOME_PYQT_ModuleLight::enableSelector | ( | ) |
References LightApp_Module::getApp(), mySelector, and SUIT_Selector::setEnabled().
|
private |
entry | data object entry |
References SUIT_DataObjectIterator::current(), CAM_Module::dataModel(), SUIT_DataObjectIterator::DepthLeft, SALOME_PYQT_DataObjectLight::entry(), SALOME_PYQT_DataModelLight::getRoot(), and obj.
QStringList SALOME_PYQT_ModuleLight::getChildren | ( | const QString & | entry, |
const bool | recursive = false |
||
) | const |
entry | data object entry |
recursive | true for recursive processing |
References SUIT_DataObject::children(), CAM_Module::dataModel(), SALOME_PYQT_DataObjectLight::entry(), findObject(), and SALOME_PYQT_DataModelLight::getRoot().
QColor SALOME_PYQT_ModuleLight::getColor | ( | const QString & | entry | ) | const |
entry | data object entry |
References OCCViewer::color(), SALOME_PYQT_DataObjectLight::color(), findObject(), and SUIT_DataObject::Foreground.
QString SALOME_PYQT_ModuleLight::getName | ( | const QString & | entry | ) | const |
entry | data object entry |
References findObject(), SALOME_PYQT_DataObjectLight::name(), and CAM_Module::name().
int SALOME_PYQT_ModuleLight::getObjectPosition | ( | const QString & | theEntry | ) |
References findObject(), and SUIT_DataObject::position().
QString SALOME_PYQT_ModuleLight::getReference | ( | const QString & | entry | ) | const |
References findObject(), and SALOME_PYQT_DataObjectLight::refEntry().
void SALOME_PYQT_ModuleLight::getSelected | ( | DataObjectList & | ) | const |
QString SALOME_PYQT_ModuleLight::getToolTip | ( | const QString & | entry | ) | const |
entry | data object entry |
References findObject(), and SALOME_PYQT_DataObjectLight::toolTip().
|
virtual |
app | parent application object |
Reimplemented from LightApp_Module.
References LightApp_Module::getApp(), LightApp_Module::initialize(), PyModuleHelper::initialize(), OB_Browser::model(), myHelper, and LightApp_Application::objectBrowser().
|
virtual |
what | data object being tested |
true
if object can be dragged or false
otherwise Reimplemented from LightApp_Module.
References PyModuleHelper::isDraggable(), and myHelper.
|
virtual |
where | data object being tested |
true
if if drop operation is supported by object or false
otherwise Reimplemented from LightApp_Module.
References PyModuleHelper::isDropAccepted(), and myHelper.
References PyModuleHelper::load(), and myHelper.
|
signal |
|
virtual |
This function is usually used in order to close the module's specific menus and toolbars and perform other such actions required when the module is closed.
Reimplemented from LightApp_Module.
References CAM_Module::application(), SALOME_PYQT_Selector::clear(), PyModuleHelper::modelClosed(), myHelper, mySelector, and LightApp_Module::onModelClosed().
|
virtual |
section | preference resources section |
parameter | preference resources parameter name |
Reimplemented from LightApp_Module.
References myHelper, and PyModuleHelper::preferencesChanged().
void SALOME_PYQT_ModuleLight::removeChildren | ( | const QString & | entry | ) |
entry | data object entry |
References SUIT_DataObject::children(), CAM_Module::dataModel(), findObject(), SALOME_PYQT_DataModelLight::getRoot(), and SUIT_DataObject::removeChild().
void SALOME_PYQT_ModuleLight::removeObject | ( | const QString & | entry | ) |
entry | data object entry |
References findObject(), SUIT_DataObject::parent(), and SUIT_DataObject::removeChild().
void SALOME_PYQT_ModuleLight::save | ( | QStringList & | files, |
const QString & | url | ||
) |
files | output list of files where module stores data |
url | study URL |
References myHelper, and PyModuleHelper::save().
|
signal |
entry | data object entry |
color | data object color |
References findObject(), and SALOME_PYQT_DataObjectLight::setColor().
entry | data object entry |
icon | data object icon file name (icon is loaded from module resources) |
References findObject(), and SALOME_PYQT_DataObjectLight::setIcon().
void SALOME_PYQT_ModuleLight::setLocalSelected | ( | const QStringList & | entries | ) |
list | of study entries |
References LightApp_Module::getApp(), localSelectionChanged(), mySelector, and SALOME_PYQT_Selector::setLocalEntries().
entry | data object entry |
name | data object name |
References findObject(), and SALOME_PYQT_DataObjectLight::setName().
void SALOME_PYQT_ModuleLight::setObjectPosition | ( | const QString & | theEntry, |
int | thePos | ||
) |
References findObject(), and SUIT_DataObject::setPosition().
entry | data object entry |
refEntry | referenced data object entry |
References findObject(), and SALOME_PYQT_DataObjectLight::setRefEntry().
void SALOME_PYQT_ModuleLight::setSelected | ( | const QStringList & | entries, |
const bool | isUnused = false |
||
) |
not used yet
Used to notify a Python light module of a modification of selection in study (propagation of a remote selection)
list | of study entries |
References myHelper, and PyModuleHelper::selectionUpdated().
entry | data object entry |
toolTip | data object tooltip |
References findObject(), and SALOME_PYQT_DataObjectLight::setToolTip().
|
virtual |
Reimplemented from LightApp_Module.
References CAM_Module::application(), myHelper, and PyModuleHelper::studyActivated().
|
virtual |
viewList | output list of view windows types |
Reimplemented from LightApp_Module.
References myHelper, and PyModuleHelper::viewManagers().
|
virtual |
winMap | output map of dockable windows in form { <window_type> : <dock_area> } |
Reimplemented from LightApp_Module.
References myHelper, and PyModuleHelper::windows().
|
private |
|
private |