]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #393 wrong sketch presentation
authornds <natalia.donis@opencascade.com>
Mon, 2 Feb 2015 06:25:06 +0000 (09:25 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 2 Feb 2015 06:25:06 +0000 (09:25 +0300)
src/PartSet/PartSet_Module.cpp

index b05715c3847463a83df72c4fdda44ae894ae3c8d..253514b35851187a985df819b9a7ac3ddd7ee7ef 100644 (file)
@@ -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<ResultPtr> aResults = aSubFeature->results();
+          std::list<ResultPtr>::const_iterator aIt;
+          for (aIt = aResults.begin(); aIt != aResults.end() && !aCanDisplay; ++aIt) {
+            if (theObject == (*aIt))
+              aCanDisplay = true;
+          }
+          if (aSubFeature == theObject)
+            aCanDisplay = true;
+        }
       }
     }
   }