From: vsr Date: Wed, 19 Nov 2014 13:58:01 +0000 (+0300) Subject: Fix error in creation information - wrong operation type in case of MakeEdge X-Git-Tag: V7_5_0rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=05d0cb1c4ceaa90ec31ee1bd3eafd418b53ae85c;p=modules%2Fgeom.git Fix error in creation information - wrong operation type in case of MakeEdge --- 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