2 #ifndef _GEOM_IOperations_HXX_
3 #define _GEOM_IOperations_HXX_
5 #include "GEOM_Engine.hxx"
6 #include <TDocStd_Document.hxx>
7 #include <TCollection_AsciiString.hxx>
8 #include "GEOM_Object.hxx"
9 #include "GEOM_Solver.hxx"
11 #define OK "PAL_NO_ERROR"
12 #define KO "PAL_NOT_DONE_ERROR"
13 #define ALREADY_PRESENT "PAL_ELEMENT_ALREADY_PRESENT"
14 #define NOT_EXISTS "PAL_ELEMENT_DOES_NOT_EXISTS"
15 #define INVALID_TYPE "INVALID_TYPE_OF_ELEMENT"
17 class GEOM_IOperations
20 Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID);
21 Standard_EXPORT ~GEOM_IOperations();
23 //Starts a new operation (opens a tansaction)
24 Standard_EXPORT void StartOperation();
26 //Finishes the previously started operation (closes the transaction)
27 Standard_EXPORT void FinishOperation();
29 //Aborts the operation
30 Standard_EXPORT void AbortOperation();
32 //Returns true if the last operation succided
33 Standard_EXPORT bool IsDone();
35 //Sets Not done error code
36 Standard_EXPORT void SetNotDone() { _errorCode = KO; }
38 //Sets an error code of the operation
39 Standard_EXPORT void SetErrorCode(const TCollection_AsciiString& theErrorCode) {
40 _errorCode = theErrorCode;
43 //Returns an error code of the last operatioin
44 Standard_EXPORT char* GetErrorCode() {
45 return _errorCode.ToCString();
48 //Returns a pointer to GEOM_Engine which this operation interface is associated
49 Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; }
51 //Return a pointer to Solver associated with this operation interface
52 Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
54 //Returns an ID of the OCAF document where this operation stores the data
55 Standard_EXPORT int GetDocID() { return _docID; }
59 TCollection_AsciiString _errorCode;