Salome HOME
Merge V8_4_BR branch.
[modules/geom.git] / src / GEOM / GEOM_BaseObject.cxx
index 4b6745486733137ac764f6229899371a1c7493da..aa56b107f36ecec11da60f5a361e500beec3705b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -36,7 +36,6 @@
 #include <TDataStd_UAttribute.hxx>
 #include <TDocStd_Document.hxx>
 #include <TDocStd_Owner.hxx>
-#include <TFunction_Driver.hxx>
 #include <TFunction_DriverTable.hxx>
 
 #include "utilities.h"
@@ -211,7 +210,7 @@ GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType)
 //=============================================================================
 GEOM_BaseObject::~GEOM_BaseObject()
 {
-  MESSAGE("GEOM_BaseObject::~GEOM_BaseObject()");
+  //MESSAGE("GEOM_BaseObject::~GEOM_BaseObject()");
 }
 
 //=============================================================================
@@ -323,7 +322,7 @@ TCollection_AsciiString GEOM_BaseObject::GetName()
     aName = aNameAttr->Get();
   // do not return pointer of local variable
   // return aName.ToCString();
-  // the following code could lead to memory leak, so take care about recieved pointer
+  // the following code could lead to memory leak, so take care about received pointer
   return aName;
 }
 
@@ -493,24 +492,17 @@ Handle(TColStd_HSequenceOfTransient) GEOM_BaseObject::GetLastDependency()
  */
 //================================================================================
 
-std::vector< Handle(TFunction_Driver)> GEOM_BaseObject::GetCreationDrivers()
+Handle(TFunction_Driver) GEOM_BaseObject::GetCreationDriver(int funNb)
 {
-  std::vector< Handle(TFunction_Driver)> aDriverVec;
-
-  for ( int i = 1, nb = GetNbFunctions(); i <= nb; ++i )
+  Handle(TFunction_Driver) driver;
+  Handle(GEOM_Function) function = GetFunction(funNb);
+  if ( !function.IsNull() )
   {
-    Handle(GEOM_Function) function = GetFunction(i);
-    if ( !function.IsNull() )
-    {
-      Standard_GUID aGUID = function->GetDriverGUID();
-      aDriverVec.push_back( Handle(TFunction_Driver )() );
-      if ( TFunction_DriverTable::Get()->FindDriver(aGUID, aDriverVec.back() ))
-        aDriverVec.back()->Init( function->GetEntry() );
-      else
-        aDriverVec.pop_back();
-    }
+    Standard_GUID aGUID = function->GetDriverGUID();
+    if ( TFunction_DriverTable::Get()->FindDriver(aGUID, driver ))
+      driver->Init( function->GetEntry() );
   }
-  return aDriverVec;
+  return driver;
 }
 
 //=============================================================================
@@ -523,5 +515,4 @@ TDF_Label GEOM_BaseObject::GetFreeLabel()
   return _label.FindChild(FREE_LABEL);
 }
 
-IMPLEMENT_STANDARD_HANDLE (GEOM_BaseObject, Standard_Transient );
 IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseObject, Standard_Transient );