Salome HOME
PAL14122: EDF307: GetInPlace --> COMM_FAILURE. Use new method GEOMAlgo_BuilderShape...
[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.com
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 "SUIT_Application.h"
32 #include "SalomeApp_Tools.h"
33
34
35 //================================================================
36 // Function : GEOM_Operation
37 // Purpose  : 
38 //================================================================
39 GEOM_Operation::GEOM_Operation( SUIT_Application* app, GEOM::GEOM_IOperations_ptr oper )
40 : SUIT_Operation( app )
41 {
42   myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
43 }
44
45 //================================================================
46 // Function : ~GEOM_Operation
47 // Purpose  : 
48 //================================================================
49 GEOM_Operation::~GEOM_Operation()
50 {
51 }
52
53 //================================================================
54 // Function : onStartOperation()
55 // Purpose  : Opens an internal transaction in GEOM engine
56 //================================================================
57 void GEOM_Operation::startOperation()
58 {
59   SUIT_Operation::startOperation();
60
61   if ( !myIOperation->_is_nil() ) {
62     try {
63       myIOperation->StartOperation();
64     }
65     catch( const SALOME::SALOME_Exception& e ) {
66       SalomeApp_Tools:: QtCatchCorbaException( e );
67     }
68   }
69 }
70
71 //================================================================
72 // Function : onFinishOperation
73 // Purpose  : Commits an internal transaction in GEOM engine
74 //================================================================
75 void GEOM_Operation::commitOperation()
76 {
77   SUIT_Operation::commitOperation();
78
79   if ( !myIOperation->_is_nil() ) {
80     try {
81       myIOperation->FinishOperation();
82     }
83     catch( const SALOME::SALOME_Exception& e ) {
84       SalomeApp_Tools:: QtCatchCorbaException( e );
85     }
86   }
87 }
88
89 //================================================================
90 // Function : onSuspendOperation
91 // Purpose  : 
92 //================================================================
93 void GEOM_Operation::suspendOperation()
94 {
95   SUIT_Operation::suspendOperation();
96 }
97
98 //================================================================
99 // Function : onResumeOperation
100 // Purpose  : 
101 //================================================================
102 void GEOM_Operation::resumeOperation()
103 {
104   SUIT_Operation::resumeOperation();
105 }
106
107 //================================================================
108 // Function : onAbortOperation
109 // Purpose  : Aborts an internal transaction in GEOM engine
110 //================================================================
111 void GEOM_Operation::abortOperation()
112 {
113   SUIT_Operation::abortOperation();
114
115   if ( !myIOperation->_is_nil() ) {
116     try {
117       myIOperation->AbortOperation();
118     }
119     catch( const SALOME::SALOME_Exception& e ) {
120       SalomeApp_Tools::QtCatchCorbaException( e );
121     }
122   }
123 }
124