From 8827a0d307bd399b41b7ac7b86df42a377f86770 Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Tue, 24 Mar 2020 14:10:24 +0300 Subject: [PATCH] Protect usage of B-spline in Mirror, LinearCopy and AngularCopy features. --- src/SketchPlugin/SketchPlugin_Validators.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 9c96e9ad2..c23718060 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -414,6 +414,15 @@ bool SketchPlugin_MirrorAttrValidator::isValid(const AttributePtr& theAttribute, for(int anInd = 0; anInd < aSelAttr->size(); anInd++) { ObjectPtr aSelObject = aSelAttr->object(anInd); + + // B-splines are not supported in Mirror yet + FeaturePtr aSelFeature = ModelAPI_Feature::feature(aSelObject); + if (aSelFeature && (aSelFeature->getKind() == SketchPlugin_BSpline::ID() || + aSelFeature->getKind() == SketchPlugin_BSplinePeriodic::ID())) { + theError = "Not supported"; + return false; + } + std::string aName = aSelObject.get() ? aSelObject->data()->name() : ""; std::list::iterator aMirIter = aMirroredObjects.begin(); for (; aMirIter != aMirroredObjects.end(); aMirIter++) @@ -521,6 +530,15 @@ bool SketchPlugin_CopyValidator::isValid(const AttributePtr& theAttribute, break; if (anObjIter != anInitialObjects.end()) continue; + + // B-splines are not supported in Copying features + FeaturePtr aSelFeature = ModelAPI_Feature::feature(aSelObject); + if (aSelFeature && (aSelFeature->getKind() == SketchPlugin_BSpline::ID() || + aSelFeature->getKind() == SketchPlugin_BSplinePeriodic::ID())) { + theError = "Not supported"; + return false; + } + anObjIter = aCopiedObjects.begin(); for (; anObjIter != aCopiedObjects.end(); anObjIter++) if (aSelObject == *anObjIter) { -- 2.39.2