X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_VTKUtils.cxx;h=ef9fb3896b5d62ad099ba9ba85fc9cc163ace889;hp=10bc6ba22351523fb3777999d8747c0da72b8bd6;hb=eda06d81d6e5947fa63a55261bab6c407ee02ed4;hpb=f7712f9c03c5553fc299b9bd9d28d81ce1c83666 diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 10bc6ba22..ef9fb3896 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -794,12 +794,13 @@ namespace SMESH return false; } - void UpdateView(){ + void UpdateView( bool withChildrenOfSelected ) + { if ( SVTK_ViewWindow* aWnd = SMESH::GetCurrentVtkView()) { LightApp_SelectionMgr* mgr = SMESHGUI::selectionMgr(); SALOME_ListIO selected; mgr->selectedObjects( selected ); - if( selected.Extent() == 0){ + if ( selected.Extent() == 0 ) { vtkRenderer* aRenderer = aWnd->getRenderer(); VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); vtkActorCollection *aCollection = aCopy.GetActors(); @@ -811,12 +812,36 @@ namespace SMESH break; // avoid multiple warinings if visu failed } } - }else{ + } + else + { SALOME_ListIteratorOfListIO anIter( selected ); - for( ; anIter.More(); anIter.Next()){ + for( ; anIter.More(); anIter.Next()) + { Handle(SALOME_InteractiveObject) anIO = anIter.Value(); - if ( !Update(anIO,true) ) + if ( !Update( anIO, true )) break; // avoid multiple warinings if visu failed + + if ( withChildrenOfSelected ) // update all visible children + { + QString aFatherID = anIO->getEntry(); + vtkRenderer* aRenderer = aWnd->getRenderer(); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + aCollection->InitTraversal(); + while ( vtkActor *anAct = aCollection->GetNextActor() ) { + if ( SMESH_Actor *anActor = dynamic_cast( anAct )) { + if ( anActor->hasIO() && anActor->GetVisibility() ) + { + QString aChildID = anActor->getIO()->getEntry(); + if ( aChildID.size() > aFatherID.size() && + aChildID.startsWith( aFatherID )) + if ( ! Update( anActor->getIO(), true )) + break; + } + } + } + } } } RepaintCurrentView();