Salome HOME
Fix the problem of not previewed results of constraints applied. Flash Delete (for...
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Services.cpp
index c1c6e64b3a1d1f5f4df34ccf2f12bf2f40c0a0ee..db14a4601929044d5ca650fa5af690784a91ef5f 100644 (file)
@@ -1,5 +1,6 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 // Name   : ModelHighAPI_Services.cpp
-// Purpose: 
+// Purpose:
 //
 // History:
 // 17/06/16 - Sergey POKHODENKO - Creation of the file
@@ -12,6 +13,7 @@
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Document.h>
 #include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_Events.h>
 
 #include <cmath>
 
@@ -56,7 +58,7 @@ std::string defaultPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
     return std::string();
 
   // XOY or XOZ
-  if (fabs(theNormal->x()) < aTol && 
+  if (fabs(theNormal->x()) < aTol &&
       fabs(theDirX->x() - 1.0) < aTol && fabs(theDirX->y()) < aTol && fabs(theDirX->z()) < aTol) {
     // XOY
     if (fabs(theNormal->y()) < aTol && fabs(theNormal->z() - 1.0) < aTol)
@@ -65,8 +67,10 @@ std::string defaultPlane(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
       return std::string("XOZ");
   }
   // YOZ
-  else if (fabs(theNormal->x() - 1.0) < aTol && fabs(theNormal->y()) < aTol && fabs(theNormal->z()) < aTol &&
-           fabs(theDirX->x()) < aTol && fabs(theDirX->y() - 1.0) < aTol && fabs(theDirX->z()) < aTol)
+  else if (fabs(theNormal->x() - 1.0) < aTol &&
+           fabs(theNormal->y()) < aTol && fabs(theNormal->z()) < aTol &&
+           fabs(theDirX->x()) < aTol && fabs(theDirX->y() - 1.0) < aTol &&
+           fabs(theDirX->z()) < aTol)
     return std::string("YOZ");
 
   return std::string();
@@ -84,9 +88,12 @@ void begin()
 {
   ModelAPI_Session::get()->startOperation();
 }
+
 void end()
 {
   ModelAPI_Session::get()->finishOperation();
+  // to update data tree in the end of dumped script execution
+  ModelAPI_EventCreator::get()->sendReordered(FeaturePtr());
 }
 void apply()
 {