void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs,
const int theViewerId,
- const bool theIsForced )
+ const bool theIsForced,
+ const bool theDoFitAll)
{
GraphicsView_Viewer* aViewer = module()->getViewer( theViewerId );
if( !aViewer )
}
aViewPort->onBoundingRectChanged(); // specific of HYDRO module
- aViewPort->fitAll();
+ if ( theDoFitAll )
+ {
+ aViewPort->fitAll();
+ }
}
void HYDROGUI_Displayer::purgeObjects( const int theViewerId )
* \param theObjs sequence of objects to display
* \param theViewerId viewer identifier
* \param theIsForced flag used to update all objects, including the unchanged ones
+ * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
*/
void Display( const HYDROData_SequenceOfObjects& theObjs,
const int theViewerId,
- const bool theIsForced );
+ const bool theIsForced,
+ const bool theDoFitAll );
/**
* \brief Purge all invalid objects in the viewer.
if( ( flags & UF_Viewer ) )
updateGV( flags & UF_GV_Init,
- flags & UF_GV_Forced );
+ flags & UF_GV_Forced,
+ flags & UF_FitAll );
if( ( flags & UF_OCCViewer ) )
updateOCCViewer( flags & UF_OCC_Init,
- flags & UF_OCC_Forced );
+ flags & UF_OCC_Forced,
+ flags & UF_FitAll );
if( ( flags & UF_Model ) && getDataModel() && getApp() )
{
}
void HYDROGUI_Module::updateGV( const bool theIsInit,
- const bool theIsForced )
+ const bool theIsForced,
+ const bool theDoFitAll )
{
if( !getDisplayer() )
return;
QListIterator<int> anIdIter( aViewManagerIdList );
while( anIdIter.hasNext() )
- getDisplayer()->UpdateAll( anIdIter.next(), theIsInit, theIsForced );
+ getDisplayer()->UpdateAll( anIdIter.next(), theIsInit, theIsForced, theDoFitAll );
}
void HYDROGUI_Module::updateOCCViewer( const bool theIsInit,
- const bool theIsForced )
+ const bool theIsForced,
+ const bool theDoFitAll )
{
HYDROGUI_OCCDisplayer* anOCCDisplayer = getOCCDisplayer();
if( !anOCCDisplayer )
QListIterator<int> anIdIter( aViewManagerIdList );
while( anIdIter.hasNext() )
- anOCCDisplayer->UpdateAll( anIdIter.next(), theIsInit, theIsForced );
+ anOCCDisplayer->UpdateAll( anIdIter.next(), theIsInit, theIsForced, theDoFitAll );
}
void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager )
private:
void updateGV( const bool theIsInit = false,
- const bool theIsForced = false );
+ const bool theIsForced = false,
+ const bool theDoFitAll = false );
void updateOCCViewer( const bool theIsInit = false,
- const bool theIsForced = false );
+ const bool theIsForced = false,
+ const bool theDoFitAll = false );
void createSelector( SUIT_ViewManager* viewMgr );
void HYDROGUI_OCCDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs,
const int theViewerId,
- const bool theIsForced )
+ const bool theIsForced,
+ const bool theDoFitAll )
{
OCCViewer_Viewer* aViewer = module()->getOCCViewer( theViewerId );
if( !aViewer )
}
}
- OCCViewer_ViewManager* aViewManager
- = ::qobject_cast<OCCViewer_ViewManager*>( aViewer->getViewManager() );
- if ( aViewManager )
+ if ( theDoFitAll )
{
- OCCViewer_ViewWindow* aViewWindow =
- ::qobject_cast<OCCViewer_ViewWindow*>( aViewManager->getActiveView() );
- if ( aViewWindow )
+ OCCViewer_ViewManager* aViewManager
+ = ::qobject_cast<OCCViewer_ViewManager*>( aViewer->getViewManager() );
+ if ( aViewManager )
{
- aViewWindow->onFitAll();
+ OCCViewer_ViewWindow* aViewWindow =
+ ::qobject_cast<OCCViewer_ViewWindow*>( aViewManager->getActiveView() );
+ if ( aViewWindow )
+ {
+ aViewWindow->onFitAll();
+ }
}
}
}
* \param theObjs sequence of objects to display
* \param theViewerId viewer identifier
* \param theIsForced flag used to update all objects, including the unchanged ones
+ * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
*/
void Display( const HYDROData_SequenceOfObjects& theObjs,
const int theViewerId,
- const bool theIsForced );
+ const bool theIsForced,
+ const bool theDoFitAll );
/**
* \brief Purge all invalid objects in the viewer.
int anUpdateFlags = 0;
+ if ( myId == ShowOnlyId || myId == ShowId || myId == ShowAllId )
+ {
+ anUpdateFlags = UF_FitAll;
+ }
+
SUIT_ViewManager* aViewMgr = module()->getApp()->activeViewManager();
if ( aViewMgr )
{
UF_OCC_Init = 0x00000100, //!< initial update (used with UF_OCCViewer)
UF_OCC_Forced = 0x00000200, //!< to force recomputing all presentations (used with UF_OCCViewer)
+ UF_FitAll = 0x00000400, //!< to do fit all (used with UF_Viewer or UF_OCCViewer)
+
UF_All = UF_Base | UF_GV_Init | UF_GV_Forced | UF_OCCViewer | UF_OCC_Init | UF_OCC_Forced//!< all update flags
} HYDRO_UpdateFlags;