#include <SketchSolver_ConstraintMirror.h>
#include <SketchSolver_Error.h>
-#include <SketchSolver_Manager.h>
+#include <PlaneGCSSolver_Tools.h>
#include <PlaneGCSSolver_UpdateFeature.h>
#include <GeomAPI_XY.h>
myFeatures.insert(aFeature);
}
}
- // add mirrored features to the list
- aList = aMirroredRefList->list();
- for (anIt = aList.begin(); anIt != aList.end(); ++anIt) {
- FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
- if (aFeature)
- myFeatures.insert(aFeature);
- }
}
void SketchSolver_ConstraintMirror::process()
void SketchSolver_ConstraintMirror::update()
{
cleanErrorMsg();
- remove();
- process();
+ adjustConstraint();
}
void SketchSolver_ConstraintMirror::adjustConstraint()
{
- BuilderPtr aBuilder = SketchSolver_Manager::instance()->builder();
-
AttributeRefAttrPtr aMirrLineRefAttr =
myBaseConstraint->refattr(SketchPlugin_Constraint::ENTITY_A());
std::shared_ptr<GeomAPI_Lin2d> aMirrorLine =
- aBuilder->line(ModelAPI_Feature::feature(aMirrLineRefAttr->object()));
+ PlaneGCSSolver_Tools::line(ModelAPI_Feature::feature(aMirrLineRefAttr->object()));
AttributeRefListPtr aBaseRefList =
myBaseConstraint->reflist(SketchPlugin_Constraint::ENTITY_B());
FeaturePtr aBase = ModelAPI_Feature::feature(*aBIt);
FeaturePtr aMirrored = ModelAPI_Feature::feature(*aMIt);
mirrorEntities(aMirrorLine, aBase, aMirrored);
+
+ // update mirrored entity if it exists in the storage
+ if (myStorage->entity(aMirrored))
+ myStorage->update(aMirrored);
}
}
for (; anIt != myFeatures.end(); ++anIt)
(*anIt)->data()->blockSendAttributeUpdated(isBlocked);
+ AttributeRefListPtr aMirroredRefList =
+ myBaseConstraint->reflist(SketchPlugin_Constraint::ENTITY_C());
+ std::list<ObjectPtr> aMirroredList = aMirroredRefList->list();
+ std::list<ObjectPtr>::iterator aMIt = aMirroredList.begin();
+ for (; aMIt != aMirroredList.end(); ++aMIt) {
+ FeaturePtr aMirrored = ModelAPI_Feature::feature(*aMIt);
+ aMirrored->data()->blockSendAttributeUpdated(isBlocked);
+ }
+
+
SketchSolver_Constraint::blockEvents(isBlocked);
}
// process specific features
if (theOriginal->getKind() == SketchPlugin_Arc::ID()) {
// orientation of arc
- theMirrored->boolean(SketchPlugin_Arc::INVERSED_ID())->setValue(
- !theOriginal->boolean(SketchPlugin_Arc::INVERSED_ID())->value());
+ theMirrored->boolean(SketchPlugin_Arc::REVERSED_ID())->setValue(
+ !theOriginal->boolean(SketchPlugin_Arc::REVERSED_ID())->value());
} else if (theOriginal->getKind() == SketchPlugin_Circle::ID()) {
// radius of the circle
theMirrored->real(SketchPlugin_Circle::RADIUS_ID())->setValue(