1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #ifndef _GEOM_IOperations_HXX_
22 #define _GEOM_IOperations_HXX_
24 #include "GEOM_Engine.hxx"
25 #include <TDocStd_Document.hxx>
26 #include <TCollection_AsciiString.hxx>
27 #include "GEOM_Object.hxx"
28 #include "GEOM_Solver.hxx"
30 #define OK "PAL_NO_ERROR"
31 #define KO "PAL_NOT_DONE_ERROR"
32 #define ALREADY_PRESENT "PAL_ELEMENT_ALREADY_PRESENT"
33 #define NOT_EXISTS "PAL_ELEMENT_DOES_NOT_EXISTS"
34 #define INVALID_TYPE "INVALID_TYPE_OF_ELEMENT"
36 class GEOM_IOperations
39 Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID);
40 Standard_EXPORT ~GEOM_IOperations();
42 //Starts a new operation (opens a tansaction)
43 Standard_EXPORT void StartOperation();
45 //Finishes the previously started operation (closes the transaction)
46 Standard_EXPORT void FinishOperation();
48 //Aborts the operation
49 Standard_EXPORT void AbortOperation();
51 //Returns true if the last operation succided
52 Standard_EXPORT bool IsDone();
54 //Sets Not done error code
55 Standard_EXPORT void SetNotDone() { _errorCode = KO; }
57 //Sets an error code of the operation
58 Standard_EXPORT void SetErrorCode(const TCollection_AsciiString& theErrorCode) {
59 _errorCode = theErrorCode;
62 //Returns an error code of the last operatioin
63 Standard_EXPORT char* GetErrorCode() {
64 return _errorCode.ToCString();
67 //Returns a pointer to GEOM_Engine which this operation interface is associated
68 Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; }
70 //Return a pointer to Solver associated with this operation interface
71 Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
73 //Returns an ID of the OCAF document where this operation stores the data
74 Standard_EXPORT int GetDocID() { return _docID; }
78 TCollection_AsciiString _errorCode;