From: vsv Date: Fri, 18 May 2018 11:50:07 +0000 (+0300) Subject: Task 2.1: Sketch display X-Git-Tag: EDF_2018-1~33^2~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5b77d7ee040bd9097e30450c14e92a8375a9efa4;p=modules%2Fshaper.git Task 2.1: Sketch display --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 9696ee41f..704cf46a9 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -1045,22 +1045,20 @@ void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS) { Handle(AIS_InteractiveObject) anAIS = theAIS->impl(); 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); } }