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