]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for visualization of "Redo" in sketch crash
authormpv <mikhail.ponikarov@opencascade.com>
Mon, 19 May 2014 11:37:28 +0000 (15:37 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Mon, 19 May 2014 11:37:28 +0000 (15:37 +0400)
src/PartSet/PartSet_OperationSketchBase.cpp

index 9eac6c82afb55df6867d81a97dffc5918aa593a7..0dd6efc9010b01e96c3d97acbc3cdaa4dc20dc82 100644 (file)
@@ -5,6 +5,7 @@
 #include <PartSet_OperationSketchBase.h>
 
 #include <SketchPlugin_Feature.h>
+#include <Model_Object.h>
 
 #include <V3d_View.hxx>
 
@@ -29,6 +30,12 @@ boost::shared_ptr<GeomAPI_Shape> PartSet_OperationSketchBase::preview(
 {
   boost::shared_ptr<SketchPlugin_Feature> aFeature = 
                               boost::dynamic_pointer_cast<SketchPlugin_Feature>(theFeature);
+  if (!aFeature) { // if it is reference to a object feature
+    boost::shared_ptr<Model_Object> anObj = 
+      boost::dynamic_pointer_cast<Model_Object>(theFeature);
+    if (anObj) 
+      aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(anObj->featureRef());
+  }
   return aFeature->preview();
 }