From 05468628bd11c950d60061a2f8764fb64c94f613 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 9 Oct 2017 14:27:46 +0300 Subject: [PATCH] #2271 'Fatal error' during sketching open case_hdistance study, edit sketch. The conflicting constraints do not marked in black(conflicting) color. --- src/PartSet/PartSet_OverconstraintListener.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index ba20c82a0..ef25f1e9a 100755 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -87,6 +87,9 @@ void PartSet_OverconstraintListener::getCustomColor(const ObjectPtr& theObject, if (!myIsActive) return; + FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); + std::string aFeatureName = aFeature->data()->name(); + if (myConflictingObjects.find(theObject) != myConflictingObjects.end()) { theColor = Config_PropManager::color("Visualization", "sketch_overconstraint_color"); } @@ -107,8 +110,11 @@ void PartSet_OverconstraintListener::getCustomColor(const ObjectPtr& theObject, void PartSet_OverconstraintListener::processEvent( const std::shared_ptr& theMessage) { - if (!myIsActive) - return; + // #2271 open document: if sketch has confilcting elements, solver sends message with the elements + // by opening the document. Sketch is not active, but an internal container should be updated. + // So, we should not check whether the listener is active here + //if (!myIsActive) + // return; #ifdef DEBUG_FEATURE_OVERCONSTRAINT_LISTENER bool isRepaired = theMessage->eventID() == Events_Loop::eventByName(EVENT_SOLVER_REPAIRED); -- 2.39.2