Sketcher: avoid duplicate code and unnecessary arguments

This commit is contained in:
logari81
2012-05-14 10:44:44 +02:00
parent c7f887ec33
commit 2af94d8fc2
5 changed files with 35 additions and 55 deletions

View File

@@ -97,7 +97,7 @@ App::DocumentObjectExecReturn *SketchObject::execute(void)
rebuildExternalGeometry();
Sketch sketch;
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
getExternalGeometryCount());
if (dofs < 0) { // over-constrained sketch
std::string msg="Over-constrained sketch\n";
appendConflictMsg(sketch.getConflicting(), msg);
@@ -128,7 +128,7 @@ int SketchObject::hasConflicts(void) const
// set up a sketch (including dofs counting and diagnosing of conflicts)
Sketch sketch;
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
getExternalGeometryCount());
if (dofs < 0) // over-constrained sketch
return -2;
if (sketch.hasConflicts()) // conflicting constraints
@@ -166,7 +166,7 @@ int SketchObject::setDatum(int ConstrId, double Datum)
// set up a sketch (including dofs counting and diagnosing of conflicts)
Sketch sketch;
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
getExternalGeometryCount());
int err=0;
if (dofs < 0) // over-constrained sketch
err = -3;
@@ -192,7 +192,7 @@ int SketchObject::movePoint(int GeoId, PointPos PosId, const Base::Vector3d& toP
{
Sketch sketch;
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
getExternalGeometryCount());
if (dofs < 0) // over-constrained sketch
return -1;
if (sketch.hasConflicts()) // conflicting constraints