#include <SPlot2d_Prs.h>
#include <Plot2d_ViewWindow.h>
+#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#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 )
{
}
SALOME_Prs* prs = 0;
SALOME_View* aViewFrame = theViewFrame ? theViewFrame : GetActiveView();
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( 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;
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<SalomeApp_Study*>( 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() );
#include <VISU_Prs3d_i.hh>
#include <VISU_Table_i.hh>
-class SalomeApp_Study;
+class SalomeApp_Application;
class SVTK_ViewWindow;
class Plot2d_ViewWindow;
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 );
virtual SPlot2d_Prs* buildTable ( Plot2d_ViewWindow*, VISU::Table_i* ) const;
private:
- SalomeApp_Study* myStudy;
+ SalomeApp_Application* myApp;
};
#endif