-
- // the commented code is incorrect and obsolete, so it is removed
- // send events to update the sub-features by the solver
- //if (isUpdateFlushed)
- // Events_Loop::loop()->setFlushed(anUpdateEvent, true);
+ }
+ }
+ else if (theID == ANGLE_ID() && !myBlockAngle) {
+ int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1;
+ if (aNbCopies > 0) {
+ myBlockAngle = true;
+ SketchPlugin_Tools::updateMultiAttribute(attribute(ANGLE_ID()), attribute(ANGLE_FULL_ID()),
+ aNbCopies, true);
+ myBlockAngle = false;
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ }
+ }
+ else if (theID == ANGLE_FULL_ID() && !myBlockAngle) {
+ int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1;
+ if (aNbCopies > 0) {
+ myBlockAngle = true;
+ SketchPlugin_Tools::updateMultiAttribute(attribute(ANGLE_FULL_ID()), attribute(ANGLE_ID()),
+ aNbCopies, false);
+ myBlockAngle = false;
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ }
+ }
+ else if (theID == NUMBER_OF_OBJECTS_ID()) {
+ if (attribute(NUMBER_OF_OBJECTS_ID())->isInitialized() &&
+ attribute(ANGLE_ID())->isInitialized() &&
+ attribute(ANGLE_TYPE())->isInitialized()) {
+ AttributeStringPtr aMethodTypeAttr = string(ANGLE_TYPE());
+ std::string aMethodType = aMethodTypeAttr->value();
+ int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1;
+ if (aNbCopies > 0) {
+ myBlockAngle = true;
+ if (aMethodType == "SingleAngle")
+ SketchPlugin_Tools::updateMultiAttribute(attribute(ANGLE_ID()), attribute(ANGLE_FULL_ID()),
+ aNbCopies, true);
+ else {
+ SketchPlugin_Tools::updateMultiAttribute(attribute(ANGLE_FULL_ID()), attribute(ANGLE_ID()),
+ aNbCopies, false);
+ }
+ myBlockAngle = false;
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
+ }