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 NOT_FOUND_ANY "NOT_FOUND_ANY"
33 #define ALREADY_PRESENT "PAL_ELEMENT_ALREADY_PRESENT"
34 #define NOT_EXISTS "PAL_ELEMENT_DOES_NOT_EXISTS"
35 #define INVALID_TYPE "INVALID_TYPE_OF_ELEMENT"
37 class GEOM_IOperations
40 Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID);
41 Standard_EXPORT ~GEOM_IOperations();
43 //Starts a new operation (opens a tansaction)
44 Standard_EXPORT void StartOperation();
46 //Finishes the previously started operation (closes the transaction)
47 Standard_EXPORT void FinishOperation();
49 //Aborts the operation
50 Standard_EXPORT void AbortOperation();
52 //Returns true if the last operation succided
53 Standard_EXPORT bool IsDone();
55 //Sets Not done error code
56 Standard_EXPORT void SetNotDone() { _errorCode = KO; }
58 //Sets an error code of the operation
59 Standard_EXPORT void SetErrorCode(const TCollection_AsciiString& theErrorCode) {
60 _errorCode = theErrorCode;
63 //Returns an error code of the last operatioin
64 Standard_EXPORT char* GetErrorCode() {
65 return _errorCode.ToCString();
68 //Returns a pointer to GEOM_Engine which this operation interface is associated
69 Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; }
71 //Return a pointer to Solver associated with this operation interface
72 Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
74 //Returns an ID of the OCAF document where this operation stores the data
75 Standard_EXPORT int GetDocID() { return _docID; }
79 TCollection_AsciiString _errorCode;