From 68225400f2898e1a5d9f1b7d454749dc5e0cb7e5 Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 12 Nov 2015 15:41:58 +0300 Subject: [PATCH] Fix fillet validator --- src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp | 9 ++------- src/SketchPlugin/SketchPlugin_Validators.cpp | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp index 981a60bc2..c870c1ec1 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp @@ -106,12 +106,11 @@ void SketchPlugin_ConstraintFillet::execute() // Obtain base features FeaturePtr anOldFeatureA, anOldFeatureB; - std::list aNewFeatList = aRefListOfBaseLines->list(); - std::list::iterator aFeatIt = aNewFeatList.begin(); + std::list anOldFeatList = aRefListOfBaseLines->list(); + std::list::iterator aFeatIt = anOldFeatList.begin(); anOldFeatureA = ModelAPI_Feature::feature(*aFeatIt++); anOldFeatureB = ModelAPI_Feature::feature(*aFeatIt); - if(!anOldFeatureA.get() || !anOldFeatureB.get()) { setError("One of the edges is empty"); return; @@ -244,10 +243,6 @@ void SketchPlugin_ConstraintFillet::execute() aRefListOfFillet->append(aNewFeatureB->lastResult()); aRefListOfFillet->append(aNewArc->lastResult()); - // attach base lines to the list - aRefListOfBaseLines->append(anOldFeatureA); - aRefListOfBaseLines->append(anOldFeatureB); - myProducedFeatures.push_back(aNewFeatureA); myProducedFeatures.push_back(aNewFeatureB); myProducedFeatures.push_back(aNewArc); diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index a432becda..e88aa1db8 100755 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -414,7 +414,7 @@ bool SketchPlugin_FilletVertexValidator::isValid(const AttributePtr& theAttribut FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); AttributePtr aBaseLinesAttribute = aFeature->attribute(SketchPlugin_Constraint::ENTITY_C()); AttributeRefListPtr aRefListOfBaseLines = std::dynamic_pointer_cast(aBaseLinesAttribute); - if(aRefListOfBaseLines->list().size() == 2) { + if(!aRefListOfBaseLines->list().empty()) { return true; } -- 2.39.2