1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOMEDSImpl_AttributeExternalFileDef.cxx
21 // Author : Sergey RUIN
24 #include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
28 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeExternalFileDef, SALOMEDSImpl_GenericAttribute )
29 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeExternalFileDef, SALOMEDSImpl_GenericAttribute )
31 //=======================================================================
34 //=======================================================================
35 const Standard_GUID& SALOMEDSImpl_AttributeExternalFileDef::GetID ()
37 static Standard_GUID SALOMEDSImpl_AttributeExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
38 return SALOMEDSImpl_AttributeExternalFileDefID;
41 //=======================================================================
44 //=======================================================================
45 Handle(SALOMEDSImpl_AttributeExternalFileDef)
46 SALOMEDSImpl_AttributeExternalFileDef::Set (const TDF_Label& L, const TCollection_ExtendedString& S)
49 Handle(SALOMEDSImpl_AttributeExternalFileDef) A;
50 if (!L.FindAttribute(SALOMEDSImpl_AttributeExternalFileDef::GetID(),A)) {
51 A = new SALOMEDSImpl_AttributeExternalFileDef();
60 //=======================================================================
61 //function : constructor
63 //=======================================================================
64 SALOMEDSImpl_AttributeExternalFileDef::SALOMEDSImpl_AttributeExternalFileDef()
65 :SALOMEDSImpl_GenericAttribute("AttributeExternalFileDef")
69 //=======================================================================
72 //=======================================================================
73 void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const TCollection_ExtendedString& S)
77 if(myString == S) return;
83 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
88 //=======================================================================
91 //=======================================================================
92 const Standard_GUID& SALOMEDSImpl_AttributeExternalFileDef::ID () const { return GetID(); }
95 //=======================================================================
98 //=======================================================================
99 Handle(TDF_Attribute) SALOMEDSImpl_AttributeExternalFileDef::NewEmpty () const
101 return new SALOMEDSImpl_AttributeExternalFileDef();
104 //=======================================================================
107 //=======================================================================
108 void SALOMEDSImpl_AttributeExternalFileDef::Restore(const Handle(TDF_Attribute)& with)
110 myString = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast (with)->Value ();
113 //=======================================================================
116 //=======================================================================
117 void SALOMEDSImpl_AttributeExternalFileDef::Paste (const Handle(TDF_Attribute)& into,
118 const Handle(TDF_RelocationTable)& RT) const
120 Handle(SALOMEDSImpl_AttributeExternalFileDef) anAttr = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(into);
121 anAttr->SetValue(myString);