]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 2.1: Sketch display
authorvsv <vsv@opencascade.com>
Fri, 18 May 2018 11:50:07 +0000 (14:50 +0300)
committervsv <vsv@opencascade.com>
Fri, 18 May 2018 11:50:07 +0000 (14:50 +0300)
src/PartSet/PartSet_Module.cpp

index 9696ee41f3b99d35c0d5990c0fbdd9ec3a9e97c4..704cf46a944d1a05d37f44d1a2e3024abbd71e9e 100755 (executable)
@@ -1045,22 +1045,20 @@ void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
 {
   Handle(AIS_InteractiveObject) anAIS = theAIS->impl<Handle(AIS_InteractiveObject)>();
   if (!anAIS.IsNull()) {
-    bool aToUseZLayer = false;
     FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
-    if (aFeature.get() && PartSet_Tools::findRefsToMeFeature(aFeature,
-                                                        SketchPlugin_Projection::ID()))
-      aToUseZLayer = true;
-    Handle(AIS_InteractiveContext) aCtx = anAIS->GetContext();
-    Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAIS);
-    if (!aDim.IsNull()) {
-      aToUseZLayer = true;
-    } else {
-      Handle(SketcherPrs_SymbolPrs) aCons = Handle(SketcherPrs_SymbolPrs)::DownCast(anAIS);
-      if (!aCons.IsNull())
-      aToUseZLayer = true;
+    if (aFeature.get()) {
+      bool aToUseZLayer = false;
+      if (PartSet_Tools::findRefsToMeFeature(aFeature,SketchPlugin_Projection::ID()))
+        aToUseZLayer = true;
+      else {
+        CompositeFeaturePtr aParent = ModelAPI_Tools::compositeOwner(aFeature);
+        aToUseZLayer = (aParent.get() && (aParent->getKind() == SketchPlugin_Sketch::ID()));
+      }
+      if (aToUseZLayer) {
+        Handle(AIS_InteractiveContext) aCtx = anAIS->GetContext();
+        aCtx->SetZLayer(anAIS, myVisualLayerId);
+      }
     }
-    if (aToUseZLayer)
-      aCtx->SetZLayer(anAIS, myVisualLayerId);
   }
 }