Salome HOME
Merge from V5_1_4_BR (5_1_4rc2) 09/06/2010
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeComment.cxx
index 55716777c05bd1c230646626b8a4cc7bbf8b7969..b7fc582e832a38a64fbe57fd9eef7f1ef4efefb0 100644 (file)
@@ -1,50 +1,46 @@
-// Copyright (C) 2005  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.
-// 
-// 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.
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// 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
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/
+//  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.
 //
+//  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
-
+//
 #include "SALOMEDSImpl_AttributeComment.hxx"
 
-#ifndef WNT
-using namespace std;
-#endif
-
-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);
   }
@@ -58,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();
 
@@ -76,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(); 
 }
@@ -91,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 ();
 }
 
 //=======================================================================
@@ -101,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);
 }