]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Sub objects should not be visualized as the preview of the current operation.
authornds <natalia.donis@opencascade.com>
Tue, 7 Jul 2015 08:27:09 +0000 (11:27 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 7 Jul 2015 08:27:09 +0000 (11:27 +0300)
src/PartSet/PartSet_OperationPrs.cpp

index 13690107113100a0c7eee61bb24f0e27f6366f84..b4a5fb5a1636340eb50db3325d5a2bb74c082ce2 100755 (executable)
@@ -114,6 +114,16 @@ bool PartSet_OperationPrs::isVisible(XGUI_Displayer* theDisplayer, const ObjectP
   return aVisible;
 }
 
+bool isSubObject(const ObjectPtr& theObject, const FeaturePtr& theFeature)
+{
+  bool isSub = false;
+  CompositeFeaturePtr aComposite = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theFeature);
+  if (aComposite.get())
+    isSub = aComposite->isSub(theObject);
+
+  return isSub;
+}
+
 void addValue(const ObjectPtr& theObject, const GeomShapePtr& theShape,
               QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
 {
@@ -150,7 +160,8 @@ void PartSet_OperationPrs::getFeatureShapes(QMap<ObjectPtr, QList<GeomShapePtr>
         GeomShapePtr aShape = aSelAttribute->value();
         if (!aShape.get())
           aShape = aResult->shape();
-        addValue(aResult, aShape, theObjectShapes);
+        if (!isSubObject(aResult, myFeature))
+          addValue(aResult, aShape, theObjectShapes);
       }
     }
     else {
@@ -186,7 +197,8 @@ void PartSet_OperationPrs::getFeatureShapes(QMap<ObjectPtr, QList<GeomShapePtr>
           if (aResult.get())
             aShape = aResult->shape();
         }
-        addValue(anObject, aShape, theObjectShapes);
+        if (!isSubObject(anObject, myFeature))
+          addValue(anObject, aShape, theObjectShapes);
       }
     }
   }