From ce2513eb44918678fcfc931a0f8a6bae715f174b Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 13 Jan 2006 09:53:11 +0000 Subject: [PATCH] PAL10953. Add switchToOperation() --- src/SMESHGUI/SMESHGUI.cxx | 14 ++++++++++++++ src/SMESHGUI/SMESHGUI.h | 1 + 2 files changed, 15 insertions(+) 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* ); -- 2.30.2