From: spo Date: Thu, 6 Aug 2015 08:52:26 +0000 (+0300) Subject: Fix: using wron label for expression X-Git-Tag: V_1.4.0_beta4~425 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=60e823fd8e3c9b0b4d7a8f00f31e678235854061;p=modules%2Fshaper.git Fix: using wron label for expression --- diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 0fa5d9203..0e8d64bd1 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -103,7 +103,8 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin anAttr = new Model_AttributeInteger(anAttrLab); } else if (theAttrType == ModelAPI_AttributeDouble::typeId()) { Model_AttributeDouble* anAttribute = new Model_AttributeDouble(anAttrLab); - anAttribute->myExpression.reset(new Model_Expression(myLab.FindChild(myLab.NbChildren() + 1))); + TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + anAttribute->myExpression.reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression->isInitialized(); anAttr = anAttribute; } else if (theAttrType == Model_AttributeBoolean::typeId()) { @@ -127,7 +128,8 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin else if (theAttrType == GeomData_Point::typeId()) { GeomData_Point* anAttribute = new GeomData_Point(anAttrLab); for (int aComponent = 0; aComponent < GeomData_Point::NUM_COMPONENTS; ++aComponent) { - anAttribute->myExpression[aComponent].reset(new Model_Expression(myLab.FindChild(myLab.NbChildren() + 1))); + TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + anAttribute->myExpression[aComponent].reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression[aComponent]->isInitialized(); } anAttr = anAttribute; @@ -136,7 +138,8 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin } else if (theAttrType == GeomData_Point2D::typeId()) { GeomData_Point2D* anAttribute = new GeomData_Point2D(anAttrLab); for (int aComponent = 0; aComponent < GeomData_Point2D::NUM_COMPONENTS; ++aComponent) { - anAttribute->myExpression[aComponent].reset(new Model_Expression(myLab.FindChild(myLab.NbChildren() + 1))); + TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + anAttribute->myExpression[aComponent].reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression[aComponent]->isInitialized(); } anAttr = anAttribute;