1 // SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SALOMEDS_PixMapAttribute.cxx
25 // Author : Yves FRICAUD
29 #include "SALOMEDS_PixMapAttribute.ixx"
30 #include <TDataStd_Comment.hxx>
31 #include <TCollection_ExtendedString.hxx>
34 //=======================================================================
37 //=======================================================================
39 const Standard_GUID& SALOMEDS_PixMapAttribute::GetID ()
41 static Standard_GUID SALOMEDS_PixMapAttributeID ("12837187-8F52-11d6-A8A3-0001021E8C7F");
42 return SALOMEDS_PixMapAttributeID;
47 //=======================================================================
50 //=======================================================================
52 Handle(SALOMEDS_PixMapAttribute) SALOMEDS_PixMapAttribute::Set (const TDF_Label& L,
53 const TCollection_ExtendedString& S)
55 Handle(SALOMEDS_PixMapAttribute) A;
56 if (!L.FindAttribute(SALOMEDS_PixMapAttribute::GetID(),A)) {
57 A = new SALOMEDS_PixMapAttribute();
61 (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
66 //=======================================================================
67 //function : constructor
69 //=======================================================================
70 SALOMEDS_PixMapAttribute::SALOMEDS_PixMapAttribute()
71 {TDataStd_Comment::Set("None");}
73 //=======================================================================
76 //=======================================================================
78 const Standard_GUID& SALOMEDS_PixMapAttribute::ID () const { return GetID(); }
81 //=======================================================================
84 //=======================================================================
86 Handle(TDF_Attribute) SALOMEDS_PixMapAttribute::NewEmpty () const
88 return new SALOMEDS_PixMapAttribute();
91 //=======================================================================
94 //=======================================================================
96 void SALOMEDS_PixMapAttribute::Restore(const Handle(TDF_Attribute)& with)
98 TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get ();
99 TDataStd_Comment::Set(s);
103 //=======================================================================
106 //=======================================================================
108 void SALOMEDS_PixMapAttribute::Paste (const Handle(TDF_Attribute)& into,
109 const Handle(TDF_RelocationTable)& RT) const
111 Handle(TDataStd_Comment)::DownCast (into)->Set (Get());