1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "CAM_Module.h"
25 #include "CAM_DataModel.h"
26 #include "CAM_Application.h"
27 #include "CAM_Study.h"
29 #include <QtxAction.h>
30 #include <QtxActionGroup.h>
31 #include <QtxActionMenuMgr.h>
32 #include <QtxActionToolMgr.h>
34 #include <SUIT_Desktop.h>
35 #include <SUIT_Session.h>
36 #include <SUIT_ResourceMgr.h>
42 \brief Base implementation of the module in the CAM application architecture.
44 Provides support of menu/toolbars management.
50 ActionMgrLocker( QtxActionMgr* m, bool use ) : myMgr( m ), myUseLock( use )
53 myUpdEnabled = myMgr->isUpdatesEnabled();
54 myMgr->setUpdatesEnabled( false );
60 myMgr->setUpdatesEnabled( myUpdEnabled );
71 \brief Default constructor.
73 Creates unnamed module.
75 CAM_Module::CAM_Module()
85 Creates module with the specified \a name.
87 \param name module name
89 CAM_Module::CAM_Module( const QString& name )
104 CAM_Module::~CAM_Module()
111 \brief Initialize module.
113 This method is usually called when the module is created (for example,
114 on the module library loading).
115 Successor classes can use this method to create menu/toolbar actions
116 and perform other module initialization.
118 \param app parent application object
119 \sa activateModule(), deactivateModule()
121 void CAM_Module::initialize( CAM_Application* app )
126 SUIT_Session* aSession = SUIT_Session::session();
127 connect( aSession, SIGNAL( applicationClosed( SUIT_Application* ) ),
128 this, SLOT( onApplicationClosed( SUIT_Application* ) ) );
130 connect( myApp, SIGNAL( infoChanged( QString ) ), this, SLOT( onInfoChanged( QString ) ) );
135 \brief Get module icon.
136 \return module icon pixmap
139 QPixmap CAM_Module::moduleIcon() const
141 if ( myIcon.isNull() ) {
142 QString iname = iconName();
143 if ( !iname.isEmpty() ) {
144 CAM_Module* that = (CAM_Module*)this;
145 that->myIcon = application()->resourceMgr()->loadPixmap( name(), iname, false );
152 \brief Get module icon's name.
154 This function is used to get module icon's file name.
155 Default implementation returns empty string.
157 \return module icon's name.
160 QString CAM_Module::iconName() const
162 return application()->moduleIcon( name() );
166 \brief Get module (internal) name
168 \sa setName(), moduleName(), setModuleName()
170 QString CAM_Module::name() const
176 \brief Get module title (user name)
178 \sa setModuleName(), name(), setName()
180 QString CAM_Module::moduleName() const
186 \brief Get data model.
188 Creates data model, if it is not yet created.
190 \return data model pointer
191 \sa createDataModel()
193 CAM_DataModel* CAM_Module::dataModel() const
197 CAM_Module* that = (CAM_Module*)this;
198 that->myDataModel = that->createDataModel();
199 that->myDataModel->initialize();
205 \brief Get application.
206 \return application pointer
208 CAM_Application* CAM_Module::application() const
214 \brief If return false, selection will be cleared at module activation
216 bool CAM_Module::isSelectionCompatible()
222 \brief Activate module.
224 This method is called when the user activates module.
225 Successor classes can use this method to customize module activation process,
226 for example, to show own menus, toolbars, etc.
228 Default implementation always returns \c true.
230 \return \c true if module is activated successfully.
231 \sa initialize(), deactivateModule()
233 bool CAM_Module::activateModule( SUIT_Study* /*study*/ )
239 \brief Deactivate module.
241 This method is called when the user deactivates module.
242 Successor classes can use this method to customize module deactivation process,
243 for example, to hide own menus, toolbars, etc.
245 Default implementation always returns \c true.
247 \return \c true if module is deactivated successfully.
248 \sa initialize(), activateModule()
250 bool CAM_Module::deactivateModule( SUIT_Study* )
256 \brief Called when study is closed.
258 Removes data model from the \a study.
260 \param study study being closed
262 void CAM_Module::studyClosed( SUIT_Study* study )
264 CAM_Study* camDoc = dynamic_cast<CAM_Study*>( study );
268 CAM_DataModel* dm = dataModel();
269 if ( dm && camDoc->containsDataModel( dm ) ) {
271 camDoc->removeDataModel( dm );
276 \brief Called when study is changed (obsolete).
278 Default implementation does nothing.
280 \param oldStudy old study
281 \param newStudy new study
283 void CAM_Module::studyChanged( SUIT_Study* /*oldStudy*/, SUIT_Study* /*newStudy*/ )
288 \brief Check if the module is active.
289 \return \c true if module is active.
291 bool CAM_Module::isActiveModule() const
293 return application() ? application()->activeModule() == this : false;
297 \brief Put the text message into the status bar of the application main window.
299 If \a msec > 0, the message will be shown \a msec milliseconds.
300 If \a msec < 0, the message will be constantly displayed until module is active.
302 \param msg text message
303 \param msec message displaying duration in milliseconds
305 void CAM_Module::putInfo( const QString& msg, const int msec )
308 application()->putInfo( msg, msec );
315 \brief Restore message info.
317 Restores constant text message when previous information status message is removed.
319 \param txt previous message (being removed)
322 void CAM_Module::onInfoChanged( QString txt )
324 if ( txt.isEmpty() && isActiveModule() && !myInfo.isEmpty() && application() )
325 application()->putInfo( myInfo );
329 \brief Called when application is closed.
331 Nullify application pointer if the application is being closed.
333 \param theApp application
335 void CAM_Module::onApplicationClosed( SUIT_Application* theApp )
342 \brief Create data model.
343 \return created data model object or 0 if it could not be created
345 CAM_DataModel* CAM_Module::createDataModel()
347 return new CAM_DataModel( this );
351 \brief Set module (internal) name
352 \param name new module name
353 \sa name(), moduleName(), setModuleName()
355 void CAM_Module::setName( const QString& name )
357 setObjectName( name );
361 \brief Set module title (user name)
362 \param name new module title
363 \sa moduleName(), name(), setName()
365 void CAM_Module::setModuleName( const QString& name )
371 \brief Get menu manager.
372 \return menu manager pointer
374 QtxActionMenuMgr* CAM_Module::menuMgr() const
376 QtxActionMenuMgr* mgr = 0;
377 if ( application() && application()->desktop() )
378 mgr = application()->desktop()->menuMgr();
383 \brief Get toolbar manager.
384 \return toolbar manager pointer
386 QtxActionToolMgr* CAM_Module::toolMgr() const
388 QtxActionToolMgr* mgr = 0;
389 if ( application() && application()->desktop() )
390 mgr = application()->desktop()->toolMgr();
395 \brief Create toolbar with speicifed \a name.
397 If the toolbar has been already created, its ID is just returned.
399 \param title toolbar title
400 \param name toolbar name (identifier)
401 \return toolbar ID or -1 if toolbar could not be created
403 int CAM_Module::createTool( const QString& title, const QString& name )
408 ActionMgrLocker lock( toolMgr(), !myToolShown );
410 return toolMgr()->createToolBar( title, name );
414 \brief Add toolbar item.
416 Insert action \a to the toolbar manager and register it with specified \a id.
417 Resulting action ID may differ from the requested one. This can happen if
418 requested ID is already in use.
420 If action has been already added previously, its ID is just returned.
422 If \a id < 0, the action ID is generated automatically.
424 If \a idx < 0, the action is added to the end of the toolbar.
427 \param tBar toolbar ID
428 \param id requested action ID
429 \param idx action index (desired position in the toolbar)
430 \return action ID or -1 if toolbar item could not be added
432 int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
437 ActionMgrLocker lock( toolMgr(), !myToolShown );
439 int regId = registerAction( id, a );
440 int intId = toolMgr()->insert( a, tBar, idx );
443 setToolShown( a, false );
445 return intId != -1 ? regId : -1;
449 \brief Add toolbar item.
451 Insert action \a to the toolbar manager and register it with specified \a id.
452 Resulting action ID may differ from the requested one. This can happen if
453 requested ID is already in use.
455 If action has been already added previously, its ID is just returned.
457 If \a id < 0, the action ID is generated automatically.
459 If \a idx < 0, the action is added to the end of the toolbar.
462 \param tBar toolbar name
463 \param id requested action ID
464 \param idx action index (desired position in the toolbar)
465 \return action ID or -1 if toolbar item could not be added
467 int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
472 ActionMgrLocker lock( toolMgr(), !myToolShown );
474 int regId = registerAction( id, a );
475 int intId = toolMgr()->insert( a, tBar, idx );
478 setToolShown( a, false );
480 return intId != -1 ? regId : -1;
484 \brief Add toolbar item.
486 Insert action with \a id identifier to the toolbar manager.
487 It is assumed that action has been already registered.
489 Resulting action ID may differ from the requested one. This can happen if
490 requested ID is already in use.
492 If action has been already added previously, its ID is just returned.
494 If \a idx < 0, the action is added to the end of the toolbar.
497 \param tBar toolbar ID
498 \param idx action index (desired position in the toolbar)
499 \return action ID or -1 if toolbar item could not be added
501 int CAM_Module::createTool( const int id, const int tBar, const int idx )
506 ActionMgrLocker lock( toolMgr(), !myToolShown );
508 int intId = toolMgr()->insert( action( id ), tBar, idx );
511 setToolShown( action( id ), false );
513 return intId != -1 ? id : -1;
517 \brief Add toolbar item.
519 Insert action with \a id identifier to the toolbar manager.
520 It is assumed that action has been already registered.
522 Resulting action ID may differ from the requested one. This can happen if
523 requested ID is already in use.
525 If action has been already added previously, its ID is just returned.
527 If \a idx < 0, the action is added to the end of the toolbar.
530 \param tBar toolbar name
531 \param idx action index (desired position in the toolbar)
532 \return action ID or -1 if toolbar item could not be added
534 int CAM_Module::createTool( const int id, const QString& tBar, const int idx )
539 ActionMgrLocker lock( toolMgr(), !myToolShown );
541 int intId = toolMgr()->insert( action( id ), tBar, idx );
544 setToolShown( action( id ), false );
546 return intId != -1 ? id : -1;
550 \brief Create menu or submenu.
552 Create main menu or popup submenu and register it with specified \a id.
553 Resulting action ID may differ from the requested one. This can happen if
554 requested ID is already in use.
556 If \a id < 0, the menu ID is generated automatically.
557 If menu has been already created previously, its ID is just returned.
559 The \a menu parameter represents the menu name - it could be a sequence
560 of strings, separated by '|' symbol. For example, "File|Edit" means
561 File->Edit submenu. If menu doesn't exist, it is created automatically.
563 Parameter \a idx defines the index of the menu item in the menu group which
564 is defined by the \a group. If \a idx < 0, the menu/submenu is added to the
565 end of the menu group.
567 \param subMenu subMenu name
568 \param menu parent menu ID
569 \param id requested menu ID
570 \param group menu group ID
571 \param idx menu item index (desired position in the menu group)
572 \return menu item ID or -1 if menu item could not be added
574 int CAM_Module::createMenu( const QString& subMenu, const int menu,
575 const int id, const int group, const int idx, QMenu * menuObj )
580 return menuMgr()->insert( subMenu, menu, group, id, idx, menuObj );
584 \brief Create menu or submenu.
586 Create main menu or popup submenu and register it with specified \a id.
587 Resulting action ID may differ from the requested one. This can happen if
588 requested ID is already in use.
590 If \a id < 0, the menu ID is generated automatically.
591 If menu has been already created previously, its ID is just returned.
593 The \a menu parameter represents the menu name - it could be a sequence
594 of strings, separated by '|' symbol. For example, "File|Edit" means
595 File->Edit submenu. If menu doesn't exist, it is created automatically.
597 Parameter \a idx defines the index of the menu item in the menu group which
598 is defined by the \a group. If \a idx < 0, the menu/submenu is added to the
599 end of the menu group.
601 \param subMenu subMenu name
602 \param menu parent menu name(s)
603 \param id requested menu ID
604 \param group menu group ID
605 \param idx menu item index (desired position in the menu group)
606 \return menu item ID or -1 if menu item could not be added
608 int CAM_Module::createMenu( const QString& subMenu, const QString& menu,
609 const int id, const int group, const int idx )
614 return menuMgr()->insert( subMenu, menu, group, id, idx );
618 \brief Add menu item.
620 Insert action \a to the menu manager and register it with specified \a id.
621 Resulting action ID may differ from the requested one. This can happen if
622 requested ID is already in use.
624 If \a id < 0, the action ID is generated automatically.
626 If action has been already added previously, its ID is just returned.
628 Parameter \a idx defines the index of the menu item in the menu group which
629 is defined by the \a group. If \a idx < 0, the action is added to the
630 end of the menu group.
634 \param id requested action ID
635 \param group menu group ID
636 \param idx action index (desired position in the menu group)
637 \return action ID or -1 if menu item could not be added
639 int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int idx )
641 if ( !a || !menuMgr() )
644 ActionMgrLocker lock( menuMgr(), !myMenuShown );
646 int regId = registerAction( id, a );
647 int intId = menuMgr()->insert( a, menu, group, idx );
650 setMenuShown( a, false );
652 return intId != -1 ? regId : -1;
656 \brief Add menu item.
658 Insert action \a to the menu manager and register it with specified \a id.
659 Resulting action ID may differ from the requested one. This can happen if
660 requested ID is already in use.
662 If \a id < 0, the action ID is generated automatically.
664 If action has been already added previously, its ID is just returned.
666 The \a menu parameter represents the menu name - it could be a sequence
667 of strings, separated by '|' symbol. For example, "File|Edit" means
668 File->Edit submenu. If menu doesn't exist, it is created automatically.
670 Parameter \a idx defines the index of the menu item in the menu group which
671 is defined by the \a group. If \a idx < 0, the action is added to the
672 end of the menu group.
675 \param menu menu name(s)
676 \param id requested action ID
677 \param group menu group ID
678 \param idx action index (desired position in the menu group)
679 \return action ID or -1 if menu item could not be added
681 int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int idx )
683 if ( !a || !menuMgr() )
686 ActionMgrLocker lock( menuMgr(), !myMenuShown );
688 int regId = registerAction( id, a );
689 int intId = menuMgr()->insert( a, menu, group, idx );
692 setMenuShown( a, false );
694 return intId != -1 ? regId : -1;
698 \brief Add menu item.
700 Insert action with \a id identifier to the menu manager.
701 It is assumed that action has been already registered.
703 Resulting action ID may differ from the requested one. This can happen if
704 requested ID is already in use.
706 If action has been already added previously, its ID is just returned.
708 Parameter \a idx defines the index of the menu item in the menu group which
709 is defined by the \a group. If \a idx < 0, the action is added to the
710 end of the menu group.
714 \param group menu group ID
715 \param idx action index (desired position in the menu group)
716 \return action ID or -1 if menu item could not be added
718 int CAM_Module::createMenu( const int id, const int menu, const int group, const int idx )
723 ActionMgrLocker lock( menuMgr(), !myMenuShown );
725 int intId = menuMgr()->insert( action( id ), menu, group, idx );
728 setMenuShown( action( id ), false );
730 return intId != -1 ? id : -1;
734 \brief Add menu item.
736 Insert action with \a id identifier to the menu manager.
737 It is assumed that action has been already registered.
739 Resulting action ID may differ from the requested one. This can happen if
740 requested ID is already in use.
742 If action has been already added previously, its ID is just returned.
744 The \a menu parameter represents the menu name - it could be a sequence
745 of strings, separated by '|' symbol. For example, "File|Edit" means
746 File->Edit submenu. If menu doesn't exist, it is created automatically.
748 Parameter \a idx defines the index of the menu item in the menu group which
749 is defined by the \a group. If \a idx < 0, the action is added to the
750 end of the menu group.
753 \param menu menu name(s)
754 \param group menu group ID
755 \param idx action index (desired position in the menu group)
756 \return action ID or -1 if menu item could not be added
758 int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int idx )
763 ActionMgrLocker lock( menuMgr(), !myMenuShown );
765 int intId = menuMgr()->insert( action( id ), menu, group, idx );
768 setMenuShown( action( id ), false );
770 return intId != -1 ? id : -1;
774 \brief Show/hide all module's menus.
775 \param on if \c true, show menus, otherwise, hide all menus
778 void CAM_Module::setMenuShown( const bool on )
782 QtxActionMenuMgr* mMgr = menuMgr();
786 bool upd = mMgr->isUpdatesEnabled();
787 mMgr->setUpdatesEnabled( false );
789 QAction* sep = separator();
790 for ( QMap<int, QAction*>::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it )
792 if ( it.value() != sep )
793 mMgr->setShown( mMgr->actionId( it.value() ), on );
796 mMgr->setUpdatesEnabled( upd );
802 \brief Show/hide specified menu item.
804 \param on if \c true, show menu item, otherwise, hide it
806 void CAM_Module::setMenuShown( QAction* a, const bool on )
809 menuMgr()->setShown( menuMgr()->actionId( a ), on );
813 \brief Show/hide specified menu item.
814 \param id menu item ID
815 \param on if \c true, show menu item, otherwise, hide it
817 void CAM_Module::setMenuShown( const int id, const bool on )
819 setMenuShown( action( id ), on );
823 \brief Show/hide all module's toolbars.
824 \param on if \c true, show toolbars, otherwise, hide all toolbars
827 void CAM_Module::setToolShown( const bool on )
831 QtxActionToolMgr* tMgr = toolMgr();
835 bool upd = tMgr->isUpdatesEnabled();
836 tMgr->setUpdatesEnabled( false );
838 QAction* sep = separator();
839 for ( QMap<int, QAction*>::Iterator it = myActionMap.begin(); it != myActionMap.end(); ++it )
841 if ( it.value() != sep )
842 tMgr->setShown( tMgr->actionId( it.value() ), on );
845 tMgr->setUpdatesEnabled( upd );
851 \brief Show/hide specified toolbar item.
853 \param on if \c true, show toolbar item, otherwise, hide it
855 void CAM_Module::setToolShown( QAction* a, const bool on )
858 toolMgr()->setShown( toolMgr()->actionId( a ), on );
862 \brief Show/hide specified toolbar item.
863 \param id toolbar item ID
864 \param on if \c true, show toolbar item, otherwise, hide it
866 void CAM_Module::setToolShown( const int id, const bool on )
868 setToolShown( action( id ), on );
872 \brief Get action by specified \a id.
874 \return action or 0 if not found
876 QAction* CAM_Module::action( const int id ) const
879 if ( myActionMap.contains( id ) )
881 else if ( menuMgr() ) {
882 QMenu* m = menuMgr()->findMenu( id );
883 if ( m ) a = m->menuAction();
889 \brief Get action ID.
891 \return action ID or -1 if not found
893 int CAM_Module::actionId( const QAction* a ) const
896 for ( QMap<int, QAction*>::ConstIterator it = myActionMap.begin(); it != myActionMap.end() && id == -1; ++it )
898 if ( it.value() == a )
905 \brief Create new instance of QtxAction and register action with specified \a id.
907 Resulting action ID may differ from the requested one. This can happen if
908 requested ID is already in use.
910 If \a id < 0, the action ID is generated automatically.
912 \param id required action ID
913 \param text tooltip text
914 \param icon action icon
915 \param menu menu text
916 \param tip status bar tip
917 \param key keyboard accelerator
918 \param parent parent object
919 \param toggle if \c true, the action will be toggled
920 \param reciever action activation signal receiver object
921 \param member action activation signal receiver slot
923 QAction* CAM_Module::createAction( const int id, const QString& text, const QIcon& icon,
924 const QString& menu, const QString& tip, const int key,
925 QObject* parent, const bool toggle, QObject* reciever,
926 const char* member, const QString& shortcutAction )
928 QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
929 a->setStatusTip( tip );
931 if ( reciever && member )
932 connect( a, SIGNAL( triggered( bool ) ), reciever, member );
934 registerAction( id, a );
940 \brief Create new action group.
941 \param id action group ID
942 \param exclusive \c true for exclusive action group
943 \return created action group
945 QtxActionGroup* CAM_Module::createActionGroup( const int id, const bool exclusive )
947 QtxActionGroup* a = qobject_cast<QtxActionGroup*>( action( id ) );
949 a = new QtxActionGroup( this );
950 registerAction( id, a );
952 a->setExclusive( exclusive );
957 \brief Register action in the internal action map.
959 If action has been already added previously, its ID is just returned.
960 If \a id < 0, the action ID is generated automatically.
962 \param id action required ID
966 int CAM_Module::registerAction( const int id, QAction* a )
969 for ( QMap<int, QAction*>::ConstIterator it = myActionMap.begin(); it != myActionMap.end() && ident == -1; ++it )
970 if ( it.value() == a )
976 static int generatedId = -1;
977 ident = id < 0 ? --generatedId : id;
979 myActionMap.insert( ident, a );
982 menuMgr()->registerAction( a );
985 toolMgr()->registerAction( a );
987 if ( application() && application()->desktop() )
988 application()->desktop()->addAction( a );
994 \brief Unregister action from the internal action map.
997 \return \c true on success or \c false if action is in use
999 bool CAM_Module::unregisterAction( const int id )
1001 return unregisterAction( action( id ) );
1005 \brief Unregister action from the internal action map.
1008 \return \c true on success or \c false if action is in use
1010 bool CAM_Module::unregisterAction( QAction* a )
1015 int id = menuMgr()->actionId( a );
1016 if ( id != -1 && menuMgr()->containsMenu( id, -1 ) )
1020 int id = toolMgr()->actionId( a );
1021 if ( id != -1 && toolMgr()->containsAction( id ) )
1025 menuMgr()->unRegisterAction( menuMgr()->actionId( a ) );
1027 toolMgr()->unRegisterAction( toolMgr()->actionId( a ) );
1032 \brief Create separator action.
1034 Separator action can be used in menus or toolbars.
1036 \return new separator action
1038 QAction* CAM_Module::separator()
1040 return QtxActionMgr::separator();
1044 \brief Update visibility state of the module objects.
1046 void CAM_Module::updateModuleVisibilityState() {
1051 \brief Activate GUI operation of module by its ID.
1052 This method is called from CAM_Application::startOperation().
1053 \param actionId is a numerical unique operation id.
1055 bool CAM_Module::activateOperation( int actionId )
1061 \brief Activate GUI operation of module by its ID.
1062 This method is called from CAM_Application::startOperation().
1063 \param actionId is a string unique operation id.
1065 bool CAM_Module::activateOperation( const QString& actionId )
1071 \brief Activate GUI operation of module by its ID and \a pluginName.
1072 This method is called from CAM_Application::startOperation().
1073 \param actionId is a string unique operation id.
1074 \param pluginName is a name of a plugin where the operation is implemented.
1076 bool CAM_Module::activateOperation( const QString& actionId, const QString& pluginName )
1083 \brief Connect data model of the module to the active study
1084 \param camStudy CAM study object
1086 void CAM_Module::connectToStudy( CAM_Study* camStudy )
1088 CAM_Application* app = camStudy ? dynamic_cast<CAM_Application*>( camStudy->application() ) : 0;
1092 CAM_DataModel* prev = 0;
1093 CAM_Application::ModuleList mods = app->modules();
1094 for( QList<CAM_Module*>::const_iterator it = mods.begin(); it != mods.end(); ++it )
1096 CAM_DataModel* dm = (*it)->dataModel();
1097 if( (*it) == this && !camStudy->containsDataModel( dm ) )
1100 camStudy->insertDataModel( (*it)->dataModel(), prev );
1102 camStudy->insertDataModel( (*it)->dataModel(), 0 );
1109 \fn void CAM_Module::contextMenuPopup( const QString& type, QMenu* menu, QString& title );
1110 \brief Create context popup menu.
1111 \param type popup menu context
1112 \param menu popup menu
1113 \param title popup menu title, which can be set by the module if required
1117 \fn void CAM_Module::updateCommandsStatus();
1118 \brief Update menu/toolbar actions.