- std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
- data()->attribute(SketchPlugin_Constraint::ENTITY_A()))->clear();
- std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(
- data()->attribute(SketchPlugin_Constraint::ENTITY_B()))->clear();
- }
- }
- else if (theID == END_POINT_ID() && !myBlockValue) {
- int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1;
- if (aNbCopies > 0) {
- myBlockValue = true;
- SketchPlugin_Tools::updateMultiAttribute(attribute(START_POINT_ID()), attribute(END_POINT_ID()),
- attribute(END_FULL_POINT_ID()), aNbCopies, true);
- myBlockValue = false;
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
- }
- }
- else if (theID == END_FULL_POINT_ID() && !myBlockValue) {
- int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1;
- if (aNbCopies > 0) {
- myBlockValue = true;
- SketchPlugin_Tools::updateMultiAttribute(attribute(START_POINT_ID()), attribute(END_FULL_POINT_ID()),
- attribute(END_POINT_ID()), aNbCopies, false);
- myBlockValue = 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(END_POINT_ID())->isInitialized() &&
- attribute(VALUE_TYPE())->isInitialized()) {
- AttributeStringPtr aMethodTypeAttr = string(VALUE_TYPE());
- std::string aMethodType = aMethodTypeAttr->value();
- int aNbCopies = integer(NUMBER_OF_OBJECTS_ID())->value() - 1;
- if (aNbCopies > 0) {
- myBlockValue = true;
- if (aMethodType == "SingleValue")
- SketchPlugin_Tools::updateMultiAttribute(attribute(START_POINT_ID()), attribute(END_POINT_ID()),
- attribute(END_FULL_POINT_ID()), aNbCopies, true);
- else {
- SketchPlugin_Tools::updateMultiAttribute(attribute(START_POINT_ID()), attribute(END_FULL_POINT_ID()),
- attribute(END_POINT_ID()), aNbCopies, false);
- }
- myBlockValue = false;
- Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
- }