Salome HOME
Update copyright information
[modules/geom.git] / src / GEOMBase / GEOM_Operation.cxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  GEOM GEOMGUI : GUI for Geometry component
23 //  File   : GEOM_Operation.cxx
24 //  Author : Sergey ANIKIN
25 //  Module : GEOM
26 //  $Header$
27 //
28 #include "GEOM_Operation.h"
29
30 #include "SUIT_Application.h"
31 #include "SalomeApp_Tools.h"
32
33
34 //================================================================
35 // Function : GEOM_Operation
36 // Purpose  : 
37 //================================================================
38 GEOM_Operation::GEOM_Operation( SUIT_Application* app, GEOM::GEOM_IOperations_ptr oper )
39 : SUIT_Operation( app )
40 {
41   myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
42 }
43
44 //================================================================
45 // Function : ~GEOM_Operation
46 // Purpose  : 
47 //================================================================
48 GEOM_Operation::~GEOM_Operation()
49 {
50 }
51
52 //================================================================
53 // Function : onStartOperation()
54 // Purpose  : Opens an internal transaction in GEOM engine
55 //================================================================
56 void GEOM_Operation::startOperation()
57 {
58   SUIT_Operation::startOperation();
59
60   if ( !myIOperation->_is_nil() ) {
61     try {
62       myIOperation->StartOperation();
63     }
64     catch( const SALOME::SALOME_Exception& e ) {
65       SalomeApp_Tools:: QtCatchCorbaException( e );
66     }
67   }
68 }
69
70 //================================================================
71 // Function : onFinishOperation
72 // Purpose  : Commits an internal transaction in GEOM engine
73 //================================================================
74 void GEOM_Operation::commitOperation()
75 {
76   SUIT_Operation::commitOperation();
77
78   if ( !myIOperation->_is_nil() ) {
79     try {
80       myIOperation->FinishOperation();
81     }
82     catch( const SALOME::SALOME_Exception& e ) {
83       SalomeApp_Tools:: QtCatchCorbaException( e );
84     }
85   }
86 }
87
88 //================================================================
89 // Function : onSuspendOperation
90 // Purpose  : 
91 //================================================================
92 void GEOM_Operation::suspendOperation()
93 {
94   SUIT_Operation::suspendOperation();
95 }
96
97 //================================================================
98 // Function : onResumeOperation
99 // Purpose  : 
100 //================================================================
101 void GEOM_Operation::resumeOperation()
102 {
103   SUIT_Operation::resumeOperation();
104 }
105
106 //================================================================
107 // Function : onAbortOperation
108 // Purpose  : Aborts an internal transaction in GEOM engine
109 //================================================================
110 void GEOM_Operation::abortOperation()
111 {
112   SUIT_Operation::abortOperation();
113
114   if ( !myIOperation->_is_nil() ) {
115     try {
116       myIOperation->AbortOperation();
117     }
118     catch( const SALOME::SALOME_Exception& e ) {
119       SalomeApp_Tools::QtCatchCorbaException( e );
120     }
121   }
122 }
123