Sketcher: use low precision solving during mouse drag and code simplifications
This commit is contained in:
parent
73d2fa9e61
commit
63b2b239b1
|
@ -120,7 +120,6 @@ int Sketch::setUpSketch(const std::vector<Part::Geometry *> &GeoList,
|
|||
addConstraints(ConstraintList);
|
||||
|
||||
GCSsys.clearByTag(-1);
|
||||
GCSsys.clearByTag(-2);
|
||||
GCSsys.initSolution(Parameters);
|
||||
return diagnose();
|
||||
}
|
||||
|
@ -1566,7 +1565,6 @@ int Sketch::solve(void)
|
|||
Base::TimeInfo start_time;
|
||||
if (!isInitMove) { // make sure we are in single subsystem mode
|
||||
GCSsys.clearByTag(-1);
|
||||
GCSsys.clearByTag(-2);
|
||||
isFine = true;
|
||||
}
|
||||
|
||||
|
@ -1590,13 +1588,11 @@ int Sketch::solve(void)
|
|||
break;
|
||||
case 3: // last resort: augment the system with a second subsystem and use the SQP solver
|
||||
solvername = "SQP(augmented system)";
|
||||
GCSsys.clearByTag(-1);
|
||||
GCSsys.clearByTag(-2);
|
||||
InitParameters.resize(Parameters.size());
|
||||
int i=0;
|
||||
for (std::vector<double*>::iterator it = Parameters.begin(); it != Parameters.end(); ++it, i++) {
|
||||
InitParameters[i] = **it;
|
||||
GCSsys.addConstraintEqual(*it, &InitParameters[i], -2);
|
||||
GCSsys.addConstraintEqual(*it, &InitParameters[i], -1);
|
||||
}
|
||||
GCSsys.initSolution(Parameters);
|
||||
ret = GCSsys.solve(isFine);
|
||||
|
@ -1615,7 +1611,7 @@ int Sketch::solve(void)
|
|||
}
|
||||
|
||||
if (soltype == 3) // cleanup temporary constraints of the augmented system
|
||||
GCSsys.clearByTag(-2);
|
||||
GCSsys.clearByTag(-1);
|
||||
|
||||
if (valid_solution) {
|
||||
if (soltype == 1)
|
||||
|
@ -1652,7 +1648,6 @@ int Sketch::initMove(int geoId, PointPos pos, bool fine)
|
|||
geoId = checkGeoId(geoId);
|
||||
|
||||
GCSsys.clearByTag(-1);
|
||||
GCSsys.clearByTag(-2);
|
||||
|
||||
// don't try to move sketches that contain conflicting constraints
|
||||
if (hasConflicts()) {
|
||||
|
|
|
@ -768,7 +768,7 @@ bool ViewProviderSketch::mouseMove(const SbVec3f &point, const SbVec3f &normal,
|
|||
int GeoId;
|
||||
Sketcher::PointPos PosId;
|
||||
getSketchObject()->getGeoVertexIndex(edit->DragPoint, GeoId, PosId);
|
||||
edit->ActSketch.initMove(GeoId, PosId);
|
||||
edit->ActSketch.initMove(GeoId, PosId, false);
|
||||
relative = false;
|
||||
xInit = 0;
|
||||
yInit = 0;
|
||||
|
@ -785,7 +785,7 @@ bool ViewProviderSketch::mouseMove(const SbVec3f &point, const SbVec3f &normal,
|
|||
edit->PreselectCurve != -1 && edit->DragCurve != edit->PreselectCurve) {
|
||||
Mode = STATUS_SKETCH_DragCurve;
|
||||
edit->DragCurve = edit->PreselectCurve;
|
||||
edit->ActSketch.initMove(edit->DragCurve, Sketcher::none);
|
||||
edit->ActSketch.initMove(edit->DragCurve, Sketcher::none, false);
|
||||
const Part::Geometry *geo = getSketchObject()->getGeometry(edit->DragCurve);
|
||||
if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
|
||||
relative = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user