Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / SALOMEDSImpl / SALOMEDSImpl_GenericAttribute.cxx
index b1148f59caaf2309d02d406134a429c979d82dfc..4337e8e95ffccb5649e5abe67b123355051f9097 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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
+// 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SALOMEDSImpl_GenericAttribute.hxx
 //  Author : SERGEY_RUIN
 //  Module : SALOME
@@ -27,9 +28,7 @@
 #include "SALOMEDSImpl_Study.hxx"
 #include "SALOMEDSImpl_StudyBuilder.hxx"
 
-using namespace std;
-
-string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
+std::string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
 {
   SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);  
   if (ga)
@@ -38,7 +37,7 @@ string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
   return "";
 }
 
-string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
+std::string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
 {
   SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
   if (ga)
@@ -53,7 +52,7 @@ void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr)
   ga->CheckLocked();
 }
 
-string SALOMEDSImpl_GenericAttribute::Type() 
+std::string SALOMEDSImpl_GenericAttribute::Type() 
 { 
     return _type; 
 }
@@ -80,12 +79,16 @@ SALOMEDSImpl_SObject SALOMEDSImpl_GenericAttribute::GetSObject()
   return SALOMEDSImpl_Study::SObject(aLabel);
 }
 
-void SALOMEDSImpl_GenericAttribute::SetModifyFlag()
+/*!
+ * Set modification flag of the Attribute.
+ * param reason reason of the modification (by default equal to 0)
+ */
+void SALOMEDSImpl_GenericAttribute::SetModifyFlag(int reason)
 {
    DF_Label aLabel = Label();
    if(aLabel.IsNull()) return; 
 
   SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
+  if(aStudy) aStudy->modifySO_Notification(GetSObject(), reason);
   if(aStudy) aStudy->Modify();
 }
-