SHAPER  9.12.0
SHAPERGUI Class Reference

An implementation of SALOME connector class for implementation of XGUI functionality as a module of SALOME. More...

Inheritance diagram for SHAPERGUI:
Inheritance graph

Public Slots

virtual bool activateModule (SUIT_Study *theStudy)
 The method is redefined to connect to the study viewer before the data model is filled by opened file. More...
 
virtual bool deactivateModule (SUIT_Study *theStudy)
 The method is called on the module activation. More...
 

Public Member Functions

virtual void initialize (CAM_Application *theApp)
 Initializing of the module. More...
 
virtual void windows (QMap< int, int > &theWndMap) const
 Definition of module standard windows. More...
 
virtual void viewManagers (QStringList &theList) const
 Definition of module viewer. More...
 
virtual void selectionChanged ()
 The method is called on selection changed event. More...
 
virtual QAction * addFeature (const QString &theWBName, const QString &theTBName, const QString &theId, const QString &theTitle, const QString &theTip, const QIcon &theIcon, const QKeySequence &theKeys, bool isCheckable, const bool isAddSeparator, const QString &theStatusTip)
 Creates a feature (command) in SALOME desktop. More...
 
virtual QAction * addFeature (const QString &theWBName, const ActionInfo &theInfo, const bool isAddSeparator)
 Add feature (QAction) in the theWBName toolbar with given theInfo about action. More...
 
virtual QAction * addFeatureOfNested (const QString &theWBName, const ActionInfo &theInfo, const QList< QAction * > &theNestedActions)
 Add a nested feature. More...
 
virtual bool isFeatureOfNested (const QAction *theAction)
 Returns true if the feature action is a nested action, in other words, it is created by addNestedFeature(). More...
 
virtual QAction * addDesktopCommand (const QString &theId, const QString &theTitle, const QString &theTip, const QIcon &theIcon, const QKeySequence &theKeys, bool isCheckable, const char *theMenuSourceText, const QString &theSubMenu=QString(), const int theMenuPosition=10, const int theSuibMenuPosition=-1) Standard_OVERRIDE
 Creates a command in Edit menu of SALOME desktop. More...
 
virtual void addDesktopMenuSeparator (const char *theMenuSourceText, const int theMenuPosition=10)
 Insert separator into Edit menu of SALOME desktop. More...
 
virtual bool addActionInToolbar (QAction *theAction, const QString &theToolBarTitle)
 Add an action to a tool bar. More...
 
virtual void createFeatureActions ()
 Creates menu/tool bar actions for loaded features stored in the menu manager. More...
 
virtual QMainWindow * desktop () const
 Returns desktop window of SALOME. More...
 
virtual void setFeatureInfo (const QString &theFeatureId, const std::shared_ptr< Config_FeatureMessage > &theMessage)
 Stores XML information for the feature kind. More...
 
virtual std::shared_ptr< Config_FeatureMessagefeatureInfo (const QString &theFeatureId)
 Returns XML information for the feature kind. More...
 
virtual ModuleBase_IViewerviewer () const
 Returns interface to Salome viewer. More...
 
virtual QList< QAction * > commandList () const
 Returns list of defined actions (just by SHAPER module) More...
 
virtual void contextMenuPopup (const QString &theClient, QMenu *theMenu, QString &theTitle)
 Redefinition of virtual function. More...
 
virtual void createPreferences ()
 Redefinition of virtual function for preferences creation. More...
 
virtual void preferencesChanged (const QString &theSection, const QString &theParam)
 Redefinition of virtual function for preferences changed event. More...
 
virtual void putInfo (const QString &theInfo, const int theMSecs=0)
 Shows the given text in status bar as a permanent text \theInfo a string value \theMsecs interval of msec milliseconds when the message will be hidden, if -1, it stays. More...
 
XGUI_Workshopworkshop () const
 
void setIsOpened (bool theOpened)
 Set flag about opened document state. More...
 
virtual void updateModuleVisibilityState ()
 
QIntList shaperActions () const
 Returns list of the module commands. More...
 
QMap< QString, QIntList > shaperToolbars () const
 Returns structure of tool bars. More...
 
QIntList getFreeCommands () const
 Returns free commands which are not in toolbars in the module. More...
 
QMap< QString, QIntList > defaultToolbars () const
 Returns structure of default tool bars. More...
 
void resetToolbars ()
 
void publishToStudy ()
 
virtual void updateInfoPanel ()
 

Protected Slots

virtual void onViewManagerAdded (SUIT_ViewManager *theMgr)
 Redefinition of virtual function. More...
 
virtual void onViewManagerRemoved (SUIT_ViewManager *theMgr)
 Redefinition of virtual function. More...
 
void onDefaultPreferences ()
 Set preferences to default. More...
 
void onScriptLoaded ()
 Hide object browser if it was created during loading script. More...
 
void onSaveDocByShaper ()
 Save application functionality with additional processing of aborting the current operation. More...
 
void onSaveAsDocByShaper ()
 Save application functionality with additional processing of aborting the current operation. More...
 
void onUpdateCommandStatus ()
 Obtains the current application and updates its actions. More...
 
virtual void logShaperGUIEvent ()
 The method is called on any GUI action. More...
 

Protected Member Functions

CAM_DataModel * createDataModel ()
 Create data model. More...
 
virtual QtxPopupMgr * popupMgr ()
 Create popup menu manager. More...
 
virtual bool abortAllOperations ()
 Abort all operations. More...
 

Detailed Description

An implementation of SALOME connector class for implementation of XGUI functionality as a module of SALOME.

Member Function Documentation

◆ initialize()

void SHAPERGUI::initialize ( CAM_Application *  theApp)
virtual

Initializing of the module.

Parameters
theAppapplication instance

◆ windows()

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

Definition of module standard windows.

◆ viewManagers()

void SHAPERGUI::viewManagers ( QStringList &  theList) const
virtual

Definition of module viewer.

◆ selectionChanged()

void SHAPERGUI::selectionChanged ( )
virtual

The method is called on selection changed event.

◆ addFeature() [1/2]

QAction * SHAPERGUI::addFeature ( const QString &  theWBName,
const QString &  theTBName,
const QString &  theId,
const QString &  theTitle,
const QString &  theTip,
const QIcon &  theIcon,
const QKeySequence &  theKeys,
bool  isCheckable,
const bool  isAddSeparator,
const QString &  theStatusTip 
)
virtual

Creates a feature (command) in SALOME desktop.

Parameters
theWBName- a workbench name
theTBName- a toolbar name
theId- an id of the feature
theTitle- a menu item string
theTip- a tooltip string (help)
theIcon- icon
isCheckable- is checkable or not
theKeys- hot keys
isAddSeparatorboolean flag about adding separator after the action returns created action

Implements XGUI_SalomeConnector.

◆ addFeature() [2/2]

QAction * SHAPERGUI::addFeature ( const QString &  theWBName,
const ActionInfo theInfo,
const bool  isAddSeparator 
)
virtual

Add feature (QAction) in the theWBName toolbar with given theInfo about action.

Implements XGUI_SalomeConnector.

◆ addFeatureOfNested()

QAction * SHAPERGUI::addFeatureOfNested ( const QString &  theWBName,
const ActionInfo theInfo,
const QList< QAction * > &  theNestedActions 
)
virtual

Add a nested feature.

Parameters
theWBNamea workbench name
theInfothe action parameters
theNestedActionsa list of nested actions

nested action is always separated of others

nested action is always separated of others

Implements XGUI_SalomeConnector.

◆ isFeatureOfNested()

bool SHAPERGUI::isFeatureOfNested ( const QAction *  theAction)
virtual

Returns true if the feature action is a nested action, in other words, it is created by addNestedFeature().

Parameters
theAction- an action of a feature returns boolean result

Implements XGUI_SalomeConnector.

◆ addDesktopCommand()

QAction * SHAPERGUI::addDesktopCommand ( const QString &  theId,
const QString &  theTitle,
const QString &  theTip,
const QIcon &  theIcon,
const QKeySequence &  theKeys,
bool  isCheckable,
const char *  theMenuSourceText,
const QString &  theSubMenu = QString(),
const int  theMenuPosition = 10,
const int  theSuibMenuPosition = -1 
)
virtual

Creates a command in Edit menu of SALOME desktop.

Parameters
theId- an id of the feature
theTitle- a menu item string
theTip- a tooltip string (help)
theIcon- icon
isCheckable- is checkable or not
theKeys- hot keys
theMenuSourceText- a source text of the desktop menu
theSubMenu- a sub-menu name
theMenuPosition- a position of the command in the desktop menu
theSuibMenuPosition- a position of the sub-menu in the desktop menu returns created action

Implements XGUI_SalomeConnector.

◆ addDesktopMenuSeparator()

void SHAPERGUI::addDesktopMenuSeparator ( const char *  theMenuSourceText,
const int  theMenuPosition = 10 
)
virtual

Insert separator into Edit menu of SALOME desktop.

Implements XGUI_SalomeConnector.

◆ addActionInToolbar()

bool SHAPERGUI::addActionInToolbar ( QAction *  theAction,
const QString &  theToolBarTitle 
)
virtual

Add an action to a tool bar.

Parameters
theActionan ation to add
theToolBarTitlea name of tool bar

Implements XGUI_SalomeConnector.

◆ createFeatureActions()

void SHAPERGUI::createFeatureActions ( )
virtual

Creates menu/tool bar actions for loaded features stored in the menu manager.

Implements XGUI_SalomeConnector.

◆ desktop()

QMainWindow * SHAPERGUI::desktop ( ) const
virtual

Returns desktop window of SALOME.

Implements XGUI_SalomeConnector.

◆ setFeatureInfo()

void SHAPERGUI::setFeatureInfo ( const QString &  theFeatureId,
const std::shared_ptr< Config_FeatureMessage > &  theMessage 
)
virtual

Stores XML information for the feature kind.

Parameters
theFeatureIda feature kind
theMessagea container of the feature XML properties

Implements XGUI_SalomeConnector.

◆ featureInfo()

std::shared_ptr< Config_FeatureMessage > SHAPERGUI::featureInfo ( const QString &  theFeatureId)
virtual

Returns XML information for the feature kind.

Parameters
theFeatureIda feature kind
Returns
theMessage a container of the feature XML properties

Implements XGUI_SalomeConnector.

◆ viewer()

virtual ModuleBase_IViewer* SHAPERGUI::viewer ( ) const
inlinevirtual

Returns interface to Salome viewer.

Implements XGUI_SalomeConnector.

◆ commandList()

QList< QAction * > SHAPERGUI::commandList ( ) const
virtual

Returns list of defined actions (just by SHAPER module)

Implements XGUI_SalomeConnector.

◆ contextMenuPopup()

void SHAPERGUI::contextMenuPopup ( const QString &  theClient,
QMenu theMenu,
QString &  theTitle 
)
virtual

Redefinition of virtual function.

Parameters
theClientname of pop-up client
theMenupopup menu instance
theTitlemenu title.

◆ createPreferences()

void SHAPERGUI::createPreferences ( )
virtual

Redefinition of virtual function for preferences creation.

Implements XGUI_SalomeConnector.

◆ preferencesChanged()

void SHAPERGUI::preferencesChanged ( const QString &  theSection,
const QString &  theParam 
)
virtual

Redefinition of virtual function for preferences changed event.

◆ putInfo()

void SHAPERGUI::putInfo ( const QString &  theInfo,
const int  theMSecs = 0 
)
virtual

Shows the given text in status bar as a permanent text \theInfo a string value \theMsecs interval of msec milliseconds when the message will be hidden, if -1, it stays.

Implements XGUI_SalomeConnector.

◆ workshop()

XGUI_Workshop* SHAPERGUI::workshop ( ) const
inline
Returns
Workshop class instance

◆ setIsOpened()

void SHAPERGUI::setIsOpened ( bool  theOpened)
inline

Set flag about opened document state.

◆ shaperActions()

QIntList SHAPERGUI::shaperActions ( ) const
inline

Returns list of the module commands.

◆ shaperToolbars()

QMap<QString, QIntList> SHAPERGUI::shaperToolbars ( ) const
inline

Returns structure of tool bars.

◆ getFreeCommands()

QIntList SHAPERGUI::getFreeCommands ( ) const

Returns free commands which are not in toolbars in the module.

◆ defaultToolbars()

QMap<QString, QIntList> SHAPERGUI::defaultToolbars ( ) const
inline

Returns structure of default tool bars.

◆ activateModule

bool SHAPERGUI::activateModule ( SUIT_Study *  theStudy)
virtualslot

The method is redefined to connect to the study viewer before the data model is filled by opened file.

This file open will flush redisplay signals for, objects which should be visualized

The method is called on the module activation

Parameters
theStudycurrent study

◆ deactivateModule

bool SHAPERGUI::deactivateModule ( SUIT_Study *  theStudy)
virtualslot

The method is called on the module activation.

Parameters
theStudycurrent study

◆ onViewManagerAdded

void SHAPERGUI::onViewManagerAdded ( SUIT_ViewManager *  theMgr)
protectedvirtualslot

Redefinition of virtual function.

Parameters
theMgrview manager

◆ onViewManagerRemoved

void SHAPERGUI::onViewManagerRemoved ( SUIT_ViewManager *  theMgr)
protectedvirtualslot

Redefinition of virtual function.

Parameters
theMgrview manager

◆ onDefaultPreferences

void SHAPERGUI::onDefaultPreferences ( )
protectedslot

Set preferences to default.

◆ onScriptLoaded

void SHAPERGUI::onScriptLoaded ( )
protectedslot

Hide object browser if it was created during loading script.

◆ onSaveDocByShaper

void SHAPERGUI::onSaveDocByShaper ( )
protectedslot

Save application functionality with additional processing of aborting the current operation.

◆ onSaveAsDocByShaper

void SHAPERGUI::onSaveAsDocByShaper ( )
protectedslot

Save application functionality with additional processing of aborting the current operation.

◆ onUpdateCommandStatus

void SHAPERGUI::onUpdateCommandStatus ( )
protectedslot

Obtains the current application and updates its actions.

◆ logShaperGUIEvent

void SHAPERGUI::logShaperGUIEvent ( )
protectedvirtualslot

The method is called on any GUI action.

◆ createDataModel()

CAM_DataModel * SHAPERGUI::createDataModel ( )
protected

Create data model.

◆ popupMgr()

QtxPopupMgr * SHAPERGUI::popupMgr ( )
protectedvirtual

Create popup menu manager.

◆ abortAllOperations()

bool SHAPERGUI::abortAllOperations ( )
protectedvirtual

Abort all operations.