#=========================================================================
# Check the lines of rectangle are parallel to the axes
#=========================================================================
-#aNbSubs = aSketchFeature.numberOfSubs()
-#aNbLines = 0
-#for i in range (0, aNbSubs):
-# aFeature = objectToFeature(aSketchFeature.subFeature(i))
-# if aFeature.getKind() == "SketchLine":
-# aLastLine = aFeature
-# assert (isHorizontal(aLastLine) or isVertical(aLastLine))
-# aNbLines = aNbLines + 1
-#assert (aNbLines == 4)
+aNbSubs = aSketchFeature.numberOfSubs()
+aNbLines = 0
+for i in range (0, aNbSubs):
+ aFeature = objectToFeature(aSketchFeature.subFeature(i))
+ if aFeature.getKind() == "SketchLine":
+ aLastLine = aFeature
+ assert (isHorizontal(aLastLine) or isVertical(aLastLine))
+ aNbLines = aNbLines + 1
+assert (aNbLines == 4)
#=========================================================================
# End of test
#=========================================================================
} catch (...) {
// Events_Error::send(SketchSolver_Error::SOLVESPACE_CRASH(), this);
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(SketchSolver_Error::SOLVESPACE_CRASH());
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
if (myPrevResult == STATUS_OK || myPrevResult == STATUS_UNKNOWN) {
// the error message should be changed before sending the message
sendMessage(EVENT_SOLVER_FAILED);
updateMultiConstraints(myConstraints);
if (myPrevResult != STATUS_OK || myPrevResult == STATUS_UNKNOWN) {
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue("");
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
// the error message should be changed before sending the message
sendMessage(EVENT_SOLVER_REPAIRED, myConflictingConstraints);
myConflictingConstraints.clear();
if (!myConstraints.empty()) {
// the error message should be changed before sending the message
getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(SketchSolver_Error::CONSTRAINTS());
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
if (myPrevResult != aResult || myPrevResult == STATUS_UNKNOWN) {
// Obtain list of conflicting constraints
std::set<ObjectPtr> aConflicting = myStorage->getConflictingConstraints(mySketchSolver);
// reset error message on the sketch
aGroup->getWorkplane()->string(SketchPlugin_Sketch::SOLVER_ERROR())->setValue(
SketchSolver_Error::CONSTRAINTS());
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
break;
}
}
std::ostringstream aStream;
aStream << "DOF(degree of freedom) = " << aDoFIt->second;
aDoFIt->first->data()->string(SketchPlugin_Sketch::SOLVER_DOF())->setValue(aStream.str());
-
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
}
}