#include <ModelAPI_Document.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_Events.h>
+
+#include <Events_Loop.h>
#include <SketcherPrs_Tools.h>
ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B()));
aRef2->setAttr(thePoint2);
- if (aFeature) // TODO: generate an error if feature was not created
- aFeature->execute();
+ // we need to flush created signal in order to coincidence is processed by solver
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
}
/*std::shared_ptr<GeomDataAPI_Point2D> PartSet_Tools::
}
return anAttribute;
}
+
+void PartSet_Tools::sendSubFeaturesEvent(const CompositeFeaturePtr& theComposite,
+ const Events_ID theEventId)
+{
+ if (!theComposite.get())
+ return;
+
+ static Events_Loop* aLoop = Events_Loop::loop();
+ for (int i = 0; i < theComposite->numberOfSubs(); i++) {
+ FeaturePtr aSubFeature = theComposite->subFeature(i);
+ static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+ aECreator->sendUpdated(aSubFeature, theEventId);
+ }
+ Events_Loop::loop()->flush(theEventId);
+}