1 // Copyright (C) 2007-2008 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.
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 // GEOM GEOMGUI : GUI for Geometry component
23 // File : GEOM_Operation.cxx
24 // Author : Sergey ANIKIN
28 #include "GEOM_Operation.h"
30 #include "SUIT_Application.h"
31 #include "SalomeApp_Tools.h"
34 //================================================================
35 // Function : GEOM_Operation
37 //================================================================
38 GEOM_Operation::GEOM_Operation( SUIT_Application* app, GEOM::GEOM_IOperations_ptr oper )
39 : SUIT_Operation( app )
41 myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
44 //================================================================
45 // Function : ~GEOM_Operation
47 //================================================================
48 GEOM_Operation::~GEOM_Operation()
52 //================================================================
53 // Function : onStartOperation()
54 // Purpose : Opens an internal transaction in GEOM engine
55 //================================================================
56 void GEOM_Operation::startOperation()
58 SUIT_Operation::startOperation();
60 if ( !myIOperation->_is_nil() ) {
62 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 ( !myIOperation->_is_nil() ) {
80 myIOperation->FinishOperation();
82 catch( const SALOME::SALOME_Exception& e ) {
83 SalomeApp_Tools:: QtCatchCorbaException( e );
88 //================================================================
89 // Function : onSuspendOperation
91 //================================================================
92 void GEOM_Operation::suspendOperation()
94 SUIT_Operation::suspendOperation();
97 //================================================================
98 // Function : onResumeOperation
100 //================================================================
101 void GEOM_Operation::resumeOperation()
103 SUIT_Operation::resumeOperation();
106 //================================================================
107 // Function : onAbortOperation
108 // Purpose : Aborts an internal transaction in GEOM engine
109 //================================================================
110 void GEOM_Operation::abortOperation()
112 SUIT_Operation::abortOperation();
114 if ( !myIOperation->_is_nil() ) {
116 myIOperation->AbortOperation();
118 catch( const SALOME::SALOME_Exception& e ) {
119 SalomeApp_Tools::QtCatchCorbaException( e );