#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
+/*!Icon.*/
static const char* ModuleIcon[] = {
"20 20 2 1",
" c None",
return toolMgr()->createToolBar( name );
}
-
+/*! Create tool. Register action \a a with id \a id.
+ * Insert QAction to tool manager.
+ *\param a - QAction
+ *\param tBar - integer
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( QAction* a, const int tBar, const int id, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create tool. Register action \a a with id \a id.
+ * Insert QAction to tool manager.
+ *\param a - QAction
+ *\param tBar - QString&
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( QAction* a, const QString& tBar, const int id, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create tool.
+ * Insert QAction with id \a id from action map(myActionMap) to tool manager.
+ *\param a - QAction
+ *\param tBar - integer
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( const int id, const int tBar, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? id : -1;
}
+/*! Create tool.
+ * Insert QAction with id \a id from action map(myActionMap) to tool manager.
+ *\param a - QAction
+ *\param tBar - QString&
+ *\param id - integer
+ *\param idx - integer
+ *\retval integer id of new action in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createTool( const int id, const QString& tBar, const int idx )
{
if ( !toolMgr() )
return intId != -1 ? id : -1;
}
+/*! Create menu.
+ * Insert submenu \a subMenu to menu manager.
+ *\param subMenu - QString&
+ *\param menu - integer
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const QString& subMenu, const int menu,
const int id, const int group, const int index )
{
return menuMgr()->insert( subMenu, menu, group, index );
}
+/*! Create menu.
+ * Insert submenu \a subMenu to menu manager.
+ *\param subMenu - QString&
+ *\param menu - QString&
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const QString& subMenu, const QString& menu,
const int id, const int group, const int index )
{
return menuMgr()->insert( subMenu, menu, group, index );
}
+
+/*! Create menu. Register action \a a with id \a id.
+ * Insert QAction to menu manager.
+ *\param a - Qaction
+ *\param menu - integer
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( QAction* a, const int menu, const int id, const int group, const int index )
{
if ( !a || !menuMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create menu. Register action \a a with id \a id.
+ * Insert QAction to menu manager.
+ *\param a - Qaction
+ *\param menu - QString&
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( QAction* a, const QString& menu, const int id, const int group, const int index )
{
if ( !a || !menuMgr() )
return intId != -1 ? regId : -1;
}
+/*! Create menu.
+ * Insert QAction with id \a id from action map(myActionMap) to menu manager.
+ *\param menu - integer
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const int id, const int menu, const int group, const int index )
{
if ( !menuMgr() )
return intId != -1 ? id : -1;
}
+/*! Create menu.
+ * Insert QAction with id \a id from action map(myActionMap) to menu manager.
+ *\param menu - QString&
+ *\param id - integer
+ *\param group - integer
+ *\param index - integer
+ *\retval integer id of new menu in tool manager.
+ *\retval Return -1 if something wrong.
+ */
int CAM_Module::createMenu( const int id, const QString& menu, const int group, const int index )
{
if ( !menuMgr() )
{
return QtxActionMgr::separator();
}
+
+/*! Connect data model of module with active study */
+void CAM_Module::connectToStudy( CAM_Study* camStudy )
+{
+ CAM_Application* app = camStudy ? dynamic_cast<CAM_Application*>( camStudy->application() ) : 0;
+ if( !app )
+ return;
+
+ CAM_DataModel* prev = 0;
+ for( CAM_Application::ModuleListIterator it = app->modules(); it.current(); ++it )
+ {
+ CAM_DataModel* dm = it.current()->dataModel();
+ if( it.current() == this && !camStudy->containsDataModel( dm ) )
+ {
+ if( prev )
+ camStudy->insertDataModel( it.current()->dataModel(), prev );
+ else
+ camStudy->insertDataModel( it.current()->dataModel(), 0 );
+ }
+ prev = dm;
+ }
+}