A fix for external objects using. activateFlushes(true) in setCurrentDocument leads to visualization external edge out of its turn. There was a bug in distance constraint creation to the external edge.
}
}
-void Events_Loop::activateFlushes(const bool theActivate)
+bool Events_Loop::activateFlushes(const bool theActivate)
{
+ bool isActive = myFlushActive;
myFlushActive = theActivate;
+ return isActive;
}
void Events_Loop::clear(const Events_ID& theID)
//! Allows to disable flushes: needed in synchronization of document mechanism
//! (to synchronize all and only then flush create, update, etc in correct order)
- EVENTS_EXPORT void activateFlushes(const bool theActivate);
-
+ //! \param theActivate a state about flushe is active. If false, the flush is disabled
+ //! \return the previous active flush state
+ EVENTS_EXPORT bool activateFlushes(const bool theActivate);
+
//! Clears all collected messages
EVENTS_EXPORT void clear(const Events_ID& theID);
// blocks the flush signals to avoid each objects visualization in the viewer
// they should not be shown once after all modifications are performed
Events_Loop* aLoop = Events_Loop::loop();
- aLoop->activateFlushes(false);
+ bool isActive = aLoop->activateFlushes(false);
TDF_Label aRefLab = generalLabel().FindChild(TAG_CURRENT_FEATURE);
CompositeFeaturePtr aMain; // main feature that may nest the new current
}
if (theCurrent.get()) {
std::shared_ptr<Model_Data> aData = std::static_pointer_cast<Model_Data>(theCurrent->data());
- if (!aData.get() || !aData->isValid()) return;
+ if (!aData.get() || !aData->isValid()) {
+ aLoop->activateFlushes(isActive);
+ return;
+ }
TDF_Label aFeatureLabel = aData->label().Father();
Handle(TDF_Reference) aRef;
}
}
// unblock the flush signals and up them after this
- aLoop->activateFlushes(true);
+ aLoop->activateFlushes(isActive);
aLoop->flush(aCreateEvent);
aLoop->flush(aRedispEvent);
static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
static Events_ID aDeleteEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
static Events_ID aToHideEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
- aLoop->activateFlushes(false);
+ bool isActive = aLoop->activateFlushes(false);
// update all objects by checking are they on labels or not
std::set<FeaturePtr> aNewFeatures, aKeptFeatures;
}
anOwner->executeFeatures() = false;
- aLoop->activateFlushes(true);
+ aLoop->activateFlushes(isActive);
if (theFlush) {
aLoop->flush(aCreateEvent);
Events_Loop* aLoop = Events_Loop::loop();
// blocks the flush signals to avoid the temporary objects visualization in the viewer
// they should not be shown in order to do not lose highlight by erasing them
- aLoop->activateFlushes(false);
+ bool isActive = aLoop->activateFlushes(false);
aData->blockSendAttributeUpdated(true);
bool isAttributeBlocked = anAttribute->blockSetInitialized(true);
restoreAttributeValue(aValid);
aData->blockSendAttributeUpdated(false);
anAttribute->blockSetInitialized(isAttributeBlocked);
- aLoop->activateFlushes(true);
+ aLoop->activateFlushes(isActive);
// In particular case the results are deleted and called as redisplayed inside of this
// highlight-selection, to they must be flushed as soon as possible.