// Class: SketchSolver_Group
// Purpose: verify are there any entities in the group used by given constraint
// ============================================================================
-bool SketchSolver_Group::isInteract(
- std::shared_ptr<SketchPlugin_Feature> theFeature) const
+bool SketchSolver_Group::isInteract(FeaturePtr theFeature) const
{
// Empty group interacts with everything
if (isEmpty())
myChangedConstraints.clear();
}
-bool SketchSolver_Group::updateFeature(std::shared_ptr<SketchPlugin_Feature> theFeature)
+bool SketchSolver_Group::updateFeature(FeaturePtr theFeature)
{
if (!checkFeatureValidity(theFeature))
return false;
return isUpdated;
}
-void SketchSolver_Group::moveFeature(std::shared_ptr<SketchPlugin_Feature> theFeature)
+void SketchSolver_Group::moveFeature(FeaturePtr theFeature)
{
BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
myStorage = aBuilder->createStorage(getId());
// sketch should be unchanged, set it out of current group
- bool isUpdated = myStorage->update(mySketch, GID_OUTOFGROUP);
+ bool isUpdated = myStorage->update(FeaturePtr(mySketch), GID_OUTOFGROUP);
if (isUpdated) {
- EntityWrapperPtr anEntity = myStorage->entity(mySketch);
+ EntityWrapperPtr anEntity = myStorage->entity(FeaturePtr(mySketch));
myWorkplaneID = anEntity->id();
}
return isUpdated;
std::list<ConstraintPtr> anUnusedConstraints;
ConstraintConstraintMap::iterator aCIter = myConstraints.begin();
for ( ; aCIter != myConstraints.end(); aCIter++) {
- if (aNewStorage->isInteract(aCIter->first))
+ if (aNewStorage->isInteract(FeaturePtr(aCIter->first)))
aNewStorage->addConstraint(aCIter->first, aDummyVec);
else
anUnusedConstraints.push_back(aCIter->first);
// Check the unused constraints once again, because they may become interacted with new storage since adding constraints
std::list<ConstraintPtr>::iterator aUnuseIt = anUnusedConstraints.begin();
while (aUnuseIt != anUnusedConstraints.end()) {
- if (aNewStorage->isInteract(*aUnuseIt)) {
+ if (aNewStorage->isInteract(FeaturePtr(*aUnuseIt))) {
aNewStorage->addConstraint(*aUnuseIt, aDummyVec);
anUnusedConstraints.erase(aUnuseIt);
aUnuseIt = anUnusedConstraints.begin();
/** \brief Updates the data corresponding the specified feature
* \param[in] theFeature the feature to be updated
*/
- bool updateFeature(std::shared_ptr<SketchPlugin_Feature> theFeature);
+ bool updateFeature(FeaturePtr theFeature);
/** \brief Updates the data corresponding the specified feature moved in GUI.
* Additional Fixed constraints are created.
* \param[in] theFeature the feature to be updated
*/
- void moveFeature(std::shared_ptr<SketchPlugin_Feature> theFeature);
+ void moveFeature(FeaturePtr theFeature);
/** \brief Verifies the feature attributes are used in this group
* \param[in] theFeature constraint or any other object for verification of interaction
* \return \c true if some of attributes are used in current group
*/
- bool isInteract(std::shared_ptr<SketchPlugin_Feature> theFeature) const;
+ bool isInteract(FeaturePtr theFeature) const;
/** \brief Verifies the specified feature is equal to the base workplane for this group
* \param[in] theWorkplane the feature to be compared with base workplane