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_ExternalFileDef.cxx
25 // Author : Yves FRICAUD
29 #include "SALOMEDS_ExternalFileDef.ixx"
30 #include <TDataStd_Comment.hxx>
31 #include <TCollection_ExtendedString.hxx>
34 //=======================================================================
37 //=======================================================================
39 const Standard_GUID& SALOMEDS_ExternalFileDef::GetID ()
41 static Standard_GUID SALOMEDS_ExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
42 return SALOMEDS_ExternalFileDefID;
47 //=======================================================================
50 //=======================================================================
52 Handle(SALOMEDS_ExternalFileDef) SALOMEDS_ExternalFileDef::Set (const TDF_Label& L,
53 const TCollection_ExtendedString& S)
56 Handle(SALOMEDS_ExternalFileDef) A;
57 if (!L.FindAttribute(SALOMEDS_ExternalFileDef::GetID(),A)) {
58 A = new SALOMEDS_ExternalFileDef();
62 (Handle(TDataStd_Comment)::DownCast(A))->Set (S);
67 //=======================================================================
68 //function : constructor
70 //=======================================================================
71 SALOMEDS_ExternalFileDef::SALOMEDS_ExternalFileDef()
74 //=======================================================================
77 //=======================================================================
79 const Standard_GUID& SALOMEDS_ExternalFileDef::ID () const { return GetID(); }
82 //=======================================================================
85 //=======================================================================
87 Handle(TDF_Attribute) SALOMEDS_ExternalFileDef::NewEmpty () const
89 return new SALOMEDS_ExternalFileDef();
92 //=======================================================================
95 //=======================================================================
97 void SALOMEDS_ExternalFileDef::Restore(const Handle(TDF_Attribute)& with)
99 TCollection_ExtendedString s = Handle(TDataStd_Comment)::DownCast (with)->Get ();
100 TDataStd_Comment::Set(s);
104 //=======================================================================
107 //=======================================================================
109 void SALOMEDS_ExternalFileDef::Paste (const Handle(TDF_Attribute)& into,
110 const Handle(TDF_RelocationTable)& RT) const
112 Handle(TDataStd_Comment)::DownCast (into)->Set (Get());