myDOF = 0;
}
-void PlaneGCSSolver_Solver::addConstraint(GCSConstraintPtr theConstraint,
- const SketchSolver_ConstraintType theType)
+void PlaneGCSSolver_Solver::addConstraint(GCSConstraintPtr theConstraint)
{
myEquationSystem->addConstraint(theConstraint.get());
myConstraints[theConstraint->getTag()].insert(theConstraint);
myDOF = -1;
-
- // Workaround: avoid tangent constraint in the list of redundant
- if (theType == CONSTRAINT_TANGENT_CIRCLE_LINE ||
- theType == CONSTRAINT_TANGENT_CIRCLE_CIRCLE ||
- theType == CONSTRAINT_PT_PT_COINCIDENT ||
- theType == CONSTRAINT_PT_ON_CIRCLE ||
- theType == CONSTRAINT_PT_ON_LINE)
- myConstraintIDsNotRedundant.insert(theConstraint->getTag());
}
void PlaneGCSSolver_Solver::removeConstraint(ConstraintID theID)
{
myConstraints.erase(theID);
- myConstraintIDsNotRedundant.erase(theID);
if (myConstraints.empty()) {
myEquationSystem->clear();
myDOF = (int)myParameters.size();
myConflictingIDs.insert(aConflict.begin(), aConflict.end());
myEquationSystem->getRedundant(aConflict);
- // Workaround: avoid conflicting tangent constraints
- GCS::VEC_I aTemp = aConflict;
- aConflict.clear();
- for (GCS::VEC_I::iterator anIt = aTemp.begin(); anIt != aTemp.end(); ++anIt)
- if (myConstraintIDsNotRedundant.find(*anIt) == myConstraintIDsNotRedundant.end())
- aConflict.push_back(*anIt);
myConflictingIDs.insert(aConflict.begin(), aConflict.end());
myConfCollected = true;