1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2004 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.
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
22 // File : GEOM_Operation.cxx
23 // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
26 #include "GEOM_Operation.h"
28 #include <SUIT_Application.h>
29 #include <SalomeApp_Tools.h>
32 //================================================================
33 // Function : GEOM_Operation
35 //================================================================
36 GEOM_Operation::GEOM_Operation( SUIT_Application* app, GEOM::GEOM_IOperations_ptr oper )
37 : SUIT_Operation( app )
39 myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
42 //================================================================
43 // Function : ~GEOM_Operation
45 //================================================================
46 GEOM_Operation::~GEOM_Operation()
50 //================================================================
51 // Function : onStartOperation()
52 // Purpose : Opens an internal transaction in GEOM engine
53 //================================================================
54 void GEOM_Operation::startOperation()
56 SUIT_Operation::startOperation();
58 if ( !myIOperation->_is_nil() ) {
60 myIOperation->StartOperation();
62 catch ( const SALOME::SALOME_Exception& e ) {
63 SalomeApp_Tools:: QtCatchCorbaException( e );
68 //================================================================
69 // Function : onFinishOperation
70 // Purpose : Commits an internal transaction in GEOM engine
71 //================================================================
72 void GEOM_Operation::commitOperation()
74 SUIT_Operation::commitOperation();
76 if ( !myIOperation->_is_nil() ) {
78 myIOperation->FinishOperation();
80 catch ( const SALOME::SALOME_Exception& e ) {
81 SalomeApp_Tools:: QtCatchCorbaException( e );
86 //================================================================
87 // Function : onSuspendOperation
89 //================================================================
90 void GEOM_Operation::suspendOperation()
92 SUIT_Operation::suspendOperation();
95 //================================================================
96 // Function : onResumeOperation
98 //================================================================
99 void GEOM_Operation::resumeOperation()
101 SUIT_Operation::resumeOperation();
104 //================================================================
105 // Function : onAbortOperation
106 // Purpose : Aborts an internal transaction in GEOM engine
107 //================================================================
108 void GEOM_Operation::abortOperation()
110 SUIT_Operation::abortOperation();
112 if ( !myIOperation->_is_nil() ) {
114 myIOperation->AbortOperation();
116 catch ( const SALOME::SALOME_Exception& e ) {
117 SalomeApp_Tools::QtCatchCorbaException( e );