From 78d00e78b3a468ef2001c80debd82b0c8f5c5542 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 14 Nov 2005 13:55:50 +0000 Subject: [PATCH] PAL10479 --- src/VISUGUI/VisuGUI.cxx | 2 +- src/VISUGUI/VisuGUI_Displayer.cxx | 19 +++++++++++++------ src/VISUGUI/VisuGUI_Displayer.h | 6 +++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index cfb75451..488443d8 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2937,7 +2937,7 @@ VisuGUI LightApp_Displayer* VisuGUI::displayer() { if( !myDisplayer ) - myDisplayer = new VisuGUI_Displayer( dynamic_cast( getApp()->activeStudy() ) ); + myDisplayer = new VisuGUI_Displayer( getApp() ); return myDisplayer; } diff --git a/src/VISUGUI/VisuGUI_Displayer.cxx b/src/VISUGUI/VisuGUI_Displayer.cxx index 09c43537..0d604a34 100644 --- a/src/VISUGUI/VisuGUI_Displayer.cxx +++ b/src/VISUGUI/VisuGUI_Displayer.cxx @@ -37,13 +37,14 @@ #include #include +#include #include #include "VISU_ViewManager_i.hh" -VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Study* st ) +VisuGUI_Displayer::VisuGUI_Displayer( SalomeApp_Application* app ) : LightApp_Displayer(), - myStudy( st ) + myApp( app ) { } @@ -56,10 +57,12 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V SALOME_Prs* prs = 0; SALOME_View* aViewFrame = theViewFrame ? theViewFrame : GetActiveView(); + SalomeApp_Study* study = dynamic_cast( myApp->activeStudy() ); - if ( myStudy && aViewFrame ) + if ( study && aViewFrame ) { - CORBA::Object_var anObj = VISU::ClientSObjectToObject( myStudy->studyDS()->FindObjectID( entry.latin1() ) ); + _PTR(SObject) obj = study->studyDS()->FindObjectID( entry.latin1() ); + CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj ); if( CORBA::is_nil( anObj ) ) return 0; @@ -179,12 +182,16 @@ SPlot2d_Prs* VisuGUI_Displayer::buildContainer( Plot2d_ViewWindow* wnd, VISU::Co SPlot2d_Prs* VisuGUI_Displayer::buildTable( Plot2d_ViewWindow* wnd, VISU::Table_i* t ) const { SPlot2d_Prs* prs = new SPlot2d_Prs(); - _PTR(SObject) TableSO = myStudy->studyDS()->FindObjectID( t->GetEntry().latin1() ); + SalomeApp_Study* study = dynamic_cast( myApp->activeStudy() ); + if( !study ) + return prs; + + _PTR(SObject) TableSO = study->studyDS()->FindObjectID( t->GetEntry().latin1() ); if( !TableSO ) return prs; - _PTR(ChildIterator) Iter = myStudy->studyDS()->NewChildIterator( TableSO ); + _PTR(ChildIterator) Iter = study->studyDS()->NewChildIterator( TableSO ); for( ; Iter->More(); Iter->Next() ) { CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() ); diff --git a/src/VISUGUI/VisuGUI_Displayer.h b/src/VISUGUI/VisuGUI_Displayer.h index 288b66b7..62a24725 100644 --- a/src/VISUGUI/VisuGUI_Displayer.h +++ b/src/VISUGUI/VisuGUI_Displayer.h @@ -33,7 +33,7 @@ #include #include -class SalomeApp_Study; +class SalomeApp_Application; class SVTK_ViewWindow; class Plot2d_ViewWindow; class SPlot2d_Prs; @@ -41,7 +41,7 @@ class SPlot2d_Prs; class VisuGUI_Displayer : public LightApp_Displayer { public: - VisuGUI_Displayer( SalomeApp_Study* ); + VisuGUI_Displayer( SalomeApp_Application* ); ~VisuGUI_Displayer(); virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ); @@ -54,7 +54,7 @@ protected: virtual SPlot2d_Prs* buildTable ( Plot2d_ViewWindow*, VISU::Table_i* ) const; private: - SalomeApp_Study* myStudy; + SalomeApp_Application* myApp; }; #endif -- 2.39.2