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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SALOMEDS_IORAttribute.cxx
25 // Author : Yves FRICAUD
30 #include "SALOMEDS_IORAttribute.ixx"
31 #include <TDataStd_Comment.hxx>
32 #include <TCollection_ExtendedString.hxx>
33 #include "SALOMEDS_Study_i.hxx"
35 //=======================================================================
38 //=======================================================================
40 const Standard_GUID& SALOMEDS_IORAttribute::GetID ()
42 static Standard_GUID SALOMEDS_IORAttributeID ("92888E01-7074-11d5-A690-0800369C8A03");
43 return SALOMEDS_IORAttributeID;
48 //=======================================================================
51 //=======================================================================
53 Handle(SALOMEDS_IORAttribute) SALOMEDS_IORAttribute::Set (const TDF_Label& L,
54 const TCollection_ExtendedString& S,
57 Handle(SALOMEDS_IORAttribute) A;
58 if (!L.FindAttribute(SALOMEDS_IORAttribute::GetID(),A)) {
59 A = new SALOMEDS_IORAttribute();
63 (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
64 SALOMEDS_Study_i::IORUpdated(A,orb);
68 //=======================================================================
69 //function : constructor
71 //=======================================================================
72 SALOMEDS_IORAttribute::SALOMEDS_IORAttribute()
75 //=======================================================================
78 //=======================================================================
80 const Standard_GUID& SALOMEDS_IORAttribute::ID () const { return GetID(); }
83 //=======================================================================
86 //=======================================================================
88 Handle(TDF_Attribute) SALOMEDS_IORAttribute::NewEmpty () const
90 return new SALOMEDS_IORAttribute();
93 //=======================================================================
96 //=======================================================================
98 void SALOMEDS_IORAttribute::Restore(const Handle(TDF_Attribute)& with)
100 TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get ();
101 TDataStd_Comment::Set(s);
105 //=======================================================================
108 //=======================================================================
110 void SALOMEDS_IORAttribute::Paste (const Handle(TDF_Attribute)& into,
111 const Handle(TDF_RelocationTable)& RT) const
113 Handle(TDataStd_Comment)::DownCast (into)->Set (Get());