2 #ifndef _GEOM_Engine_HXX_
3 #define _GEOM_Engine_HXX_
5 #include "GEOM_Application.hxx"
6 #include "GEOM_Object.hxx"
7 #include "GEOM_DataMapOfAsciiStringTransient.hxx"
9 #include <Interface_DataMapOfIntegerTransient.hxx>
10 #include <Resource_DataMapOfAsciiStringAsciiString.hxx>
11 #include <TDocStd_Document.hxx>
12 #include <TColStd_HArray1OfInteger.hxx>
13 #include <TColStd_HSequenceOfAsciiString.hxx>
18 Standard_EXPORT GEOM_Engine();
19 Standard_EXPORT ~GEOM_Engine() { _mapIDDocument.Clear(); _objects.Clear(); }
22 Standard_EXPORT static GEOM_Engine* GetEngine();
24 //Returns the OCAF document by its ID, if document doesn't exists it will be created
25 Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID);
27 //Returns the ID of the given OCAF document
28 Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument);
30 //Returns the OCAF appliaction
31 Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; }
33 //Returns a pointer to GEOM_Object defined by a document and the entry
34 Standard_EXPORT Handle(GEOM_Object) GetObject(int theDocID, char* theEntry);
36 //Adds a new object of the type theType in the OCAF document
37 Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType);
39 //Removes the object from the OCAF document
40 Standard_EXPORT bool RemoveObject(Handle(GEOM_Object) theObject);
42 //Saves the OCAF document with ID = theDocID with file with name theFileName
43 Standard_EXPORT bool Save(int theDocID, char* theFileName);
45 //Loads the OCAF document into the application and assigns to it an ID = theDocID
46 Standard_EXPORT bool Load(int theDocID, char* theFileName);
48 //Closes the document with ID = theDocID
49 Standard_EXPORT void Close(int theDocID);
51 //Sets the number of Undos (default value = 10)
52 Standard_EXPORT void SetUndoLimit(int theLimit) { _UndoLimit = theLimit; }
54 //Applies an Undo to document with ID = theDocID
55 Standard_EXPORT void Undo(int theDocID);
57 //Applies an Redo to document with ID = theDocID
58 Standard_EXPORT void Redo(int theDocID);
60 //Adds a new sub shape object of the MainShape object
61 Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape,
62 Handle(TColStd_HArray1OfInteger) theIndices,
63 bool isStandaloneOperation = false);
65 Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID,
66 Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
70 Standard_EXPORT const char* GetDumpName (const char* theStudyEntry) const;
72 Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const;
75 Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);
79 Handle(GEOM_Application) _OCAFApp;
80 Interface_DataMapOfIntegerTransient _mapIDDocument;
82 GEOM_DataMapOfAsciiStringTransient _objects;
84 Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;