2 // File : SALOMEDS_PixMapAttribute.cxx
3 // Created : Wed Nov 28 16:23:19 2001
4 // Author : Yves FRICAUD
8 // Copyright : Open CASCADE 2001
11 #include "SALOMEDS_PixMapAttribute.ixx"
12 #include <TDataStd_Comment.hxx>
13 #include <TCollection_ExtendedString.hxx>
15 //=======================================================================
18 //=======================================================================
20 const Standard_GUID& SALOMEDS_PixMapAttribute::GetID ()
22 static Standard_GUID SALOMEDS_PixMapAttributeID ("12837187-8F52-11d6-A8A3-0001021E8C7F");
23 return SALOMEDS_PixMapAttributeID;
28 //=======================================================================
31 //=======================================================================
33 Handle(SALOMEDS_PixMapAttribute) SALOMEDS_PixMapAttribute::Set (const TDF_Label& L,
34 const TCollection_ExtendedString& S)
36 Handle(SALOMEDS_PixMapAttribute) A;
37 if (!L.FindAttribute(SALOMEDS_PixMapAttribute::GetID(),A)) {
38 A = new SALOMEDS_PixMapAttribute();
42 (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
47 //=======================================================================
48 //function : constructor
50 //=======================================================================
51 SALOMEDS_PixMapAttribute::SALOMEDS_PixMapAttribute()
52 {TDataStd_Comment::Set("None");}
54 //=======================================================================
57 //=======================================================================
59 const Standard_GUID& SALOMEDS_PixMapAttribute::ID () const { return GetID(); }
62 //=======================================================================
65 //=======================================================================
67 Handle(TDF_Attribute) SALOMEDS_PixMapAttribute::NewEmpty () const
69 return new SALOMEDS_PixMapAttribute();
72 //=======================================================================
75 //=======================================================================
77 void SALOMEDS_PixMapAttribute::Restore(const Handle(TDF_Attribute)& with)
79 TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get ();
80 TDataStd_Comment::Set(s);
84 //=======================================================================
87 //=======================================================================
89 void SALOMEDS_PixMapAttribute::Paste (const Handle(TDF_Attribute)& into,
90 const Handle(TDF_RelocationTable)& RT) const
92 Handle(TDataStd_Comment)::DownCast (into)->Set (Get());