From: mpv Date: Mon, 27 Aug 2018 12:18:17 +0000 (+0300) Subject: Fix for the issue #2528 : No more results after parameters edition canceled X-Git-Tag: SHAPER_V9_1_0RC1~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3eba83512370afb216019785292b1f17402262b0;p=modules%2Fshaper.git Fix for the issue #2528 : No more results after parameters edition canceled --- diff --git a/src/GeomData/GeomData_Point.cpp b/src/GeomData/GeomData_Point.cpp index cb6b8d47d..47d6c70ba 100644 --- a/src/GeomData/GeomData_Point.cpp +++ b/src/GeomData/GeomData_Point.cpp @@ -86,6 +86,7 @@ void GeomData_Point::setX(const double theX) setCalculatedValue(theX, 0, 0); } else if (x() != theX) { myExpression[0]->setValue(theX); + myExpression[0]->setText(""); // uninitialize the text owner()->data()->sendAttributeUpdated(this); } } @@ -96,6 +97,7 @@ void GeomData_Point::setY(const double theY) setCalculatedValue(0, theY, 0); } else if (y() != theY) { myExpression[1]->setValue(theY); + myExpression[1]->setText(""); // uninitialize the text owner()->data()->sendAttributeUpdated(this); } } @@ -107,6 +109,7 @@ void GeomData_Point::setZ(const double theZ) } else if (z() != theZ) { myExpression[2]->setValue(theZ); + myExpression[2]->setText(""); // uninitialize the text owner()->data()->sendAttributeUpdated(this); } } diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 21120233e..b3b217930 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -1891,6 +1891,15 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set& t } } } + if (aResSize > 0) { // check there exist a body that must be updated + std::list::const_iterator aRes = theFeature->results().cbegin(); + for (; aResSize && aRes != theFeature->results().cend(); aRes++, aResSize++) { + if ((*aRes)->data()->isValid() && (*aRes)->groupName() == ModelAPI_ResultBody::group()) { + ResultBodyPtr aBody = std::dynamic_pointer_cast(*aRes); + aBody->updateSubs(aBody->shape()); + } + } + } } ResultPtr Model_Objects::findByName(const std::string theName) diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index e168c6c1a..7b7ae0780 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -159,6 +159,8 @@ void Model_ResultBody::updateConcealment() if (myLastConcealed != ModelAPI_ResultBody::isConcealed()) { // check the whole tree of results: if one is concealed, everybody are concealed ResultBodyPtr anOwner = std::dynamic_pointer_cast(data()->owner()); + if (!anOwner.get()) + return; // "this" is invalid ResultBodyPtr aParent = ModelAPI_Tools::bodyOwner(anOwner); while(aParent.get()) { anOwner = aParent; diff --git a/src/Model/Model_ResultField.cpp b/src/Model/Model_ResultField.cpp index 985b66f2f..40f7aa5a4 100644 --- a/src/Model/Model_ResultField.cpp +++ b/src/Model/Model_ResultField.cpp @@ -109,7 +109,7 @@ void Model_ResultField::updateSteps() mySteps.pop_back(); } while(mySteps.size() < aNbSteps) { - mySteps.push_back(new Model_ResultField::Model_FieldStep(this, mySteps.size())); + mySteps.push_back(new Model_ResultField::Model_FieldStep(this, int(mySteps.size()))); } } } diff --git a/src/ModelAPI/ModelAPI_ResultBody.h b/src/ModelAPI/ModelAPI_ResultBody.h index 0ffb2422a..049e82175 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.h +++ b/src/ModelAPI/ModelAPI_ResultBody.h @@ -178,12 +178,13 @@ public: /// \param theDisplay a boolean value MODELAPI_EXPORT virtual void setDisplayed(const bool theDisplay); + /// Updates the sub-bodies if shape of this object is compsolid or compound + MODELAPI_EXPORT virtual void updateSubs(const std::shared_ptr& theThisShape) = 0; + protected: /// Default constructor accessible only from Model_Objects MODELAPI_EXPORT ModelAPI_ResultBody(); - /// Updates the sub-bodies if shape of this object is compsolid or compound - virtual void updateSubs(const std::shared_ptr& theThisShape) = 0; }; //! Pointer on feature object