]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make circle and arc participate in results construction
authormpv <mikhail.ponikarov@opencascade.com>
Tue, 29 Jul 2014 07:35:20 +0000 (11:35 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Tue, 29 Jul 2014 07:35:20 +0000 (11:35 +0400)
src/SketchPlugin/SketchPlugin_Sketch.cpp

index 76e48e0760ce6f565de147baa5d92159f07c37c9..288e4e5297b308d8c5aab90a98be643ed3405bf9 100644 (file)
@@ -61,12 +61,19 @@ void SketchPlugin_Sketch::execute()
   std::list< boost::shared_ptr<GeomAPI_Shape> > aFeaturesPreview;
   for (; anIt != aLast; anIt++) {
     aFeature = boost::dynamic_pointer_cast<SketchPlugin_Feature>(*anIt);
-    boost::shared_ptr<ModelAPI_ResultConstruction> aRes = 
-      boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aFeature->firstResult());
-    if (aRes) {
-      boost::shared_ptr<GeomAPI_Shape> aShape = aRes->shape();
-      if (aShape)
-        aFeaturesPreview.push_back(aShape);
+    if (aFeature) {
+
+      const std::list<boost::shared_ptr<ModelAPI_Result> >& aRes = aFeature->results();
+      std::list<boost::shared_ptr<ModelAPI_Result> >::const_iterator aResIter = aRes.cbegin();
+      for(; aResIter != aRes.cend(); aResIter++) {
+        boost::shared_ptr<ModelAPI_ResultConstruction> aConstr = 
+          boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aResIter);
+        if (aConstr) {
+          boost::shared_ptr<GeomAPI_Shape> aShape = aConstr->shape();
+          if (aShape)
+            aFeaturesPreview.push_back(aShape);
+        }
+      }
     }
   }