Salome HOME
a05408ae45f2e05458ffa1b4db6897e4ec6b9e08
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : SALOMEDS_StudyBuilder.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef __SALOMEDS_STUDYBUILDER_H__
25 #define __SALOMEDS_STUDYBUILDER_H__
26
27 #include "SALOMEDS_Defines.hxx"
28
29 #include "SALOMEDSClient.hxx"
30 #include "SALOMEDSImpl_StudyBuilder.hxx"
31
32 // IDL headers
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SALOMEDS)
35
36 class SALOMEDS_EXPORT SALOMEDS_StudyBuilder: public SALOMEDSClient_StudyBuilder
37 {
38 private:
39   bool _isLocal;
40   SALOMEDSImpl_StudyBuilder*        _local_impl;
41   SALOMEDS::StudyBuilder_var        _corba_impl;
42   CORBA::ORB_var                    _orb;
43
44 public:
45
46   SALOMEDS_StudyBuilder(SALOMEDSImpl_StudyBuilder* theBuilder);
47   SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder);
48   ~SALOMEDS_StudyBuilder();
49
50   virtual _PTR(SComponent) NewComponent(const std::string& ComponentDataType);
51   virtual void DefineComponentInstance (const _PTR(SComponent)&, const std::string& ComponentIOR);
52   virtual void RemoveComponent(const _PTR(SComponent)& theSCO);
53   virtual _PTR(SObject) NewObject(const _PTR(SObject)& theFatherObject);
54   virtual _PTR(SObject) NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag);
55   virtual void AddDirectory(const std::string& thePath);
56   virtual void LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR);
57   virtual void Load(const _PTR(SObject)& theSCO);
58   virtual void RemoveObject(const _PTR(SObject)& theSO);
59   virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO);
60   virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, 
61                                                        const std::string& aTypeOfAttribute);
62   virtual bool FindAttribute(const _PTR(SObject)& theSO, 
63                              _PTR(GenericAttribute)& theAttribute, 
64                              const std::string& aTypeOfAttribute);
65   virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute);
66   virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject);
67   virtual void RemoveReference(const _PTR(SObject)& me);
68   virtual void SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID);
69   virtual bool IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID);
70   virtual void NewCommand();
71   virtual void CommitCommand();
72   virtual bool HasOpenCommand();
73   virtual void AbortCommand();
74   virtual void Undo();
75   virtual void Redo();
76   virtual bool GetAvailableUndos();
77   virtual bool GetAvailableRedos();
78   virtual int UndoLimit();
79   virtual void UndoLimit(int theLimit);
80   virtual void SetName(const _PTR(SObject)& theSO, const std::string& theValue);
81   virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue);
82   virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue);
83
84   SALOMEDS::StudyBuilder_ptr GetBuilder();
85
86 private:
87   void CheckLocked();
88   void init_orb();
89 };
90 #endif