Back to index

salome-geom  6.5.0
GEOM_Operation.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // GEOM GEOMGUI : GUI for Geometry component
00024 // File   : GEOM_Operation.cxx
00025 // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
00026 //
00027 #include "GEOM_Operation.h"
00028 
00029 #include <SUIT_Application.h>
00030 #include <SalomeApp_Tools.h>
00031 
00032 
00033 //================================================================
00034 // Function : GEOM_Operation
00035 // Purpose  : 
00036 //================================================================
00037 GEOM_Operation::GEOM_Operation( SUIT_Application* app, GEOM::GEOM_IOperations_ptr oper )
00038 : SUIT_Operation( app )
00039 {
00040   myIOperation = GEOM::GEOM_IOperations::_narrow( oper );
00041 }
00042 
00043 //================================================================
00044 // Function : ~GEOM_Operation
00045 // Purpose  : 
00046 //================================================================
00047 GEOM_Operation::~GEOM_Operation()
00048 {
00049 }
00050 
00051 //================================================================
00052 // Function : onStartOperation()
00053 // Purpose  : Opens an internal transaction in GEOM engine
00054 //================================================================
00055 void GEOM_Operation::startOperation()
00056 {
00057   SUIT_Operation::startOperation();
00058 
00059   if ( !myIOperation->_is_nil() ) {
00060     try {
00061       myIOperation->StartOperation();
00062     }
00063     catch ( const SALOME::SALOME_Exception& e ) {
00064       SalomeApp_Tools:: QtCatchCorbaException( e );
00065     }
00066   }
00067 }
00068 
00069 //================================================================
00070 // Function : onFinishOperation
00071 // Purpose  : Commits an internal transaction in GEOM engine
00072 //================================================================
00073 void GEOM_Operation::commitOperation()
00074 {
00075   SUIT_Operation::commitOperation();
00076 
00077   if ( !myIOperation->_is_nil() ) {
00078     try {
00079       myIOperation->FinishOperation();
00080     }
00081     catch ( const SALOME::SALOME_Exception& e ) {
00082       SalomeApp_Tools:: QtCatchCorbaException( e );
00083     }
00084   }
00085 }
00086 
00087 //================================================================
00088 // Function : onSuspendOperation
00089 // Purpose  : 
00090 //================================================================
00091 void GEOM_Operation::suspendOperation()
00092 {
00093   SUIT_Operation::suspendOperation();
00094 }
00095 
00096 //================================================================
00097 // Function : onResumeOperation
00098 // Purpose  : 
00099 //================================================================
00100 void GEOM_Operation::resumeOperation()
00101 {
00102   SUIT_Operation::resumeOperation();
00103 }
00104 
00105 //================================================================
00106 // Function : onAbortOperation
00107 // Purpose  : Aborts an internal transaction in GEOM engine
00108 //================================================================
00109 void GEOM_Operation::abortOperation()
00110 {
00111   SUIT_Operation::abortOperation();
00112 
00113   if ( !myIOperation->_is_nil() ) {
00114     try {
00115       myIOperation->AbortOperation();
00116     }
00117     catch ( const SALOME::SALOME_Exception& e ) {
00118       SalomeApp_Tools::QtCatchCorbaException( e );
00119     }
00120   }
00121 }
00122