From: eap Date: Fri, 13 Jan 2006 09:53:11 +0000 (+0000) Subject: PAL10953. Add switchToOperation() X-Git-Tag: T_Before_Join_BR-D5-38-2003~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ce2513eb44918678fcfc931a0f8a6bae715f174b;p=modules%2Fsmesh.git PAL10953. Add switchToOperation() --- diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index fae703982..0f727c079 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3083,6 +3083,20 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const return op; } +//================================================================================ +/*! + * \brief Stops current operations and starts a given one + * \param id - The id of the operation to start + */ +//================================================================================ + +void SMESHGUI::switchToOperation(int id) +{ + if ( _PTR(Study) aStudy = SMESH::GetActiveStudyDocument() ) + activeStudy()->abortAllOperations(); + startOperation( id ); +} + LightApp_Displayer* SMESHGUI::displayer() { if( !myDisplayer ) diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 595d831e7..9626e4358 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -83,6 +83,7 @@ public : void ResetState() ; void SetState(int aState) ; bool DefineDlgPosition(QWidget* aDlg, int& x, int& y) ; + void switchToOperation(int id) ; virtual bool OnGUIEvent ( int id ); virtual bool OnMousePress ( QMouseEvent*, SUIT_ViewWindow* );