]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL10479 V3_1_0a3
authorasl <asl@opencascade.com>
Mon, 14 Nov 2005 13:53:44 +0000 (13:53 +0000)
committerasl <asl@opencascade.com>
Mon, 14 Nov 2005 13:53:44 +0000 (13:53 +0000)
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_Displayer.h

index e13cba929e188f2da6de86d914c928f8353cc722..20b49e11c866fe3142892aaaccd8fd24bbc4ac6d 100644 (file)
@@ -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<SalomeApp_Application*>( 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<SalomeApp_Study*>( myApp->activeStudy() );
+}
+
+void GEOM_Displayer::setIO( const Handle(SALOME_InteractiveObject)& theIO )
+{
+  myIO = theIO;
+}
+
+void GEOM_Displayer::setShape( const TopoDS_Shape& theShape )
+{
+  myShape = theShape;
+}
index 72718951f21789504189bb3d0aa21c2c063ec77e..8d081a0ddd5f261637fa8c7730a185b4888ddf10 100644 (file)
@@ -51,8 +51,10 @@ typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
 class TColStd_MapOfInteger;
 class LightApp_SelectionMgr;
 class SalomeApp_Study;
+class SalomeApp_Application;
 class SUIT_SelectionFilter;
 //class SALOME_Selection;
+
 //#ifdef WNT
 //#include <SALOME_WNT.hxx>
 //#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