Salome HOME
ADD a end user module (services.py) to help the manipulation of SALOME KERNEL service...
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_Study_i.cxx
index 5832eaa4c76849e3d70bd4991c1d8680193a0f74..0c74680da1d4b28e67b69e2f128f477d68372a12 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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   : SALOMEDS_Study_i.cxx
@@ -104,7 +104,7 @@ Notifier(CORBA::ORB_ptr orb)
  */
 //============================================================================
 
-  virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject)
+  virtual bool modifySO_Notification(const SALOMEDSImpl_SObject& theSObject, int reason)
     {
       for (ObsListIter it (myObservers.begin()); it != myObservers.end(); ++it)
         {
@@ -112,7 +112,7 @@ Notifier(CORBA::ORB_ptr orb)
             {
               std::string anID=theSObject.GetID();
               const char* cID=anID.c_str();
-              it->first->notifyObserverID(cID,0);
+              it->first->notifyObserverID(cID,reason);
             }
         }
       return true; // NGE return always true but can be modified if needed
@@ -793,11 +793,11 @@ void SALOMEDS_Study_i::Close()
       catch (CORBA::Exception&) 
         {/*pass*/ }
     }
-    sco->Destroy();
+    sco->UnRegister();
   }
 
   //Does not need any more this iterator
-  itcomponent->Destroy();
+  itcomponent->UnRegister();
 
 
   _impl->Close();
@@ -842,8 +842,8 @@ void SALOMEDS_Study_i::RemovePostponed(CORBA::Long /*theUndoLimit*/)
       SALOME::GenericObj_var aGeneric = SALOME::GenericObj::_narrow(obj);
          //rnv: To avoid double deletion of the Salome Generic Objects:
          //rnv: 1. First decrement of the reference count in the SALOMEDSImpl_AttributeIOR::~SALOMEDSImpl_AttributeIOR();
-         //rnv: 2. Second decrement of the reference count in the next string : aGeneric->Destroy();
-      //if (!CORBA::is_nil(aGeneric)) aGeneric->Destroy();
+         //rnv: 2. Second decrement of the reference count in the next string : aGeneric->UnRegister();
+      //if (!CORBA::is_nil(aGeneric)) aGeneric->UnRegister();
     } catch (...) {}
   }
 
@@ -873,13 +873,14 @@ void SALOMEDS_Study_i::UndoPostponed(CORBA::Long theWay)
 //============================================================================
 CORBA::Boolean SALOMEDS_Study_i::DumpStudy(const char* thePath, 
                                            const char* theBaseName, 
-                                           CORBA::Boolean isPublished)
+                                           CORBA::Boolean isPublished,
+                                           CORBA::Boolean isMultiFile)
 {
   SALOMEDS::Locker lock; 
 
   std::string aPath((char*)thePath), aBaseName((char*)theBaseName);
   SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb);
-  CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, factory);
+  CORBA::Boolean ret = _impl->DumpStudy(aPath, aBaseName, isPublished, isMultiFile, factory);
   delete factory;
   return ret;
 }