Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/geom.git] / src / GEOMBase / GEOM_Operation.cxx
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2004  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.org 
21 //
22 //
23 //
24 //  File   : GEOM_Operation.cxx
25 //  Author : Sergey ANIKIN
26 //  Module : GEOM
27 //  $Header$
28
29 #include "GEOM_Operation.h"
30
31 #include "SALOMEGUI_QtCatchCorbaException.hxx"
32
33 //================================================================
34 // Function : GEOM_Operation
35 // Purpose  : 
36 //================================================================
37 GEOM_Operation::GEOM_Operation( QAD_Study* doc, GEOM::GEOM_IOperations_ptr oper )
38 : QAD_Operation( doc )
39 {
40   myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
41 }
42
43 //================================================================
44 // Function : ~GEOM_Operation
45 // Purpose  : 
46 //================================================================
47 GEOM_Operation::~GEOM_Operation()
48 {
49 }
50
51 //================================================================
52 // Function : onStartOperation()
53 // Purpose  : Opens an internal transaction in GEOM engine
54 //================================================================
55 void GEOM_Operation::onStartOperation()
56 {
57   QAD_Operation::onStartOperation();
58
59   if ( !myIOperation->_is_nil() ) {
60     try {
61       myIOperation->StartOperation();
62     }
63     catch( const SALOME::SALOME_Exception& e ) {
64       QtCatchCorbaException( e );
65     }
66   }
67 }
68
69 //================================================================
70 // Function : onFinishOperation
71 // Purpose  : Commits an internal transaction in GEOM engine
72 //================================================================
73 void GEOM_Operation::onFinishOperation()
74 {
75   QAD_Operation::onFinishOperation();
76
77   if ( !myIOperation->_is_nil() ) {
78     try {
79       myIOperation->FinishOperation();
80     }
81     catch( const SALOME::SALOME_Exception& e ) {
82       QtCatchCorbaException( e );
83     }
84   }
85 }
86
87 //================================================================
88 // Function : onSuspendOperation
89 // Purpose  : 
90 //================================================================
91 void GEOM_Operation::onSuspendOperation()
92 {
93   QAD_Operation::onSuspendOperation();
94 }
95
96 //================================================================
97 // Function : onResumeOperation
98 // Purpose  : 
99 //================================================================
100 void GEOM_Operation::onResumeOperation()
101 {
102   QAD_Operation::onResumeOperation();
103 }
104
105 //================================================================
106 // Function : onAbortOperation
107 // Purpose  : Aborts an internal transaction in GEOM engine
108 //================================================================
109 void GEOM_Operation::onAbortOperation()
110 {
111   QAD_Operation::onAbortOperation();
112
113   if ( !myIOperation->_is_nil() ) {
114     try {
115       myIOperation->AbortOperation();
116     }
117     catch( const SALOME::SALOME_Exception& e ) {
118       QtCatchCorbaException( e );
119     }
120   }
121 }
122