1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef _GEOM_IOperations_HXX_
23 #define _GEOM_IOperations_HXX_
25 #include "GEOM_Engine.hxx"
26 #include <TDocStd_Document.hxx>
27 #include <TCollection_AsciiString.hxx>
28 #include "GEOM_Object.hxx"
29 #include "GEOM_Solver.hxx"
31 #define OK "PAL_NO_ERROR"
32 #define KO "PAL_NOT_DONE_ERROR"
33 #define NOT_FOUND_ANY "NOT_FOUND_ANY"
34 #define ALREADY_PRESENT "PAL_ELEMENT_ALREADY_PRESENT"
35 #define NOT_EXISTS "PAL_ELEMENT_DOES_NOT_EXISTS"
36 #define INVALID_TYPE "INVALID_TYPE_OF_ELEMENT"
38 class GEOM_IOperations
41 Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID);
42 Standard_EXPORT ~GEOM_IOperations();
44 //Starts a new operation (opens a tansaction)
45 Standard_EXPORT void StartOperation();
47 //Finishes the previously started operation (closes the transaction)
48 Standard_EXPORT void FinishOperation();
50 //Aborts the operation
51 Standard_EXPORT void AbortOperation();
53 //Returns true if the last operation succided
54 Standard_EXPORT bool IsDone();
56 //Sets Not done error code
57 Standard_EXPORT void SetNotDone() { _errorCode = KO; }
59 //Sets an error code of the operation
60 Standard_EXPORT void SetErrorCode(const TCollection_AsciiString& theErrorCode) {
61 _errorCode = theErrorCode;
64 //Returns an error code of the last operatioin
65 Standard_EXPORT char* GetErrorCode() {
66 return (char*) _errorCode.ToCString();
69 //Returns a pointer to GEOM_Engine which this operation interface is associated
70 Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; }
72 //Return a pointer to Solver associated with this operation interface
73 Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
75 //Returns an ID of the OCAF document where this operation stores the data
76 Standard_EXPORT int GetDocID() { return _docID; }
80 TCollection_AsciiString _errorCode;