From: vsv Date: Wed, 22 Aug 2018 15:34:49 +0000 (+0300) Subject: Issue #2605: Fix visibility state for complex objects with nesting more then 2 X-Git-Tag: SHAPER_V9_1_0RC1~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=575a81e93bbdebf521e34bcb4396451b38b25ab7;p=modules%2Fshaper.git Issue #2605: Fix visibility state for complex objects with nesting more then 2 --- diff --git a/src/PartSet/PartSet_TreeNodes.cpp b/src/PartSet/PartSet_TreeNodes.cpp index dbdbc4214..8cd065e16 100644 --- a/src/PartSet/PartSet_TreeNodes.cpp +++ b/src/PartSet/PartSet_TreeNodes.cpp @@ -159,21 +159,24 @@ PartSet_ObjectNode::VisibilityState PartSet_ObjectNode::visibilityState() const ModuleBase_IWorkshop* aWork = workshop(); ResultBodyPtr aCompRes = std::dynamic_pointer_cast(aResObj); if (aCompRes.get()) { - VisibilityState aState = aCompRes->numberOfSubs(true) == 0 ? - (aWork->isVisible(aCompRes) ? Visible : Hidden) : NoneState; std::list aResultsList; ModelAPI_Tools::allSubs(aCompRes, aResultsList); + VisibilityState aState = aResultsList.size() == 0 ? + (aWork->isVisible(aCompRes) ? Visible : Hidden) : NoneState; std::list::const_iterator aIt; - //for (int i = 0; i < aCompRes->numberOfSubs(true); i++) { + ResultBodyPtr aCompSub; for (aIt = aResultsList.cbegin(); aIt != aResultsList.cend(); aIt++) { - ResultPtr aSubRes = (*aIt); // aCompRes->subResult(i, true); - VisibilityState aS = aWork->isVisible(aSubRes) ? Visible : Hidden; - if (aState == NoneState) - aState = aS; - else if (aState != aS) { - aState = SemiVisible; - break; + ResultPtr aSubRes = (*aIt); + aCompSub = std::dynamic_pointer_cast(aSubRes); + if (!(aCompSub.get() && aCompSub->numberOfSubs() > 0)) { + VisibilityState aS = aWork->isVisible(aSubRes) ? Visible : Hidden; + if (aState == NoneState) + aState = aS; + else if (aState != aS) { + aState = SemiVisible; + break; + } } } return aState;