From: Artem Zhidkov Date: Tue, 24 Mar 2020 11:10:24 +0000 (+0300) Subject: Protect usage of B-spline in Mirror, LinearCopy and AngularCopy features. X-Git-Tag: V9_5_0a2~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8827a0d307bd399b41b7ac7b86df42a377f86770;p=modules%2Fshaper.git Protect usage of B-spline in Mirror, LinearCopy and AngularCopy features. --- 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) {