]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketcherPrs/SketcherPrs_Radius.cpp
Salome HOME
Empty AIS in the viewer: throw c++ exception (to be finalized, currently do nothing)
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Radius.cpp
index d6299a9050a39d449625d382cef9e5e27f056bd6..d26d3e539463d0e0992e7b96c9291b7674961b42 100644 (file)
@@ -12,6 +12,8 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Arc.h>
 
+#include <Events_Error.h>
+
 #include <GeomDataAPI_Point2D.h>
 #include <GeomAPI_Pnt2d.h>
 #include <GeomAPI_Circ.h>
@@ -52,8 +54,10 @@ void SketcherPrs_Radius::Compute(const Handle(PrsMgr_PresentationManager3d)& the
   std::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr = 
     std::dynamic_pointer_cast<GeomDataAPI_Point2D>
     (aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
-  if (!aFlyoutAttr->isInitialized())
+  if (!aFlyoutAttr->isInitialized()) {
+    Events_Error::throwException("An empty AIS presentation: SketcherPrs_Radius");
     return; // can not create a good presentation
+  }
 
   // Get circle
   std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =