Salome HOME
23034: EDF GEOM: Information after a transformation without copy
authoreap <eap@opencascade.com>
Thu, 7 May 2015 16:27:01 +0000 (19:27 +0300)
committereap <eap@opencascade.com>
Thu, 7 May 2015 16:27:01 +0000 (19:27 +0300)
   Fix regression of geom/imps_07/H9 -- no info on field steps

src/GEOM/GEOM_BaseObject.cxx
src/GEOM/GEOM_BaseObject.hxx
src/GEOMImpl/GEOMImpl_FieldDriver.cxx
src/GEOM_I/GEOM_BaseObject_i.cc

index 4b6745486733137ac764f6229899371a1c7493da..b2a5efca736f549287a92abd7a93e473a67b00cc 100644 (file)
@@ -493,24 +493,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;
 }
 
 //=============================================================================
index 28b9a40e0c53c41c95e4b7e3b767c952a1349d34..68e6bdc5ae302df781407611d46d4ddf89c127f1 100644 (file)
@@ -149,7 +149,7 @@ public:
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetLastDependency();
 
   //Returns drivers creators of this object
-  Standard_EXPORT std::vector< Handle(TFunction_Driver)> GetCreationDrivers();
+  Standard_EXPORT Handle(TFunction_Driver) GetCreationDriver(int funNb);
 
   //###########################################################
   // Internal methods
index 434f0289af14bdbbd38d5d2d8eac21613333c12d..96c30e6a67f94b21a21622fe510b5f51715d4dcd 100644 (file)
@@ -83,6 +83,20 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Step", data.GetStepID() );
     AddParam( theParams, "Stamp", data.GetStepStamp() );
   }
+  else if ( funType == GEOM_Field::FUN_CHANGE_COMP_NAMES )
+  {
+    theOperationName = "Change component names";
+  }
+  else if ( funType == GEOM_Field::FUN_CHANGE_STEP_STAMP )
+  {
+    theOperationName = "Change stamp";
+    AddParam( theParams, "Stamp", data.GetStepStamp() );
+  }
+  else if ( funType == GEOM_Field::FUN_CHANGE_VALUE )
+  {
+    theOperationName = "FIELD_EDIT";//"Change values";
+    AddParam( theParams, "Values", "..." );
+  }
   else
   {
     return false;
index 39e19b4272062f6521fe37e6f99b7ff95757848d..e16ef594070c023138eecf2776c53eab762bd34f 100644 (file)
@@ -272,12 +272,13 @@ GEOM::CreationInformationSeq* GEOM_BaseObject_i::GetCreationInformation()
 {
   GEOM::CreationInformationSeq_var info = new GEOM::CreationInformationSeq();
 
-  std::vector< Handle(TFunction_Driver)> drivers = _impl->GetCreationDrivers();
-  info->length( drivers.size() );
+  int nbFun = _impl->GetNbFunctions();
+  info->length( nbFun );
   int nbI = 0;
-  for ( size_t i = 0; i < drivers.size(); ++i )
+  for ( int i = 1; i <= nbFun; ++i )
   {
-    Handle(GEOM_BaseDriver) driver = Handle(GEOM_BaseDriver)::DownCast( drivers[i] );
+    Handle(GEOM_BaseDriver) driver =
+      Handle(GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver( i ));
     if ( !driver.IsNull() )
     {
       std::vector<GEOM_Param> params;