- SolverConstraintPtr aConstraint = PlaneGCSSolver_Tools::createMovementConstraint(theFeature);
- if (!aConstraint)
- return false;
- aConstraint->process(myStorage, myIsEventsBlocked);
- if (aConstraint->error().empty())
- setTemporary(aConstraint);
- else
- myStorage->notify(theFeature);
+ std::shared_ptr<SketchSolver_ConstraintMovement> aConstraint =
+ PlaneGCSSolver_Tools::createMovementConstraint(theFeatureOrPoint);
+ if (aConstraint) {
+ SolverConstraintPtr(aConstraint)->process(theStorage, theEventsBlocked);
+ if (aConstraint->error().empty()) {
+ aConstraint->startPoint(theFrom);
+ theStorage->adjustParametrizationOfArcs();
+ theSketchSolver->initialize();
+ aConstraint->moveTo(theTo);
+ theStorage->setNeedToResolve(true);
+ } else
+ theStorage->notify(aConstraint->movedFeature());
+ }
+
+ return aConstraint;
+}
+
+bool SketchSolver_Group::moveFeature(FeaturePtr theFeature,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theFrom,
+ const std::shared_ptr<GeomAPI_Pnt2d>& theTo)
+{
+ EntityWrapperPtr anEntity = myStorage->entity(theFeature);
+ SolverConstraintPtr aConstraint = move(myStorage, mySketchSolver, myDOF, myIsEventsBlocked,
+ theFeature, anEntity, theFrom, theTo);
+ setTemporary(aConstraint);
+ return true;
+}