+ if ( anOwnerObj.IsNull() )
+ {
+ // We found an unknown IO presented in the viewer.
+ // Remove such an orphan presentation from all the views of the viewer.
+ SUIT_ViewManager* aViewMgr = dynamic_cast<SUIT_ViewManager*>( aViewer->getViewManager() );
+ if ( aViewMgr && aViewMgr->getViewsCount() > 0 )
+ {
+ QVector<SUIT_ViewWindow*> aViews = aViewMgr->getViews();
+ foreach ( SUIT_ViewWindow* aView, aViews )
+ {
+ SVTK_ViewWindow* aVTKView = dynamic_cast<SVTK_ViewWindow*>( aView );
+ if ( aVTKView )
+ {
+ aVTKView->Erase( aPrsObj, false );
+ }
+ }
+ }
+ // Remove the object presentation from the module's cache
+ module()->removeObjectVTKPrs( (size_t)aViewer, aPrsObj->getEntry() );
+ doEraseScalarBar = true;
+ }
+ else if ( anOwnerObj->IsRemoved() )