From d15792ed650ae0e82df7aa4aadeaaf553f69435a Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 7 Jul 2015 11:27:09 +0300 Subject: [PATCH] Sub objects should not be visualized as the preview of the current operation. --- src/PartSet/PartSet_OperationPrs.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index 136901071..b4a5fb5a1 100755 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -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(theFeature); + if (aComposite.get()) + isSub = aComposite->isSub(theObject); + + return isSub; +} + void addValue(const ObjectPtr& theObject, const GeomShapePtr& theShape, QMap >& theObjectShapes) { @@ -150,7 +160,8 @@ void PartSet_OperationPrs::getFeatureShapes(QMap 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 if (aResult.get()) aShape = aResult->shape(); } - addValue(anObject, aShape, theObjectShapes); + if (!isSubObject(anObject, myFeature)) + addValue(anObject, aShape, theObjectShapes); } } } -- 2.39.2