{ return myType; }
/// \brief Verify the feature or any its attribute is used by constraint
- bool isUsed(FeaturePtr theFeature) const;
+ virtual bool isUsed(FeaturePtr theFeature) const;
/// \brief Verify the attribute is used by constraint
- bool isUsed(AttributePtr theAttribute) const;
+ virtual bool isUsed(AttributePtr theAttribute) const;
/// \brief Shows error message
const std::string& error() const
process();
return;
}
- SketchSolver_Constraint::update();
+ //SketchSolver_Constraint::update();
}
void SketchSolver_ConstraintMirror::adjustConstraint()
updateLocal();
if (isForce)
myAdjusted = false;
- // update parent object
- SketchSolver_Constraint::update();
+ adjustConstraint();
}
void SketchSolver_ConstraintMulti::adjustConstraint()
myAdjusted = true;
}
+
+bool SketchSolver_ConstraintMulti::isUsed(FeaturePtr theFeature) const
+{
+ return myFeatures.find(theFeature) != myFeatures.end() ||
+ SketchSolver_Constraint::isUsed(theFeature);
+}
/// \return \c false, if current constraint contains another SketchPlugin constraints (like for multiple coincidence)
virtual bool remove();
+ /// \brief Check the feature is a source or a copy of Multi-constraint
+ virtual bool isUsed(FeaturePtr theFeature) const;
+
protected:
/// \brief Converts SketchPlugin constraint to a list of SolveSpace constraints
virtual void process()
if (isEmpty())
return true;
// Check interaction with the storage
- return myStorage->isInteract(theFeature);
+ bool isInteracted = myStorage->isInteract(theFeature);
+ ConstraintConstraintMap::const_iterator anIt = myConstraints.begin();
+ for (; !isInteracted && anIt != myConstraints.end(); ++anIt)
+ if (anIt->first->getKind() == SketchPlugin_MultiRotation::ID() ||
+ anIt->first->getKind() == SketchPlugin_MultiTranslation::ID())
+ isInteracted = anIt->second->isUsed(theFeature);
+ return isInteracted;
}
// ============================================================================