X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_VTKPrsDisplayer.cxx;h=b096a067269bf316943b42c05495e80ab8ce7197;hb=a46541e0be13311c6bf3a14265f4f79d059af360;hp=a75f52a9966f60e4309a4e5df1f50506ff69fd02;hpb=575fad0fb31108a6daa332a6610254b7e57d4caf;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx b/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx index a75f52a9..b096a067 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx @@ -200,6 +200,12 @@ void HYDROGUI_VTKPrsDisplayer::Display( const HYDROData_SequenceOfObjects& theOb bool anIsInserted = ( aPrs != 0 ); if( anIsVisible && ( !aPrs || aPrs->getIsToUpdate() || theIsForced ) ) { + // Erase the presentation in the view because of the problem with GEOM_Actor upadting on second SetShape. + if ( aPrs ) + { + aViewer->Erase( aPrs, true ); + } + // Update the presentation if( HYDROGUI_VTKPrsDriver* aDriver = getDriver( (size_t)aViewer, anObj ) ) { if( aDriver->Update( anObj, aPrs ) && aPrs && !anIsInserted ) @@ -265,7 +271,7 @@ void HYDROGUI_VTKPrsDisplayer::Display( const HYDROData_SequenceOfObjects& theOb } else if ( isChanged ) { - aView->Repaint(); + aView->Repaint( true ); } } } @@ -273,12 +279,14 @@ void HYDROGUI_VTKPrsDisplayer::Display( const HYDROData_SequenceOfObjects& theOb void HYDROGUI_VTKPrsDisplayer::purgeObjects( const int theViewerId ) { + bool doEraseScalarBar = false; + SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId ); if( aViewer ) { SALOME_ListIO aListIO; aViewer->GetVisible( aListIO ); - + HYDROGUI_VTKPrs* aPrs; SALOME_ListIteratorOfListIO anIter( aListIO ); for( ; anIter.More(); anIter.Next() ) @@ -288,17 +296,47 @@ void HYDROGUI_VTKPrsDisplayer::purgeObjects( const int theViewerId ) { Handle(HYDROData_Entity) anOwnerObj = module()->getDataModel()->objectByEntry( aPrsObj->getEntry() ); - if ( !anOwnerObj.IsNull() && anOwnerObj->IsRemoved() ) + 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( aViewer->getViewManager() ); + if ( aViewMgr && aViewMgr->getViewsCount() > 0 ) + { + QVector aViews = aViewMgr->getViews(); + foreach ( SUIT_ViewWindow* aView, aViews ) + { + SVTK_ViewWindow* aVTKView = dynamic_cast( 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() ) { aPrs = module()->getObjectVTKPrs( (size_t)aViewer, anOwnerObj ); if ( aPrs ) { aViewer->Erase( aPrs ); } + else + { + } module()->removeObjectVTKPrs( (size_t)aViewer, anOwnerObj ); + doEraseScalarBar = true; } } } + + if ( doEraseScalarBar ) + { + EraseScalarBar( theViewerId ); + } } }