From c8dad4c61f1b846e74ce536f539822101205556a Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 5 May 2016 09:26:55 +0300 Subject: [PATCH] Fix problem with loading solvers plugins --- src/SketchPlugin/SketchPlugin_Feature.h | 6 ++++++ src/SketchSolver/SketchSolver_Storage.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_Feature.h b/src/SketchPlugin/SketchPlugin_Feature.h index de39f17b8..4d0aa22c8 100644 --- a/src/SketchPlugin/SketchPlugin_Feature.h +++ b/src/SketchPlugin/SketchPlugin_Feature.h @@ -39,6 +39,12 @@ class SketchPlugin_Feature : public ModelAPI_Feature return false; } + /// Returns true if the feature is a copy of other feature + SKETCHPLUGIN_EXPORT virtual bool isCopy() const + { + return false; + } + /// Moves the feature /// \param theDeltaX the delta for X coordinate is moved /// \param theDeltaY the delta for Y coordinate is moved diff --git a/src/SketchSolver/SketchSolver_Storage.cpp b/src/SketchSolver/SketchSolver_Storage.cpp index c63d28e43..587a3f31d 100644 --- a/src/SketchSolver/SketchSolver_Storage.cpp +++ b/src/SketchSolver/SketchSolver_Storage.cpp @@ -177,7 +177,7 @@ bool SketchSolver_Storage::update(FeaturePtr theFeature, const GroupID& theGroup // Check external feature std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(theFeature); - if (aSketchFeature && aSketchFeature->isExternal()) + if (aSketchFeature && (aSketchFeature->isExternal() || aSketchFeature->isCopy())) aGroup = GID_OUTOFGROUP; aRelated = aBuilder->createFeature(theFeature, aSubs, aGroup); if (!aRelated) @@ -223,7 +223,7 @@ bool SketchSolver_Storage::update(AttributePtr theAttribute, const GroupID& theG // Check attribute of external features std::shared_ptr aSketchFeature = std::dynamic_pointer_cast(theAttribute->owner()); - if (aSketchFeature && aSketchFeature->isExternal()) + if (aSketchFeature && (aSketchFeature->isExternal() || aSketchFeature->isCopy())) aGroup = GID_OUTOFGROUP; aRelated = aBuilder->createAttribute(anAttribute, aGroup); if (!aRelated) -- 2.39.2