1 // Copyright (C) 2007-2023 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, or (at your option) any later version.
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
23 #ifndef _GEOM_IOperations_HXX_
24 #define _GEOM_IOperations_HXX_
26 #include "GEOM_Engine.hxx"
27 #include <TDocStd_Document.hxx>
28 #include <TCollection_AsciiString.hxx>
29 #include "GEOM_Object.hxx"
30 #include "GEOM_Solver.hxx"
32 #define OK "PAL_NO_ERROR"
33 #define KO "PAL_NOT_DONE_ERROR"
34 #define NOT_FOUND_ANY "NOT_FOUND_ANY"
35 #define ALREADY_PRESENT "PAL_ELEMENT_ALREADY_PRESENT"
36 #define NOT_EXISTS "PAL_ELEMENT_DOES_NOT_EXISTS"
37 #define INVALID_TYPE "INVALID_TYPE_OF_ELEMENT"
39 class GEOM_IOperations
42 Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine);
43 Standard_EXPORT ~GEOM_IOperations();
45 //Starts a new operation (opens a tansaction)
46 Standard_EXPORT void StartOperation();
48 //Finishes the previously started operation (closes the transaction)
49 Standard_EXPORT void FinishOperation();
51 //Aborts the operation
52 Standard_EXPORT void AbortOperation();
54 //Returns true if the last operation succided
55 Standard_EXPORT bool IsDone();
57 //Sets Not done error code
58 Standard_EXPORT void SetNotDone() { _errorCode = KO; }
60 //Sets an error code of the operation
61 Standard_EXPORT void SetErrorCode(const TCollection_AsciiString& theErrorCode) {
62 _errorCode = theErrorCode;
65 //Returns an error code of the last operatioin
66 Standard_EXPORT char* GetErrorCode() {
67 return (char*) _errorCode.ToCString();
70 //Returns a pointer to GEOM_Engine which this operation interface is associated
71 Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; }
73 //Return a pointer to Solver associated with this operation interface
74 Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
78 TCollection_AsciiString _errorCode;