Salome HOME
Simplification and refactoring of unit tests for SketchPlugin
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Fillet.cpp
index 2a9acd4b1e7e26af080be5eca8b9c84bafaa93ac..cb856fdc8bc03e6dde57bf87f887cf754ca6a2f6 100644 (file)
@@ -13,6 +13,7 @@
 #include "SketchPlugin_ConstraintEqual.h"
 #include "SketchPlugin_ConstraintCoincidence.h"
 #include "SketchPlugin_ConstraintLength.h"
+#include "SketchPlugin_ConstraintMiddle.h"
 #include "SketchPlugin_ConstraintTangent.h"
 #include "SketchPlugin_ConstraintRadius.h"
 #include "SketchPlugin_Tools.h"
@@ -84,6 +85,9 @@ void SketchPlugin_Fillet::execute()
   if (isUpdateFlushed)
     Events_Loop::loop()->setFlushed(anUpdateEvent, false);
 
+  // set flag here to avoid building Fillet presentation if "Redisplay" event appears
+  myFilletCreated = true;
+
   // Calculate Fillet parameters if does not yet
   if (!myBaseFeatures[0] || !myBaseFeatures[1])
     calculateFilletParameters();
@@ -178,8 +182,6 @@ void SketchPlugin_Fillet::execute()
   if(isUpdateFlushed) {
     Events_Loop::loop()->setFlushed(anUpdateEvent, true);
   }
-
-  myFilletCreated = true;
 }
 
 AISObjectPtr SketchPlugin_Fillet::getAISObject(AISObjectPtr thePrevious)
@@ -521,7 +523,8 @@ std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,
       continue;
     }
     if(aFeature->getKind() == SketchPlugin_ConstraintLength::ID()
-        || aFeature->getKind() == SketchPlugin_ConstraintEqual::ID()) {
+        || aFeature->getKind() == SketchPlugin_ConstraintEqual::ID()
+        || aFeature->getKind() == SketchPlugin_ConstraintMiddle::ID()) {
       aFeaturesToBeRemoved.insert(aFeature);
     } else {
       std::list<AttributePtr> anAttrs =