Salome HOME
Update TestConstraintEqual.py
[modules/shaper.git] / src / InitializationPlugin / InitializationPlugin_Plugin.cpp
index f3ef02d96f74386779af970e047e0496363f9433..b37e89ead260a28966c41385ae172dc625013aba 100644 (file)
@@ -91,17 +91,21 @@ FeaturePtr InitializationPlugin_Plugin::createPlane(DocumentPtr theDoc, double t
   aPlane->real("D")->setValue(0.);
 
   if (theX) {
-    aPlane->data()->setName("Y0Z");
+    aPlane->data()->setName("YOZ");
   } else if (theY) {
-    aPlane->data()->setName("X0Z");
+    aPlane->data()->setName("XOZ");
   } else if (theZ) {
-    aPlane->data()->setName("X0Y");
+    aPlane->data()->setName("XOY");
   }
   aPlane->setInHistory(aPlane, false);  // don't show automatically created feature in the features history
 
   // the plane should be executed in order to build the feature result immediatelly
   // the results are to be hidden in the plugin
   aPlane->execute();
+  // this flag is needed here to avoid setting it inside of the next transaction
+  // (may cause crash on redo of the first transaction in OCAF)
+  aPlane->data()->execState(ModelAPI_StateDone);
+  aPlane->firstResult()->data()->execState(ModelAPI_StateDone);
 
   return aPlane;
 }
@@ -118,6 +122,8 @@ FeaturePtr InitializationPlugin_Plugin::createPoint(DocumentPtr theDoc)
   // the point should be executed in order to build the feature result immediatelly
   // the results are to be hidden in the plugin
   aPoint->execute();
+  aPoint->data()->execState(ModelAPI_StateDone);
+  aPoint->firstResult()->data()->execState(ModelAPI_StateDone);
 
   return aPoint;
 }