Sketcher: bugfix: disallow opening when geometry types changed

This commit is contained in:
DeepSOIC
2015-03-13 04:46:33 +03:00
committed by wmayer
parent e4716e0e29
commit e6931f22ed
3 changed files with 35 additions and 9 deletions

View File

@@ -1756,7 +1756,7 @@ int SketchObject::delExternal(int ExtGeoId)
int SketchObject::delConstraintsToExternal()
{
const std::vector< Constraint * > &constraints = Constraints.getValues();
const std::vector< Constraint * > &constraints = Constraints.getValuesForce();
std::vector< Constraint * > newConstraints(0);
int GeoId = -3, NullId = -2000;
for (std::vector<Constraint *>::const_iterator it = constraints.begin();
@@ -2270,7 +2270,7 @@ bool SketchObject::evaluateConstraints() const
int extGeoCount = getExternalGeometryCount();
std::vector<Part::Geometry *> geometry = getCompleteGeometry();
const std::vector<Sketcher::Constraint *>& constraints = Constraints.getValues();
const std::vector<Sketcher::Constraint *>& constraints = Constraints.getValuesForce();
if (static_cast<int>(geometry.size()) != extGeoCount + intGeoCount)
return false;
if (geometry.size() < 2)
@@ -2282,6 +2282,10 @@ bool SketchObject::evaluateConstraints() const
return false;
}
if(constraints.size()>0){
if (!Constraints.scanGeometry(geometry)) return false;
}
return true;
}