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_AttributeName.cxx
21 // Author : Sergey RUIN
25 #include "SALOMEDSImpl_AttributeName.hxx"
29 //=======================================================================
32 //=======================================================================
33 const std::string& SALOMEDSImpl_AttributeName::GetID ()
35 static std::string NameID ("8650000D-63A0-4651-B621-CC95C9308598");
39 SALOMEDSImpl_AttributeName* SALOMEDSImpl_AttributeName::Set (const DF_Label& L,
40 const std::string& Val)
42 SALOMEDSImpl_AttributeName* A = NULL;
43 if (!(A=(SALOMEDSImpl_AttributeName*)L.FindAttribute(SALOMEDSImpl_AttributeName::GetID()))) {
44 A = new SALOMEDSImpl_AttributeName();
52 //=======================================================================
55 //=======================================================================
56 void SALOMEDSImpl_AttributeName::SetValue (const std::string& S)
60 if(myString == S) return;
66 SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved
70 //=======================================================================
73 //=======================================================================
74 const std::string& SALOMEDSImpl_AttributeName::ID () const { return GetID(); }
76 //=======================================================================
79 //=======================================================================
80 DF_Attribute* SALOMEDSImpl_AttributeName::NewEmpty () const
82 return new SALOMEDSImpl_AttributeName();
85 //=======================================================================
88 //=======================================================================
89 void SALOMEDSImpl_AttributeName::Restore(DF_Attribute* with)
91 myString = dynamic_cast<SALOMEDSImpl_AttributeName*>(with)->Value ();
94 //=======================================================================
97 //=======================================================================
99 void SALOMEDSImpl_AttributeName::Paste (DF_Attribute* into)
101 dynamic_cast<SALOMEDSImpl_AttributeName*>(into)->SetValue(myString);