Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / PartSet / PartSet_OperationPrs.cpp
index 50b8cae9014febae492b8ddbc518854540ac6a0c..445c4ad8c8500baaa4f99278c7018aba828bece0 100755 (executable)
@@ -42,7 +42,7 @@
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_Session.h>
-#include <ModelAPI_ResultCompSolid.h>
+#include <ModelAPI_ResultBody.h>
 #include <ModelAPI_Tools.h>
 
 #include <Events_InfoMessage.h>
@@ -145,11 +145,6 @@ void PartSet_OperationPrs::Compute(
       StdPrs_WFShape::Add(thePresentation, aShape, aDrawer);
     }
     catch (...) {
-      Events_InfoMessage("PartSet_OperationPrs",
-        "An empty AIS presentation: PartSet_OperationPrs").send();
-      std::shared_ptr<Events_Message> aMsg = std::shared_ptr<Events_Message>(
-        new Events_Message(Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION)));
-      Events_Loop::loop()->send(aMsg);
       return;
     }
   }
@@ -194,12 +189,12 @@ void PartSet_OperationPrs::addValue(const ObjectPtr& theObject, const GeomShapeP
   if (theObject.get()) {
     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
     if (aResult.get()) {
-      ResultCompSolidPtr aCompsolidResult =
-        std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObject);
-      if (aCompsolidResult.get()) {
-        if (aCompsolidResult->numberOfSubs() > 0) {
-          for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
-            ResultPtr aSubResult = aCompsolidResult->subResult(i);
+      ResultBodyPtr aBodyResult =
+        std::dynamic_pointer_cast<ModelAPI_ResultBody>(theObject);
+      if (aBodyResult.get()) {
+        if (aBodyResult->numberOfSubs() > 0) {
+          for(int i = 0; i < aBodyResult->numberOfSubs(); i++) {
+            ResultPtr aSubResult = aBodyResult->subResult(i);
             if (aSubResult.get()) {
               GeomShapePtr aShape;
               addValue(aSubResult, aShape, theFeature, theWorkshop, theObjectShapes);