From 18a5df8c670275043051d51e0667742b63159834 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 7 May 2015 19:27:01 +0300 Subject: [PATCH] 23034: EDF GEOM: Information after a transformation without copy Fix regression of geom/imps_07/H9 -- no info on field steps --- src/GEOM/GEOM_BaseObject.cxx | 23 ++++++++--------------- src/GEOM/GEOM_BaseObject.hxx | 2 +- src/GEOMImpl/GEOMImpl_FieldDriver.cxx | 14 ++++++++++++++ src/GEOM_I/GEOM_BaseObject_i.cc | 9 +++++---- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/GEOM/GEOM_BaseObject.cxx b/src/GEOM/GEOM_BaseObject.cxx index 4b6745486..b2a5efca7 100644 --- a/src/GEOM/GEOM_BaseObject.cxx +++ b/src/GEOM/GEOM_BaseObject.cxx @@ -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; } //============================================================================= diff --git a/src/GEOM/GEOM_BaseObject.hxx b/src/GEOM/GEOM_BaseObject.hxx index 28b9a40e0..68e6bdc5a 100644 --- a/src/GEOM/GEOM_BaseObject.hxx +++ b/src/GEOM/GEOM_BaseObject.hxx @@ -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 diff --git a/src/GEOMImpl/GEOMImpl_FieldDriver.cxx b/src/GEOMImpl/GEOMImpl_FieldDriver.cxx index 434f0289a..96c30e6a6 100644 --- a/src/GEOMImpl/GEOMImpl_FieldDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_FieldDriver.cxx @@ -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; diff --git a/src/GEOM_I/GEOM_BaseObject_i.cc b/src/GEOM_I/GEOM_BaseObject_i.cc index 39e19b427..e16ef5940 100644 --- a/src/GEOM_I/GEOM_BaseObject_i.cc +++ b/src/GEOM_I/GEOM_BaseObject_i.cc @@ -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 params; -- 2.39.2