+ modified declaration of external geometry in setUpSketch

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5344 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
logari81
2011-12-24 15:37:11 +00:00
parent 137904c5a8
commit 40ebead233
4 changed files with 20 additions and 19 deletions

View File

@@ -92,7 +92,8 @@ App::DocumentObjectExecReturn *SketchObject::execute(void)
// setup and diagnose the sketch
rebuildExternalGeometry();
Sketch sketch;
int dofs = sketch.setUpSketch(getInternalGeometry(), getExternalGeometry(), Constraints.getValues());
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
if (dofs < 0) { // over-constrained sketch
std::string msg="Over-constrained sketch\n";
appendConflictMsg(sketch.getConflicting(), msg);
@@ -122,7 +123,8 @@ int SketchObject::hasConflicts(void) const
{
// set up a sketch (including dofs counting and diagnosing of conflicts)
Sketch sketch;
int dofs = sketch.setUpSketch(getInternalGeometry(), getExternalGeometry(), Constraints.getValues());
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
if (dofs < 0) // over-constrained sketch
return -2;
if (sketch.hasConflicts()) // conflicting constraints
@@ -159,7 +161,8 @@ int SketchObject::setDatum(int ConstrId, double Datum)
// set up a sketch (including dofs counting and diagnosing of conflicts)
Sketch sketch;
int dofs = sketch.setUpSketch(getInternalGeometry(), getExternalGeometry(), Constraints.getValues());
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
int err=0;
if (dofs < 0) // over-constrained sketch
err = -3;
@@ -184,7 +187,8 @@ int SketchObject::setDatum(int ConstrId, double Datum)
int SketchObject::movePoint(int GeoId, PointPos PosId, const Base::Vector3d& toPoint, bool relative)
{
Sketch sketch;
int dofs = sketch.setUpSketch(getInternalGeometry(), getExternalGeometry(), Constraints.getValues());
int dofs = sketch.setUpSketch(getCompleteGeometry(), Constraints.getValues(),
true, getExternalGeometryCount());
if (dofs < 0) // over-constrained sketch
return -1;
if (sketch.hasConflicts()) // conflicting constraints
@@ -1176,7 +1180,7 @@ void SketchObject::rebuildExternalGeometry(void)
}
std::vector<Part::Geometry*> SketchObject::getCompleteGeometry(void)
std::vector<Part::Geometry*> SketchObject::getCompleteGeometry(void) const
{
std::vector<Part::Geometry*> vals=getInternalGeometry();
vals.insert(vals.end(), ExternalGeo.rbegin(), ExternalGeo.rend()); // in reverse order