#include "HYDROGUI_Module.h"
#include "HYDROGUI_Tool.h"
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewModel.h>
+
HYDROGUI_AbstractDisplayer::HYDROGUI_AbstractDisplayer( HYDROGUI_Module* theModule )
: myModule( theModule )
{
{
}
+bool HYDROGUI_AbstractDisplayer::IsApplicable( const int theViewerId ) const
+{
+ return IsApplicable( myModule->getViewManager( theViewerId ) );
+}
+
+bool HYDROGUI_AbstractDisplayer::IsApplicable( const SUIT_ViewManager* theViewMgr ) const
+{
+ return ( theViewMgr && ( theViewMgr->getType() == GetType() ) );
+}
+
void HYDROGUI_AbstractDisplayer::UpdateAll( const int theViewerId,
const bool theIsInit,
const bool theIsForced,
// Now dig in the data model
HYDROData_SequenceOfObjects anObjectsToErase, anObjectsToDisplay;
+ SUIT_ViewModel* aViewer = module()->getViewManager( theViewerId )->getViewModel();
for( int i = 1, n = theObjs.Length(); i <= n; i++ )
{
const Handle(HYDROData_Entity)& anObj = theObjs.Value( i );
- if( anObj.IsNull() )
- anObjectsToErase.Append( anObj );
- else
+
+ if( module()->isObjectVisible( (size_t)aViewer, anObj ) )
+ {
anObjectsToDisplay.Append( anObj );
+ }
+ else
+ {
+ anObjectsToErase.Append( anObj );
+ }
}
if( anObjectsToErase.Length() )