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_PersRefAttribute.cxx
25 // Author : Yves FRICAUD
29 #include "SALOMEDS_PersRefAttribute.ixx"
30 #include <TDataStd_Comment.hxx>
31 #include <TCollection_ExtendedString.hxx>
34 //=======================================================================
37 //=======================================================================
39 const Standard_GUID& SALOMEDS_PersRefAttribute::GetID ()
41 static Standard_GUID SALOMEDS_PersRefAttributeID ("92888E06-7074-11d5-A690-0800369C8A03");
42 return SALOMEDS_PersRefAttributeID;
47 //=======================================================================
50 //=======================================================================
52 Handle(SALOMEDS_PersRefAttribute) SALOMEDS_PersRefAttribute::Set (const TDF_Label& L,
53 const TCollection_ExtendedString& S)
55 Handle(SALOMEDS_PersRefAttribute) A;
56 if (!L.FindAttribute(SALOMEDS_PersRefAttribute::GetID(),A)) {
57 A = new SALOMEDS_PersRefAttribute();
61 (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
66 //=======================================================================
67 //function : constructor
69 //=======================================================================
70 SALOMEDS_PersRefAttribute::SALOMEDS_PersRefAttribute()
73 //=======================================================================
76 //=======================================================================
78 const Standard_GUID& SALOMEDS_PersRefAttribute::ID () const { return GetID(); }
81 //=======================================================================
84 //=======================================================================
86 Handle(TDF_Attribute) SALOMEDS_PersRefAttribute::NewEmpty () const
88 return new SALOMEDS_PersRefAttribute();
91 //=======================================================================
94 //=======================================================================
96 void SALOMEDS_PersRefAttribute::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_PersRefAttribute::Paste (const Handle(TDF_Attribute)& into,
109 const Handle(TDF_RelocationTable)& RT) const
111 Handle(TDataStd_Comment)::DownCast (into)->Set (Get());