2 // File : SALOMEDS_OpenedAttribute.cxx
3 // Created : Wed Nov 28 16:09:35 2001
4 // Author : Yves FRICAUD
7 // Copyright : Open CASCADE 2001
10 #include "SALOMEDS_OpenedAttribute.ixx"
11 #include <TDataStd_Integer.hxx>
13 //=======================================================================
16 //=======================================================================
18 const Standard_GUID& SALOMEDS_OpenedAttribute::GetID ()
20 static Standard_GUID SALOMEDS_OpenedAttributeID ("12837186-8F52-11d6-A8A3-0001021E8C7F");
21 return SALOMEDS_OpenedAttributeID;
26 //=======================================================================
29 //=======================================================================
31 Handle(SALOMEDS_OpenedAttribute) SALOMEDS_OpenedAttribute::Set (const TDF_Label& L,
32 const Standard_Integer value)
34 Handle(SALOMEDS_OpenedAttribute) A;
35 if (!L.FindAttribute(SALOMEDS_OpenedAttribute::GetID(),A)) {
36 A = new SALOMEDS_OpenedAttribute();
40 (Handle(TDataStd_Integer)::DownCast(A))->Set (value);
45 //=======================================================================
46 //function : constructor
48 //=======================================================================
49 SALOMEDS_OpenedAttribute::SALOMEDS_OpenedAttribute()
51 TDataStd_Integer::Set(0);
54 //=======================================================================
57 //=======================================================================
59 const Standard_GUID& SALOMEDS_OpenedAttribute::ID () const { return GetID(); }
62 //=======================================================================
65 //=======================================================================
67 Handle(TDF_Attribute) SALOMEDS_OpenedAttribute::NewEmpty () const
69 return new SALOMEDS_OpenedAttribute();
72 //=======================================================================
75 //=======================================================================
77 void SALOMEDS_OpenedAttribute::Restore(const Handle(TDF_Attribute)& with)
79 Standard_Integer s = Handle(TDataStd_Integer)::DownCast (with)->Get ();
80 TDataStd_Integer::Set(s);
84 //=======================================================================
87 //=======================================================================
89 void SALOMEDS_OpenedAttribute::Paste (const Handle(TDF_Attribute)& into,
90 const Handle(TDF_RelocationTable)& RT) const
92 Handle(TDataStd_Integer)::DownCast (into)->Set (Get());