Salome HOME
Issie #204: Size of Fixed constraint depends on object size
[modules/shaper.git] / src / ModuleBase / ModuleBase_ResultPrs.cpp
index c8eea52c22e4155eaab79d4322e32f145c23351d..6de0bba8fc0d5037959669ea11288756b16420f4 100644 (file)
@@ -5,7 +5,7 @@
 #include "ModuleBase_ResultPrs.h"
 
 #include <ModelAPI_Tools.h>
-#include <GeomAPI_Wire.h>
+#include <GeomAPI_PlanarEdges.h>
 #include <GeomAlgoAPI_SketchBuilder.h>
 
 #include <BRep_Builder.hxx>
@@ -20,8 +20,8 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult)
   : AIS_Shape(TopoDS_Shape()), myResult(theResult), myIsSketchMode(false)
 {
   boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(theResult);
-  boost::shared_ptr<GeomAPI_Wire> aWirePtr = 
-    boost::dynamic_pointer_cast<GeomAPI_Wire>(aShapePtr);
+  boost::shared_ptr<GeomAPI_PlanarEdges> aWirePtr = 
+    boost::dynamic_pointer_cast<GeomAPI_PlanarEdges>(aShapePtr);
   if (aWirePtr) {
     if (aWirePtr->hasPlane() ) {
       // If this is a wire with plane defined thin it is a sketch-like object
@@ -46,6 +46,8 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
                                    const Standard_Integer theMode)
 {
   boost::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(myResult);
+  if (!aShapePtr)
+    return;
   myOriginalShape = aShapePtr->impl<TopoDS_Shape>();
   Set(aShapePtr->impl<TopoDS_Shape>());
   AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);