- Handle(HYDROData_Object) anObject = aModel->objectByEntry( anOwner->entry() );
- if( !anObject.IsNull() )
- anObject->SetVisibility( aVisibility ? true : false );
+ if ( anObject->GetKind() == KIND_IMAGE )
+ isFoundImage = true;
+
+ aModule->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() )
+ {
+ aModule->setObjectVisible( aViewId, anObject, aVisibility );
+ }
+ }
+ }
+ }
+ else if ( anObject->GetKind() == KIND_BATHYMETRY && aVisibility )
+ {
+ if ( anUpdateFlags & UF_OCCViewer )
+ {
+ aModule->setObjectVisible( aViewId, anObject, aVisibility );
+ }
+ else if ( !(anUpdateFlags & UF_VTKViewer) )
+ {
+ // Activate VTK viewer if show a bathymetry
+ aVTKMgr = aModule->getApp()->viewManager( SVTK_Viewer::Type() );
+ if ( !aVTKMgr )
+ {
+ aVTKMgr = aModule->getApp()->createViewManager( SVTK_Viewer::Type() );
+ }
+ if ( aVTKMgr )
+ {
+ aModule->setObjectVisible( (size_t)aVTKMgr->getViewModel(), anObject, aVisibility );
+ }
+ }
+ }