]> SALOME platform Git repositories - modules/yacs.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_AttributeOpened.cxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeOpened.cxx
1 //  File   : SALOMEDSImpl_AttributeOpened.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5
6 #include "SALOMEDSImpl_AttributeOpened.hxx"
7 #include <Standard_GUID.hxx>
8
9 using namespace std;
10
11 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeOpened, SALOMEDSImpl_GenericAttribute )
12 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeOpened, SALOMEDSImpl_GenericAttribute )
13
14 //=======================================================================
15 //function : GetID
16 //purpose  : 
17 //=======================================================================
18
19 const Standard_GUID& SALOMEDSImpl_AttributeOpened::GetID () 
20 {
21   static Standard_GUID SALOMEDSImpl_AttributeOpenedID ("12837186-8F52-11d6-A8A3-0001021E8C7F");
22   return SALOMEDSImpl_AttributeOpenedID;
23 }
24
25
26
27 //=======================================================================
28 //function : Set
29 //purpose  : 
30 //=======================================================================
31
32 Handle(SALOMEDSImpl_AttributeOpened) SALOMEDSImpl_AttributeOpened::Set (const TDF_Label& L,
33                                                                         const Standard_Integer value) 
34 {
35   Handle(SALOMEDSImpl_AttributeOpened) A;
36   if (!L.FindAttribute(SALOMEDSImpl_AttributeOpened::GetID(),A)) {
37     A = new  SALOMEDSImpl_AttributeOpened(); 
38     L.AddAttribute(A);
39   }
40   
41   A->SetOpened (value); 
42   return A;
43 }
44
45
46 //=======================================================================
47 //function : constructor
48 //purpose  : 
49 //=======================================================================
50 SALOMEDSImpl_AttributeOpened::SALOMEDSImpl_AttributeOpened()
51 :SALOMEDSImpl_GenericAttribute("AttributeOpened")
52 {
53   myValue = 0; 
54 }
55
56 //=======================================================================
57 //function : SetOpened
58 //purpose  :
59 //=======================================================================
60 void SALOMEDSImpl_AttributeOpened::SetOpened(const Standard_Integer theValue)
61 {
62   Backup();
63
64   (theValue!=0)?myValue=1:myValue=0;
65 }
66
67 //=======================================================================
68 //function : ID
69 //purpose  : 
70 //=======================================================================
71
72 const Standard_GUID& SALOMEDSImpl_AttributeOpened::ID () const { return GetID(); }
73
74
75 //=======================================================================
76 //function : NewEmpty
77 //purpose  : 
78 //=======================================================================
79
80 Handle(TDF_Attribute) SALOMEDSImpl_AttributeOpened::NewEmpty () const
81 {  
82   return new SALOMEDSImpl_AttributeOpened(); 
83 }
84
85 //=======================================================================
86 //function : Restore
87 //purpose  : 
88 //=======================================================================
89
90 void SALOMEDSImpl_AttributeOpened::Restore(const Handle(TDF_Attribute)& with) 
91 {
92   myValue = Handle(SALOMEDSImpl_AttributeOpened)::DownCast (with)->IsOpened ();
93 }
94
95 //=======================================================================
96 //function : Paste
97 //purpose  : 
98 //=======================================================================
99
100 void SALOMEDSImpl_AttributeOpened::Paste (const Handle(TDF_Attribute)& into,
101                                           const Handle(TDF_RelocationTable)& RT) const
102 {
103   Handle(SALOMEDSImpl_AttributeOpened)::DownCast (into)->SetOpened (myValue);
104 }
105