SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId );
if( aViewer )
{
- SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(
- aViewer->getViewManager()->getActiveView() );
- if ( aView )
+ if ( myScalarBars.contains( (size_t)aViewer ) )
{
- if ( myScalarBars.contains( (size_t)aViewer ) )
+ SUIT_ViewManager* aViewMgr = dynamic_cast<SUIT_ViewManager*>( aViewer->getViewManager() );
+ if ( aViewMgr && aViewMgr->getViewsCount() > 0 )
{
- vtkScalarBarActor* aScalarBar = myScalarBars[ (size_t)aViewer ];
- if ( aView->getRenderer()->HasViewProp( aScalarBar ) )
+ SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>( aViewMgr->getActiveView() );
+ if ( aView )
{
- aView->getRenderer()->RemoveActor2D( aScalarBar );
+ vtkScalarBarActor* aScalarBar = myScalarBars[ (size_t)aViewer ];
+ if ( aView->getRenderer()->HasViewProp( aScalarBar ) )
+ {
+ aView->getRenderer()->RemoveActor2D( aScalarBar );
+ }
}
}
+ myScalarBars.remove( (size_t)aViewer );
}
}
}