]> SALOME platform Git repositories - modules/kernel.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.hxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_StudyBuilder.hxx
1 //  File   : SALOMEDSImpl_StudyBuilder.hxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #ifndef __SALOMEDSImpl_STUDYBUILDER_H__
6 #define __SALOMEDSImpl_STUDYBUILDER_H__
7
8 //Handle definition
9 #include <Handle_MMgt_TShared.hxx>
10 #include <Standard_DefineHandle.hxx>
11 DEFINE_STANDARD_HANDLE( SALOMEDSImpl_StudyBuilder, MMgt_TShared )
12
13 // std C++ headers
14 #include <iostream>
15
16 // Cascade header
17 #include <TCollection_AsciiString.hxx>
18 #include <TDocStd_Document.hxx>
19  
20 #include "SALOMEDSImpl_Callback.hxx"
21 #include "SALOMEDSImpl_Driver.hxx"
22
23 class SALOMEDSImpl_StudyBuilder : public MMgt_TShared 
24 {
25 private:
26   Handle(TDocStd_Document)        _doc;
27   Handle(Standard_Transient)      _study;  
28   Handle(SALOMEDSImpl_Callback)   _callbackOnAdd;
29   Handle(SALOMEDSImpl_Callback)   _callbackOnRemove;
30   TCollection_AsciiString         _errorCode;
31
32 public:
33     
34   Standard_EXPORT SALOMEDSImpl_StudyBuilder(const Handle(Standard_Transient)& theOwner);
35
36   Standard_EXPORT ~SALOMEDSImpl_StudyBuilder();
37
38   Standard_EXPORT virtual Handle(SALOMEDSImpl_SComponent) NewComponent(const TCollection_AsciiString& ComponentDataType);
39
40   Standard_EXPORT virtual bool DefineComponentInstance (const Handle(SALOMEDSImpl_SComponent)&, const TCollection_AsciiString& ComponentIOR);
41   
42   Standard_EXPORT virtual bool RemoveComponent(const Handle(SALOMEDSImpl_SComponent)& aComponent);
43
44   Standard_EXPORT virtual Handle(SALOMEDSImpl_SObject) NewObject(const Handle(SALOMEDSImpl_SObject)& theFatherObject);
45
46   Standard_EXPORT virtual Handle(SALOMEDSImpl_SObject) NewObjectToTag(const Handle(SALOMEDSImpl_SObject)& theFatherObject, 
47                                                       const int theTag);
48
49   //! The methods adds a new subdirectory, the path can be absolute or relative (then the current context is used)
50   Standard_EXPORT virtual bool AddDirectory(const TCollection_AsciiString& thePath);
51
52   Standard_EXPORT virtual bool LoadWith(const Handle(SALOMEDSImpl_SComponent)& sco, SALOMEDSImpl_Driver* Engine);
53   Standard_EXPORT virtual bool Load(const Handle(SALOMEDSImpl_SObject)& sco);
54
55   Standard_EXPORT virtual bool RemoveObject(const Handle(SALOMEDSImpl_SObject)& anObject);
56   Standard_EXPORT virtual bool RemoveObjectWithChildren(const Handle(SALOMEDSImpl_SObject)& anObject);
57
58   Standard_EXPORT virtual Handle(TDF_Attribute) FindOrCreateAttribute(const Handle(SALOMEDSImpl_SObject)& anObject, 
59                                                       const TCollection_AsciiString& aTypeOfAttribute);
60   Standard_EXPORT virtual bool FindAttribute(const Handle(SALOMEDSImpl_SObject)& anObject, 
61                              Handle(TDF_Attribute)& anAttribute, 
62                              const TCollection_AsciiString& aTypeOfAttribute);
63
64   Standard_EXPORT virtual bool RemoveAttribute(const Handle(SALOMEDSImpl_SObject)& anObject, const TCollection_AsciiString& aTypeOfAttribute);
65
66   Standard_EXPORT virtual bool Addreference(const Handle(SALOMEDSImpl_SObject)& me, 
67                             const Handle(SALOMEDSImpl_SObject)& thereferencedObject);
68
69   Standard_EXPORT virtual bool RemoveReference(const Handle(SALOMEDSImpl_SObject)& me);
70
71   Standard_EXPORT virtual bool SetGUID(const Handle(SALOMEDSImpl_SObject)& anObject, const TCollection_AsciiString& theGUID);
72   Standard_EXPORT virtual bool IsGUID(const Handle(SALOMEDSImpl_SObject)& anObject, const TCollection_AsciiString& theGUID);
73
74   Standard_EXPORT virtual void NewCommand();
75   Standard_EXPORT virtual void CommitCommand();
76   Standard_EXPORT virtual bool HasOpenCommand();
77   Standard_EXPORT virtual void AbortCommand();
78   Standard_EXPORT virtual void Undo();
79   Standard_EXPORT virtual void Redo();
80   Standard_EXPORT bool GetAvailableUndos();
81   Standard_EXPORT bool GetAvailableRedos();
82   Standard_EXPORT bool IsSaved();
83   Standard_EXPORT bool IsModified();
84   Standard_EXPORT virtual int UndoLimit();
85   Standard_EXPORT virtual void UndoLimit(const int);
86
87   Standard_EXPORT void CheckLocked();
88
89   Standard_EXPORT virtual Handle(SALOMEDSImpl_Callback) SetOnAddSObject(const Handle(SALOMEDSImpl_Callback)& theCallback);
90   Standard_EXPORT virtual Handle(SALOMEDSImpl_Callback) SetOnRemoveSObject(const Handle(SALOMEDSImpl_Callback)& theCallback);
91
92   Standard_EXPORT virtual bool SetName(const Handle(SALOMEDSImpl_SObject)& theSO, const TCollection_AsciiString& theValue);
93
94   Standard_EXPORT virtual bool SetComment(const Handle(SALOMEDSImpl_SObject)& theSO, const TCollection_AsciiString& theValue);
95
96   Standard_EXPORT virtual bool SetIOR(const Handle(SALOMEDSImpl_SObject)& theSO, const TCollection_AsciiString& theValue);
97
98   Standard_EXPORT virtual TCollection_AsciiString GetErrorCode() { return _errorCode; }
99   Standard_EXPORT virtual bool IsError() { return _errorCode != ""; }
100
101   Standard_EXPORT virtual Handle(Standard_Transient) GetOwner() { return _study; }
102
103 public:
104   DEFINE_STANDARD_RTTI( SALOMEDSImpl_StudyBuilder )
105 };
106 #endif