1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File : GEOM_Operation.cxx
25 // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
27 #include "GEOM_Operation.h"
29 #include <SUIT_Application.h>
30 #include <SalomeApp_Tools.h>
33 //================================================================
34 // Function : GEOM_Operation
36 //================================================================
37 GEOM_Operation::GEOM_Operation( SUIT_Application* app, GEOM::GEOM_IOperations_ptr oper )
38 : SUIT_Operation( app )
40 myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
43 //================================================================
44 // Function : ~GEOM_Operation
46 //================================================================
47 GEOM_Operation::~GEOM_Operation()
51 //================================================================
52 // Function : onStartOperation()
53 // Purpose : Opens an internal transaction in GEOM engine
54 //================================================================
55 void GEOM_Operation::startOperation()
57 SUIT_Operation::startOperation();
59 if ( !myIOperation->_is_nil() ) {
61 myIOperation->StartOperation();
64 catch ( const SALOME::SALOME_Exception& e ) {
65 SalomeApp_Tools:: QtCatchCorbaException( e );
70 //================================================================
71 // Function : onFinishOperation
72 // Purpose : Commits an internal transaction in GEOM engine
73 //================================================================
74 void GEOM_Operation::commitOperation()
76 SUIT_Operation::commitOperation();
78 if ( state() != Running )
81 if ( !myIOperation->_is_nil() ) {
83 myIOperation->FinishOperation();
86 catch ( const SALOME::SALOME_Exception& e ) {
87 SalomeApp_Tools:: QtCatchCorbaException( e );
92 //================================================================
93 // Function : onSuspendOperation
95 //================================================================
96 void GEOM_Operation::suspendOperation()
98 SUIT_Operation::suspendOperation();
101 //================================================================
102 // Function : onResumeOperation
104 //================================================================
105 void GEOM_Operation::resumeOperation()
107 SUIT_Operation::resumeOperation();
110 //================================================================
111 // Function : onAbortOperation
112 // Purpose : Aborts an internal transaction in GEOM engine
113 //================================================================
114 void GEOM_Operation::abortOperation()
116 SUIT_Operation::abortOperation();
118 if ( !myIOperation->_is_nil() ) {
120 myIOperation->AbortOperation();
122 catch ( const SALOME::SALOME_Exception& e ) {
123 SalomeApp_Tools::QtCatchCorbaException( e );