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 //=======================================================================
31 //=======================================================================
32 const std::string& SALOMEDSImpl_AttributeExternalFileDef::GetID ()
34 static std::string SALOMEDSImpl_AttributeExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
35 return SALOMEDSImpl_AttributeExternalFileDefID;
38 //=======================================================================
41 //=======================================================================
42 SALOMEDSImpl_AttributeExternalFileDef*
43 SALOMEDSImpl_AttributeExternalFileDef::Set (const DF_Label& L, const std::string& S)
46 SALOMEDSImpl_AttributeExternalFileDef* A = NULL;
47 if (!(A=(SALOMEDSImpl_AttributeExternalFileDef*)L.FindAttribute(SALOMEDSImpl_AttributeExternalFileDef::GetID()))) {
48 A = new SALOMEDSImpl_AttributeExternalFileDef();
57 //=======================================================================
58 //function : constructor
60 //=======================================================================
61 SALOMEDSImpl_AttributeExternalFileDef::SALOMEDSImpl_AttributeExternalFileDef()
62 :SALOMEDSImpl_GenericAttribute("AttributeExternalFileDef")
66 //=======================================================================
69 //=======================================================================
70 void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const std::string& S)
74 if(myString == S) return;
80 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
85 //=======================================================================
88 //=======================================================================
89 const std::string& SALOMEDSImpl_AttributeExternalFileDef::ID () const { return GetID(); }
92 //=======================================================================
95 //=======================================================================
96 DF_Attribute* SALOMEDSImpl_AttributeExternalFileDef::NewEmpty () const
98 return new SALOMEDSImpl_AttributeExternalFileDef();
101 //=======================================================================
104 //=======================================================================
105 void SALOMEDSImpl_AttributeExternalFileDef::Restore(DF_Attribute* with)
107 myString = dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(with)->Value ();
110 //=======================================================================
113 //=======================================================================
114 void SALOMEDSImpl_AttributeExternalFileDef::Paste (DF_Attribute* into)
116 SALOMEDSImpl_AttributeExternalFileDef* anAttr = dynamic_cast<SALOMEDSImpl_AttributeExternalFileDef*>(into);
117 anAttr->SetValue(myString);