Salome HOME
#2271 'Fatal error' during sketching
[modules/shaper.git] / src / PartSet / PartSet_OverconstraintListener.cpp
index ba20c82a0ade8d488f8fbf56d69b72ae9ea257f4..ef25f1e9ab999154055fde5fcafa10f61a8a28fa 100755 (executable)
@@ -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<Events_Message>& 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);