From b86a81dd1f7bea625cdb4e882c32b80836985550 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 2 Feb 2015 09:25:06 +0300 Subject: [PATCH] Issue #393 wrong sketch presentation --- src/PartSet/PartSet_Module.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index b05715c38..253514b35 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -190,15 +190,26 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation) bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const { bool aCanDisplay = false; - if (mySketchMgr->activeSketch()) { + CompositeFeaturePtr aSketchFeature = mySketchMgr->activeSketch(); + if (aSketchFeature.get() != NULL) { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); if (aFeature.get() != NULL) { - if (aFeature == mySketchMgr->activeSketch()) { + if (aFeature == aSketchFeature) { aCanDisplay = false; } else { - aCanDisplay = mySketchMgr->sketchOperationIdList().contains(aFeature->getKind().c_str()); + for (int i = 0; i < aSketchFeature->numberOfSubs() && !aCanDisplay; i++) { + FeaturePtr aSubFeature = aSketchFeature->subFeature(i); + std::list aResults = aSubFeature->results(); + std::list::const_iterator aIt; + for (aIt = aResults.begin(); aIt != aResults.end() && !aCanDisplay; ++aIt) { + if (theObject == (*aIt)) + aCanDisplay = true; + } + if (aSubFeature == theObject) + aCanDisplay = true; + } } } } -- 2.39.2