From: asl Date: Mon, 14 Nov 2005 13:53:44 +0000 (+0000) Subject: PAL10479 X-Git-Tag: V3_1_0a3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ff0bec3d6388380c3df8434aee2d977d0f06e68e;p=modules%2Fgeom.git PAL10479 --- diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index e13cba929..20b49e11c 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -220,9 +220,12 @@ static string getName( GEOM::GEOM_Object_ptr object ) * Constructor */ //================================================================= -GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* study ) +GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st ) { - myStudy = study; + if( st ) + myApp = dynamic_cast( st->application() ); + else + myApp = 0; /* Shading Color */ SUIT_Session* session = SUIT_Session::session(); @@ -1066,3 +1069,28 @@ void GEOM_Displayer::clearTemporary( LightApp_SelectionMgr* theSelMgr ) theSelMgr->setSelectedObjects( toSelect, true ); } + +void GEOM_Displayer::SetName( const char* theName ) +{ + myName = theName; +} + +void GEOM_Displayer::UnsetName() +{ + myName = ""; +} + +SalomeApp_Study* GEOM_Displayer::getStudy() const +{ + return dynamic_cast( myApp->activeStudy() ); +} + +void GEOM_Displayer::setIO( const Handle(SALOME_InteractiveObject)& theIO ) +{ + myIO = theIO; +} + +void GEOM_Displayer::setShape( const TopoDS_Shape& theShape ) +{ + myShape = theShape; +} diff --git a/src/GEOMGUI/GEOM_Displayer.h b/src/GEOMGUI/GEOM_Displayer.h index 72718951f..8d081a0dd 100644 --- a/src/GEOMGUI/GEOM_Displayer.h +++ b/src/GEOMGUI/GEOM_Displayer.h @@ -51,8 +51,10 @@ typedef std::list ObjectList; class TColStd_MapOfInteger; class LightApp_SelectionMgr; class SalomeApp_Study; +class SalomeApp_Application; class SUIT_SelectionFilter; //class SALOME_Selection; + //#ifdef WNT //#include //#else @@ -69,7 +71,7 @@ class GEOMGUI_WNT_EXPORT GEOM_Displayer : public LightApp_Displayer public: /* Constructor */ - GEOM_Displayer( SalomeApp_Study* study ); + GEOM_Displayer( SalomeApp_Study* app ); /* Destructor */ virtual ~GEOM_Displayer(); @@ -127,8 +129,8 @@ public: /* Sets name - for temporary objects only */ - void SetName( const char* theName ) { myName = theName; } - void UnsetName() { myName = ""; } + void SetName( const char* theName ); + void UnsetName(); /* Reimplemented from SALOME_Displayer */ virtual void Update( SALOME_OCCPrs* ); @@ -146,7 +148,7 @@ public: void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); void GlobalSelection( const TColStd_MapOfInteger&, const bool = false ); - SalomeApp_Study* getStudy() const {return myStudy;} + SalomeApp_Study* getStudy() const; protected: /* internal methods */ @@ -154,10 +156,10 @@ protected: virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ); /* Sets interactive object */ - void setIO( const Handle(SALOME_InteractiveObject)& theIO ) { myIO = theIO; } + void setIO( const Handle(SALOME_InteractiveObject)& theIO ); /* Sets shape */ - void setShape( const TopoDS_Shape& theShape ) { myShape = theShape; } + void setShape( const TopoDS_Shape& theShape ); /* Resets internal data */ void internalReset(); @@ -181,7 +183,7 @@ protected: int myDisplayMode; private: - SalomeApp_Study* myStudy; + SalomeApp_Application* myApp; }; #endif // __GEOM_DISPLAYER_H