- Handle(HYDROData_Object) anObject = aModel->objectByEntry( anOwner->entry() );
- if( !anObject.IsNull() )
- anObject->SetVisibility( aVisibility ? true : false );
+ if ( anObject->GetKind() == KIND_IMAGE )
+ isFoundImage = true;
+
+ module()->setObjectVisible( aViewId, anObject, aVisibility );
+ if ( anObject->GetKind() == KIND_REGION )
+ {
+ Handle( HYDROData_Region ) aRegion = Handle( HYDROData_Region )::DownCast( anObject );
+ if ( !aRegion.IsNull() )
+ {
+ HYDROData_SequenceOfObjects aZonesSeq = aRegion->GetZones();
+ for( Standard_Integer aZoneIdx = 1, aNbZones = aZonesSeq.Length(); aZoneIdx <= aNbZones; aZoneIdx++ )
+ {
+ anObject = aZonesSeq.Value( aZoneIdx );
+ if( !anObject.IsNull() )
+ {
+ module()->setObjectVisible( aViewId, anObject, aVisibility );
+ }
+ }
+ }
+ }
+ else if ( anObject->GetKind() == KIND_BATHYMETRY && aVisibility )
+ {
+ if ( !(anUpdateFlags & UF_VTKViewer) )
+ {
+ // Activate VTK viewer if show a bathymetry
+ aVTKMgr = module()->getApp()->viewManager( SVTK_Viewer::Type() );
+ if ( !aVTKMgr )
+ {
+ aVTKMgr = module()->getApp()->createViewManager( SVTK_Viewer::Type() );
+ }
+ if ( aVTKMgr )
+ {
+ module()->setObjectVisible( (size_t)aVTKMgr->getViewModel(), anObject, aVisibility );
+ }
+ }
+ }