Back to index

salome-geom  6.5.0
GEOM_IOperations.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 #include <Standard_Stream.hxx>
00024 
00025 #include <GEOM_IOperations.hxx>
00026 
00027 #include "utilities.h"
00028 #include <OpUtil.hxx>
00029 #include <Utils_ExceptHandlers.hxx>
00030 
00031 #include <TDataStd_TreeNode.hxx>
00032 #include <TDataStd_ChildNodeIterator.hxx>
00033 #include <TDF_TagSource.hxx>
00034 
00035 //=============================================================================
00039 //=============================================================================
00040 
00041 GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine, int theDocID)
00042 : _engine(theEngine), _docID(theDocID)
00043 {
00044   _solver = new GEOM_Solver(theEngine);
00045 }
00046 
00047 //=============================================================================
00051 //=============================================================================
00052 
00053 GEOM_IOperations::~GEOM_IOperations()
00054 {
00055   delete _solver;
00056   MESSAGE("GEOM_IOperations::~GEOM_IOperations");
00057 }
00058 
00059 
00060 //=============================================================================
00064 //=============================================================================   
00065 void GEOM_IOperations::StartOperation()
00066 {
00067   Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
00068   if(aDoc->GetUndoLimit() > 0) 
00069     aDoc->NewCommand();
00070 }
00071 
00072  //=============================================================================
00076 //=============================================================================      
00077 void GEOM_IOperations::FinishOperation()
00078 {
00079   Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
00080   if(aDoc->GetUndoLimit() > 0) 
00081     aDoc->CommitCommand();
00082 }
00083 
00084 //=============================================================================
00088 //=============================================================================   
00089 void GEOM_IOperations::AbortOperation()
00090 {
00091   Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
00092   aDoc->AbortCommand();
00093 }
00094    
00095    
00096 //=============================================================================
00100 //=============================================================================
00101 bool GEOM_IOperations::IsDone()
00102 {
00103   return (_errorCode == OK);
00104 }  
00105 
00106