Version: 9.16.0
GEOM_IOperations.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef _GEOM_IOperations_HXX_
24#define _GEOM_IOperations_HXX_
25
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"
31
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"
38
40{
41 public:
42 Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine);
43 Standard_EXPORT ~GEOM_IOperations();
44
45 //Starts a new operation (opens a tansaction)
46 Standard_EXPORT void StartOperation();
47
48 //Finishes the previously started operation (closes the transaction)
49 Standard_EXPORT void FinishOperation();
50
51 //Aborts the operation
52 Standard_EXPORT void AbortOperation();
53
54 //Returns true if the last operation succided
55 Standard_EXPORT bool IsDone();
56
57 //Sets Not done error code
58 Standard_EXPORT void SetNotDone() { _errorCode = KO; }
59
60 //Sets an error code of the operation
61 Standard_EXPORT void SetErrorCode(const TCollection_AsciiString& theErrorCode) {
62 _errorCode = theErrorCode;
63 }
64
65 //Returns an error code of the last operatioin
66 Standard_EXPORT char* GetErrorCode() {
67 return (char*) _errorCode.ToCString();
68 }
69
70 //Returns a pointer to GEOM_Engine which this operation interface is associated
71 Standard_EXPORT GEOM_Engine* GetEngine() { return _engine; }
72
73 //Return a pointer to Solver associated with this operation interface
74 Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
75
76 private:
77
78 TCollection_AsciiString _errorCode;
81
82};
83
84#endif
#define KO
Definition: GEOM_IOperations.hxx:33
Definition: GEOM_Engine.hxx:91
Definition: GEOM_IOperations.hxx:40
Standard_EXPORT void AbortOperation()
Definition: GEOM_IOperations.cxx:88
Standard_EXPORT void FinishOperation()
Definition: GEOM_IOperations.cxx:76
Standard_EXPORT bool IsDone()
Definition: GEOM_IOperations.cxx:100
Standard_EXPORT GEOM_Solver * GetSolver()
Definition: GEOM_IOperations.hxx:74
Standard_EXPORT void StartOperation()
Definition: GEOM_IOperations.cxx:64
Standard_EXPORT GEOM_Engine * GetEngine()
Definition: GEOM_IOperations.hxx:71
Standard_EXPORT void SetErrorCode(const TCollection_AsciiString &theErrorCode)
Definition: GEOM_IOperations.hxx:61
Standard_EXPORT char * GetErrorCode()
Definition: GEOM_IOperations.hxx:66
Standard_EXPORT ~GEOM_IOperations()
Definition: GEOM_IOperations.cxx:52
TCollection_AsciiString _errorCode
Definition: GEOM_IOperations.hxx:78
Standard_EXPORT GEOM_IOperations(GEOM_Engine *theEngine)
Definition: GEOM_IOperations.cxx:40
GEOM_Engine * _engine
Definition: GEOM_IOperations.hxx:79
GEOM_Solver * _solver
Definition: GEOM_IOperations.hxx:80
Standard_EXPORT void SetNotDone()
Definition: GEOM_IOperations.hxx:58
Definition: GEOM_Solver.hxx:33