Salome HOME
PAL10953. Add switchToOperation()
authoreap <eap@opencascade.com>
Fri, 13 Jan 2006 09:53:11 +0000 (09:53 +0000)
committereap <eap@opencascade.com>
Fri, 13 Jan 2006 09:53:11 +0000 (09:53 +0000)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h

index fae703982cd56cbae253f5ed124aec9a3f6db4ae..0f727c079681ce3168c3eb90b1ed9e6e03ef86da 100644 (file)
@@ -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 )
index 595d831e731b7974ca902a2a457a40b98f22489f..9626e4358b923689573c11c2d1b541d562507609 100644 (file)
@@ -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* );