Salome HOME
add method NameChanged to update title name
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeComment.cxx
index d31c4b4fbc437bb3001a81cfa2078982c527a970..e08bfa4c676f14a1d811d25cc9e4f74bbfdcda2d 100644 (file)
@@ -1,30 +1,46 @@
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 //  File   : SALOMEDSImpl_AttributeComment.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
-#ifndef WNT
-using namespace std;
-#endif
+//
 #include "SALOMEDSImpl_AttributeComment.hxx"
 
-IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeComment, SALOMEDSImpl_GenericAttribute )
-IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeComment, SALOMEDSImpl_GenericAttribute )
-
 //=======================================================================
 //function : GetID
 //purpose  :
 //=======================================================================
-const Standard_GUID& SALOMEDSImpl_AttributeComment::GetID ()
+const std::string& SALOMEDSImpl_AttributeComment::GetID ()
 {
-  static Standard_GUID CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9");
+  static std::string CommentID ("7AF2F7CC-1CA2-4476-BE95-8ACC996BC7B9");
   return CommentID;
 }   
 
-Handle(SALOMEDSImpl_AttributeComment) SALOMEDSImpl_AttributeComment::Set (const TDF_Label& L, 
-                                                                         const TCollection_ExtendedString& Val) 
+SALOMEDSImpl_AttributeComment* SALOMEDSImpl_AttributeComment::Set (const DF_Label& L, 
+                                                                   const std::string& Val) 
 {
-  Handle(SALOMEDSImpl_AttributeComment) A;
-  if (!L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID(), A)) {
+  SALOMEDSImpl_AttributeComment* A = NULL;
+  if (!(A=(SALOMEDSImpl_AttributeComment*)L.FindAttribute(SALOMEDSImpl_AttributeComment::GetID()))) {
     A = new  SALOMEDSImpl_AttributeComment(); 
     L.AddAttribute(A);
   }
@@ -38,7 +54,7 @@ Handle(SALOMEDSImpl_AttributeComment) SALOMEDSImpl_AttributeComment::Set (const
 //function : SetValue
 //purpose  :
 //=======================================================================
-void SALOMEDSImpl_AttributeComment::SetValue (const TCollection_ExtendedString& S)
+void SALOMEDSImpl_AttributeComment::SetValue (const std::string& S)
 {
   CheckLocked();
 
@@ -56,13 +72,13 @@ void SALOMEDSImpl_AttributeComment::SetValue (const TCollection_ExtendedString&
 //function : ID
 //purpose  :
 //=======================================================================
-const Standard_GUID& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } 
+const std::string& SALOMEDSImpl_AttributeComment::ID () const { return GetID(); } 
 
 //=======================================================================
 //function : NewEmpty
 //purpose  : 
 //=======================================================================
-Handle(TDF_Attribute) SALOMEDSImpl_AttributeComment::NewEmpty () const
+DF_Attribute* SALOMEDSImpl_AttributeComment::NewEmpty () const
 {  
   return new SALOMEDSImpl_AttributeComment(); 
 }
@@ -71,9 +87,9 @@ Handle(TDF_Attribute) SALOMEDSImpl_AttributeComment::NewEmpty () const
 //function : Restore
 //purpose  : 
 //=======================================================================
-void SALOMEDSImpl_AttributeComment::Restore(const Handle(TDF_Attribute)& with) 
+void SALOMEDSImpl_AttributeComment::Restore(DF_Attribute* with) 
 {
-  myString = Handle(SALOMEDSImpl_AttributeComment)::DownCast (with)->Value ();
+  myString = dynamic_cast<SALOMEDSImpl_AttributeComment*>(with)->Value ();
 }
 
 //=======================================================================
@@ -81,8 +97,7 @@ void SALOMEDSImpl_AttributeComment::Restore(const Handle(TDF_Attribute)& with)
 //purpose  : 
 //=======================================================================
 
-void SALOMEDSImpl_AttributeComment::Paste (const Handle(TDF_Attribute)& into,
-                                          const Handle(TDF_RelocationTable)& RT) const
+void SALOMEDSImpl_AttributeComment::Paste (DF_Attribute* into)
 {
-  Handle(SALOMEDSImpl_AttributeComment)::DownCast (into)->SetValue(myString);
+  dynamic_cast<SALOMEDSImpl_AttributeComment*>(into)->SetValue(myString);
 }