Sketcher Solver: Means to reset the initilization of movement

=============================================================

Just amazed it was working "so well" without never reseting to zero this.

It might bring advantages and close bugs... who knows!
This commit is contained in:
Abdullah Tahiri
2017-12-11 16:21:03 +01:00
committed by wmayer
parent a309e417fc
commit f2cca2e05a
3 changed files with 13 additions and 1 deletions

View File

@@ -3185,6 +3185,11 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine)
return 0;
}
void Sketch::resetInitMove()
{
isInitMove = false;
}
int Sketch::movePoint(int geoId, PointPos pos, Base::Vector3d toPoint, bool relative)
{
geoId = checkGeoId(geoId);

View File

@@ -104,6 +104,10 @@ public:
* sketch status as a reference
*/
int initMove(int geoId, PointPos pos, bool fine=true);
/** Resets the initialization of a point or curve drag
*/
void resetInitMove();
/** move this point (or curve) to a new location and solve.
* This will introduce some additional weak constraints expressing

View File

@@ -202,10 +202,13 @@ int SketchObject::hasConflicts(void) const
int SketchObject::solve(bool updateGeoAfterSolving/*=true*/)
{
// Reset the initial movement in case of a dragging operation was ongoing on the solver.
solvedSketch.resetInitMove();
// if updateGeoAfterSolving=false, the solver information is updated, but the Sketch is nothing
// updated. It is useful to avoid triggering an OnChange when the goeometry did not change but
// the solver needs to be updated.
// We should have an updated Sketcher (sketchobject) geometry or this solve() should not have happened
// therefore we update our sketch solver geometry with the SketchObject one.
//