SMESHGUI_Displayer::SMESHGUI_Displayer( SalomeApp_Application* app )
: LightApp_Displayer(),
- myApp( app )
+ myApp( app ),
+ isNeedFitAll(false)
{
}
anActor = SMESH::CreateActor( entry.toUtf8().data(), true );
if( anActor )
{
+ isNeedFitAll = SMESH::NoSmeshActors();
SMESH::DisplayActor( wnd, anActor );
prs = LightApp_Displayer::buildPresentation( entry.toUtf8().data(), aViewFrame );
}
}
return res;
}
+
+void SMESHGUI_Displayer::Display( const QStringList& theList, const bool anUpdateViewer, SALOME_View* theView )
+{
+ LightApp_Displayer::Display( theList, anUpdateViewer, theView );
+
+ if (isNeedFitAll) {
+ SMESH::FitAll();
+ isNeedFitAll = false;
+ }
+}
\ No newline at end of file
SMESHGUI_Displayer( SalomeApp_Application* );
~SMESHGUI_Displayer();
- virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
- virtual bool canBeDisplayed( const QString&, const QString& ) const;
+ virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ) override;
+ virtual bool canBeDisplayed( const QString&, const QString& ) const override;
+ virtual void Display( const QStringList&, const bool = true, SALOME_View* = 0) override;
protected:
SalomeApp_Study* study() const;
private:
SalomeApp_Application* myApp;
+ bool isNeedFitAll;
};
#endif // SMESHGUI_DISPLAYER_H
*/
//================================================================================
- bool noSmeshActors(SUIT_ViewWindow *theWnd)
+ bool NoSmeshActors(SUIT_ViewWindow *theWnd)
{
- if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWnd)) {
+ SUIT_ViewWindow* aWnd = ( theWnd == nullptr ) ? GetActiveWindow() : theWnd;
+ if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(aWnd)) {
vtkRenderer *aRenderer = aViewWindow->getRenderer();
VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *aCollection = aCopy.GetActors();
if ( (aVisualObj = GetVisualObj(theEntry)) && aVisualObj->IsValid())
{
if ((anActor = CreateActor(theEntry,true))) {
- bool needFitAll = noSmeshActors(theWnd); // fit for the first object only
+ bool needFitAll = NoSmeshActors(theWnd); // fit for the first object only
DisplayActor(theWnd,anActor);
anActor->SetVisibility(true);
aStudy->setVisibilityState(theEntry, Qtx::ShownState);
SMESHGUI_EXPORT
void UpdateActorsAfterUpdateStudy();
+
+ SMESHGUI_EXPORT
+ bool NoSmeshActors(SUIT_ViewWindow *theWnd=nullptr);
+
};
#endif // SMESHGUI_VTKUTILS_H