2 // File : SALOMEDS_LocalIDAttribute.cxx
3 // Created : Tue Aug 13 14:05:03 2002
4 // Author : Yves FRICAUD
7 // Copyright : Open CASCADE 2001
10 #include "SALOMEDS_LocalIDAttribute.ixx"
11 #include <TDataStd_Integer.hxx>
13 //=======================================================================
16 //=======================================================================
18 const Standard_GUID& SALOMEDS_LocalIDAttribute::GetID ()
20 static Standard_GUID SALOMEDS_OpenedAttributeID ("12837196-8F52-11d6-A8A3-0001021E8C7F");
21 return SALOMEDS_OpenedAttributeID;
26 //=======================================================================
29 //=======================================================================
31 Handle(SALOMEDS_LocalIDAttribute) SALOMEDS_LocalIDAttribute::Set (const TDF_Label& L,
32 const Standard_Integer value)
34 Handle(SALOMEDS_LocalIDAttribute) A;
35 if (!L.FindAttribute(SALOMEDS_LocalIDAttribute::GetID(),A)) {
36 A = new SALOMEDS_LocalIDAttribute();
40 (Handle(TDataStd_Integer)::DownCast(A))->Set (value);
45 //=======================================================================
46 //function : constructor
48 //=======================================================================
49 SALOMEDS_LocalIDAttribute::SALOMEDS_LocalIDAttribute()
51 TDataStd_Integer::Set(0);
54 //=======================================================================
57 //=======================================================================
59 const Standard_GUID& SALOMEDS_LocalIDAttribute::ID () const { return GetID(); }
62 //=======================================================================
65 //=======================================================================
67 Handle(TDF_Attribute) SALOMEDS_LocalIDAttribute::NewEmpty () const
69 return new SALOMEDS_LocalIDAttribute();
72 //=======================================================================
75 //=======================================================================
77 void SALOMEDS_LocalIDAttribute::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_LocalIDAttribute::Paste (const Handle(TDF_Attribute)& into,
90 const Handle(TDF_RelocationTable)& RT) const
92 Handle(TDataStd_Integer)::DownCast (into)->Set (Get());