Salome HOME
Issue #2998: Add help description for automatic creation of constraints
[modules/shaper.git] / src / ModuleBase / ModuleBase_ISelection.cpp
index 73999c6011f5549c3cdab609edfd8b749720be8c..a44dd7d8a1c42cb9676c4b059f0a83f08be3c834 100644 (file)
@@ -20,6 +20,7 @@
 #include "ModuleBase_ISelection.h"
 
 #include "ModuleBase_ViewerPrs.h"
+#include "ModelAPI_Feature.h"
 
 #include <StdSelect_BRepOwner.hxx>
 #include <TopoDS_Vertex.hxx>
@@ -53,8 +54,10 @@ ResultPtr ModuleBase_ISelection::getResult(const ModuleBase_ViewerPrsPtr& thePrs
 {
   ResultPtr aResult;
 
-  if (thePrs->object().get())
-    aResult = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs->object());
+  if (thePrs->object().get()) {
+    ObjectPtr aObject = thePrs->object();
+    aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObject);
+  }
   else if (!thePrs->owner().IsNull()) {
     ObjectPtr anObject = getSelectableObject(thePrs->owner());
     aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);