X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Displayer.cxx;h=c28de63f9e4b7cf0926fc03c70b5148b00a24961;hb=de7cf9bb0a7a41d6487013c87f4a54d0664cd303;hp=7a254ac8b191a4460bd0881d5ea345486a774703;hpb=0b4df27e9f347d6187dbf30bacf80b45c21813d4;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Displayer.cxx b/src/HYDROGUI/HYDROGUI_Displayer.cxx index 7a254ac8..c28de63f 100644 --- a/src/HYDROGUI/HYDROGUI_Displayer.cxx +++ b/src/HYDROGUI/HYDROGUI_Displayer.cxx @@ -27,6 +27,7 @@ #include "HYDROGUI_Prs.h" #include "HYDROGUI_PrsImageDriver.h" #include "HYDROGUI_PrsPolylineDriver.h" +#include "HYDROGUI_PrsZoneDriver.h" #include "HYDROGUI_Tool.h" #include @@ -55,7 +56,7 @@ void HYDROGUI_Displayer::SetToUpdate( const HYDROData_SequenceOfObjects& theObjs GraphicsView_ObjectList anObjectList = aViewPort->getObjects(); for( int i = 1, n = theObjs.Length(); i <= n; i++ ) { - Handle(HYDROData_Object) anObj = theObjs.Value( i ); + Handle(HYDROData_Entity) anObj = theObjs.Value( i ); if( anObj.IsNull() ) continue; @@ -98,7 +99,7 @@ void HYDROGUI_Displayer::DisplayAll( const int theViewerId, const bool theIsForced ) { HYDROData_SequenceOfObjects aSeq; - HYDROGUI_Tool::GetPrsSubObjects( myModule, theViewerId, aSeq ); + HYDROGUI_Tool::GetPrsSubObjects( myModule, aSeq ); Update( aSeq, theViewerId, theIsForced ); } @@ -114,7 +115,7 @@ void HYDROGUI_Displayer::Update( const HYDROData_SequenceOfObjects& theObjs, for( int i = 1, n = theObjs.Length(); i <= n; i++ ) { - const Handle(HYDROData_Object)& anObj = theObjs.Value( i ); + const Handle(HYDROData_Entity)& anObj = theObjs.Value( i ); if( anObj.IsNull() ) anObjectsToErase.Append( anObj ); else @@ -145,7 +146,7 @@ void HYDROGUI_Displayer::Erase( const HYDROData_SequenceOfObjects& theObjs, for( int i = 1, n = theObjs.Length(); i <= n; i++ ) { // the object may be null or dead - const Handle(HYDROData_Object)& anObj = theObjs.Value( i ); + const Handle(HYDROData_Entity)& anObj = theObjs.Value( i ); if( HYDROGUI_Prs* aPrs = HYDROGUI_Tool::GetPresentation( anObj, anObjectList ) ) { aViewPort->removeItem( aPrs ); @@ -171,7 +172,7 @@ void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs, GraphicsView_ObjectList anObjectList = aViewPort->getObjects(); for( int i = 1, n = theObjs.Length(); i <= n; i++ ) { - Handle(HYDROData_Object) anObj = theObjs.Value( i ); + Handle(HYDROData_Entity) anObj = theObjs.Value( i ); if( anObj.IsNull() ) continue; @@ -189,11 +190,12 @@ void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs, if( aPrs ) { - bool anIsVisible = anObj->GetVisibility(); + bool anIsVisible = myModule->isObjectVisible( (size_t)aViewer, anObj ); aPrs->setVisible( anIsVisible ); } } + aViewPort->onBoundingRectChanged(); // specific of HYDRO module aViewPort->fitAll(); } @@ -212,7 +214,7 @@ void HYDROGUI_Displayer::purgeObjects( const int theViewerId ) { if( HYDROGUI_Prs* aPrs = dynamic_cast( anIter.next() ) ) { - Handle(HYDROData_Object) anObject = aPrs->getObject(); + Handle(HYDROData_Entity) anObject = aPrs->getObject(); if( !anObject.IsNull() && anObject->IsRemoved() ) { aViewPort->removeItem( aPrs ); @@ -222,7 +224,7 @@ void HYDROGUI_Displayer::purgeObjects( const int theViewerId ) } } -HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Object)& theObj ) +HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Entity)& theObj ) { HYDROGUI_PrsDriver* aDriver = NULL; ObjectKind aKind = theObj->GetKind(); @@ -235,15 +237,20 @@ HYDROGUI_PrsDriver* HYDROGUI_Displayer::getDriver( const Handle(HYDROData_Object { case KIND_IMAGE: aDriver = new HYDROGUI_PrsImageDriver(); - myPrsDriversMap[ aKind ] = aDriver; break; case KIND_POLYLINE: aDriver = new HYDROGUI_PrsPolylineDriver(); - myPrsDriversMap[ aKind ] = aDriver; + break; + case KIND_ZONE: + aDriver = new HYDROGUI_PrsZoneDriver(); break; default: break; } + + if ( aDriver ) + myPrsDriversMap[ aKind ] = aDriver; } + return aDriver; }