#include "HYDROGUI_Prs.h"
#include "HYDROGUI_PrsImageDriver.h"
#include "HYDROGUI_PrsPolylineDriver.h"
+#include "HYDROGUI_PrsZoneDriver.h"
#include "HYDROGUI_Tool.h"
#include <GraphicsView_Viewer.h>
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;
const bool theIsForced )
{
HYDROData_SequenceOfObjects aSeq;
- HYDROGUI_Tool::GetPrsSubObjects( myModule, theViewerId, aSeq );
+ HYDROGUI_Tool::GetPrsSubObjects( myModule, aSeq );
Update( aSeq, theViewerId, theIsForced );
}
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
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 );
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;
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();
}
{
if( HYDROGUI_Prs* aPrs = dynamic_cast<HYDROGUI_Prs*>( anIter.next() ) )
{
- Handle(HYDROData_Object) anObject = aPrs->getObject();
+ Handle(HYDROData_Entity) anObject = aPrs->getObject();
if( !anObject.IsNull() && anObject->IsRemoved() )
{
aViewPort->removeItem( aPrs );
}
}
-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();
{
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;
}