From 05d0cb1c4ceaa90ec31ee1bd3eafd418b53ae85c Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 19 Nov 2014 16:58:01 +0300 Subject: [PATCH] Fix error in creation information - wrong operation type in case of MakeEdge --- src/GEOMImpl/GEOMImpl_VectorDriver.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_VectorDriver.cxx b/src/GEOMImpl/GEOMImpl_VectorDriver.cxx index f123e4fef..4c7d2a55c 100644 --- a/src/GEOMImpl/GEOMImpl_VectorDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_VectorDriver.cxx @@ -43,6 +43,21 @@ #include +namespace +{ + Handle(GEOM_Object) GetOwner( const TDF_Label& l ) + { + TDF_Label label = l; + // object is stored on a grandfather label of a driver label + if ( !label.IsNull() ) + label = label.Father(); + if ( !label.IsNull() ) + label = label.Father(); + + return GEOM_Object::GetObject( label ); + } +} + //======================================================================= //function : GetID //purpose : @@ -179,8 +194,7 @@ GetCreationInformation(std::string& theOperationName, AddParam( theParams, "Dz", aCI.GetDZ() ); break; case VECTOR_TWO_PNT: { - TDF_Label label = Label(); - Handle(GEOM_Object) obj = GEOM_Object::GetObject( label ); + Handle(GEOM_Object) obj = GetOwner( Label() ); if ( !obj.IsNull() && obj->GetType() == GEOM_EDGE ) theOperationName = "EDGE"; else -- 2.39.2