Avoid blocking features in PlaneGCSSolver for a long time.
(aBaseFeature->attribute(aModifiedAttribute)));
// equal Radius constraint for arcs
- anNewFeature->execute(); // we need the created arc result to set equal constraint
createConstraintForObjects(SketchPlugin_ConstraintEqual::ID(),
getFeatureResult(aBaseFeature),
getFeatureResult(anNewFeature));
bool aReversed = theBaseFeature->boolean(SketchPlugin_Arc::REVERSED_ID())->value();
aFeature->boolean(SketchPlugin_Arc::REVERSED_ID())->setValue(aReversed);
}
- //aFeature->execute(); // to obtain result
+ aFeature->execute(); // to obtain result (need to calculate arc parameters before sending Update)
aFeature->data()->blockSendAttributeUpdated(aWasBlocked);
#ifdef DEBUG_TRIM
// resolve constraints if needed
bool needToUpdate = needToResolve && resolveConstraints();
+ releaseFeaturesIfEventsBlocked();
// Features may be updated => now send events, but for all changed at once
if (isUpdateFlushed)
for (; aGroupIter != myGroups.end(); ++aGroupIter) {
if ((*aGroupIter)->resolveConstraints())
needToUpdate = true;
- (*aGroupIter)->blockEvents(false);
}
return needToUpdate;
}
+void SketchSolver_Manager::releaseFeaturesIfEventsBlocked() const
+{
+ std::list<SketchGroupPtr>::const_iterator aGroupIter = myGroups.begin();
+ for (; aGroupIter != myGroups.end(); ++aGroupIter)
+ (*aGroupIter)->blockEvents(false);
+}
+
bool SketchSolver_Manager::stopSendUpdate() const
{
static const Events_ID anUpdateEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED);
/// \brief Allow to send the Update event
void allowSendUpdate() const;
+ /// \brief Allow send events about changing features in groups
+ void releaseFeaturesIfEventsBlocked() const;
+
private:
- std::list<SketchGroupPtr> myGroups; ///< Groups of constraints
+ std::list<SketchGroupPtr> myGroups; ///< Groups of constraints
/// true if computation is performed and all "updates" are generated by this algo
/// and needs no recomputation
bool myIsComputed;