2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#ifndef _GEOM_Engine_HXX_
|
|
|
|
#define _GEOM_Engine_HXX_
|
|
|
|
|
|
|
|
#include "GEOM_Application.hxx"
|
2005-06-02 13:17:09 +06:00
|
|
|
#include "GEOM_Object.hxx"
|
|
|
|
#include "GEOM_DataMapOfAsciiStringTransient.hxx"
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <Interface_DataMapOfIntegerTransient.hxx>
|
2005-06-02 13:17:09 +06:00
|
|
|
#include <Resource_DataMapOfAsciiStringAsciiString.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
#include <TDocStd_Document.hxx>
|
|
|
|
#include <TColStd_HArray1OfInteger.hxx>
|
2005-06-02 13:17:09 +06:00
|
|
|
#include <TColStd_HSequenceOfAsciiString.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
class GEOM_Engine
|
|
|
|
{
|
|
|
|
public:
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT GEOM_Engine();
|
|
|
|
Standard_EXPORT ~GEOM_Engine() { _mapIDDocument.Clear(); _objects.Clear(); }
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Retuns the engine
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT static GEOM_Engine* GetEngine();
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Returns the OCAF document by its ID, if document doesn't exists it will be created
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Returns the ID of the given OCAF document
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Returns the OCAF appliaction
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; }
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Returns a pointer to GEOM_Object defined by a document and the entry
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT Handle(GEOM_Object) GetObject(int theDocID, char* theEntry);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Adds a new object of the type theType in the OCAF document
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Removes the object from the OCAF document
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT bool RemoveObject(Handle(GEOM_Object) theObject);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Saves the OCAF document with ID = theDocID with file with name theFileName
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT bool Save(int theDocID, char* theFileName);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Loads the OCAF document into the application and assigns to it an ID = theDocID
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT bool Load(int theDocID, char* theFileName);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Closes the document with ID = theDocID
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT void Close(int theDocID);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Sets the number of Undos (default value = 10)
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT void SetUndoLimit(int theLimit) { _UndoLimit = theLimit; }
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Applies an Undo to document with ID = theDocID
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT void Undo(int theDocID);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Applies an Redo to document with ID = theDocID
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT void Redo(int theDocID);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
//Adds a new sub shape object of the MainShape object
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape,
|
2005-06-02 13:17:09 +06:00
|
|
|
Handle(TColStd_HArray1OfInteger) theIndices,
|
|
|
|
bool isStandaloneOperation = false);
|
|
|
|
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID,
|
2005-06-02 13:17:09 +06:00
|
|
|
Resource_DataMapOfAsciiStringAsciiString& theObjectNames,
|
|
|
|
bool isPublished,
|
|
|
|
bool& aValidScript);
|
|
|
|
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT const char* GetDumpName (const char* theStudyEntry) const;
|
2005-06-02 13:17:09 +06:00
|
|
|
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const;
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
protected:
|
2005-08-11 10:04:55 +06:00
|
|
|
Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Handle(GEOM_Application) _OCAFApp;
|
|
|
|
Interface_DataMapOfIntegerTransient _mapIDDocument;
|
|
|
|
int _UndoLimit;
|
|
|
|
GEOM_DataMapOfAsciiStringTransient _objects;
|
2005-06-02 13:17:09 +06:00
|
|
|
|
|
|
|
Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;
|
2004-12-01 15:39:14 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|