From d7454d8885c5b6c2b8bfb9107cc256a742eae8f4 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 28 Sep 2015 16:26:57 +0300 Subject: [PATCH] Additional fix for the '23097: EDF GEOM: [HYDRO 513] Fit only on selected objects' issue. --- src/SVTK/SVTK_Renderer.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 6a6420e6f..89c645aca 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -708,10 +708,15 @@ void SVTK_Renderer::onFitSelection() vtkActorCollection* aCollection = aCopy.GetActors(); aCollection->InitTraversal(); while ( vtkActor* aProp = aCollection->GetNextActor() ) - if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aProp ) ) - if ( mySelector->IsSelected( anActor ) ) + if ( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aProp ) ) { + const Handle(SALOME_InteractiveObject)& io = anActor->getIO(); + if ( !io.IsNull() && mySelector->IsSelected( io ) ) aSelectedCollection->AddItem( aProp ); - + } + + if( aSelectedCollection->GetNumberOfItems() == 0 ) + return; // if collection is empty + double bounds[6]; ::ComputeBounds( aSelectedCollection, bounds ); -- 2.39.2