Salome HOME
Copyrights update
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_SObject.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/
19 //
20 //  File   : SALOMEDSImpl_SObject.hxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24 #ifndef __SALOMEDSIMPL_SOBJECT_H__
25 #define __SALOMEDSIMPL_SOBJECT_H__
26
27 //Handle definition
28 #include <Handle_MMgt_TShared.hxx>
29 #include <Standard_DefineHandle.hxx>
30 DEFINE_STANDARD_HANDLE( SALOMEDSImpl_SObject, MMgt_TShared )
31
32 class SALOMEDSImpl_SComponent;
33 class Handle_SALOMEDSImpl_SComponent;
34 class SALOMEDSImpl_Study;
35 class Handle_SALOMEDSImpl_Study;
36
37 // Cascade headers
38 #include <TDF_Label.hxx>
39 #include <TDF_Tool.hxx>
40 #include <TDF_Attribute.hxx>
41 #include <Standard_GUID.hxx>
42 #include <Standard_NoSuchObject.hxx>
43 #include <TCollection_AsciiString.hxx>
44 #include <TColStd_HSequenceOfTransient.hxx>
45
46 class SALOMEDSImpl_SObject : public MMgt_TShared 
47 {
48 protected:
49   TDF_Label                _lab;
50   TCollection_AsciiString  _name;  
51   TCollection_AsciiString  _value;
52   TCollection_AsciiString  _type;
53
54 public:
55   
56   Standard_EXPORT SALOMEDSImpl_SObject(const TDF_Label& theLabel);
57   Standard_EXPORT ~SALOMEDSImpl_SObject();
58   
59   Standard_EXPORT virtual TCollection_AsciiString GetID();
60   Standard_EXPORT virtual Handle(SALOMEDSImpl_SComponent) GetFatherComponent();
61   Standard_EXPORT virtual Handle(SALOMEDSImpl_SObject) GetFather() ;
62   Standard_EXPORT virtual bool FindAttribute(Handle(TDF_Attribute)& theAttribute, const TCollection_AsciiString& theTypeOfAttribute);
63   Standard_EXPORT virtual bool ReferencedObject(Handle(SALOMEDSImpl_SObject)& theObject) ;
64   Standard_EXPORT virtual bool FindSubObject(int theTag, Handle(SALOMEDSImpl_SObject)& theObject);
65
66   Standard_EXPORT virtual Handle(SALOMEDSImpl_Study) GetStudy() ;
67   Standard_EXPORT virtual TCollection_AsciiString Name() { return _name; }
68   Standard_EXPORT virtual void Name(const TCollection_AsciiString& theName) { _name = theName; }
69   Standard_EXPORT virtual Handle(TColStd_HSequenceOfTransient) GetAllAttributes();
70
71   Standard_EXPORT virtual TCollection_AsciiString GetName();
72   Standard_EXPORT virtual TCollection_AsciiString GetComment();
73   Standard_EXPORT virtual TCollection_AsciiString GetIOR();
74
75   Standard_EXPORT virtual int Tag() { return _lab.Tag(); }
76   Standard_EXPORT virtual int Depth() { return _lab.Depth(); }
77
78   Standard_EXPORT virtual TDF_Label GetLabel() { return _lab; }   
79
80   Standard_EXPORT static Standard_GUID GetGUID(const TCollection_AsciiString& theTypeOfAttribute);
81
82 public:
83   DEFINE_STANDARD_RTTI( SALOMEDSImpl_SObject )
84 };
85 #endif