This commit is contained in:
asl 2005-11-14 13:53:44 +00:00
parent 8608b2536e
commit ff0bec3d63
2 changed files with 39 additions and 9 deletions

View File

@ -220,9 +220,12 @@ static string getName( GEOM::GEOM_Object_ptr object )
* Constructor * 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 */ /* Shading Color */
SUIT_Session* session = SUIT_Session::session(); SUIT_Session* session = SUIT_Session::session();
@ -1066,3 +1069,28 @@ void GEOM_Displayer::clearTemporary( LightApp_SelectionMgr* theSelMgr )
theSelMgr->setSelectedObjects( toSelect, true ); 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;
}

View File

@ -51,8 +51,10 @@ typedef std::list<GEOM::GEOM_Object_ptr> ObjectList;
class TColStd_MapOfInteger; class TColStd_MapOfInteger;
class LightApp_SelectionMgr; class LightApp_SelectionMgr;
class SalomeApp_Study; class SalomeApp_Study;
class SalomeApp_Application;
class SUIT_SelectionFilter; class SUIT_SelectionFilter;
//class SALOME_Selection; //class SALOME_Selection;
//#ifdef WNT //#ifdef WNT
//#include <SALOME_WNT.hxx> //#include <SALOME_WNT.hxx>
//#else //#else
@ -69,7 +71,7 @@ class GEOMGUI_WNT_EXPORT GEOM_Displayer : public LightApp_Displayer
public: public:
/* Constructor */ /* Constructor */
GEOM_Displayer( SalomeApp_Study* study ); GEOM_Displayer( SalomeApp_Study* app );
/* Destructor */ /* Destructor */
virtual ~GEOM_Displayer(); virtual ~GEOM_Displayer();
@ -127,8 +129,8 @@ public:
/* Sets name - for temporary objects only */ /* Sets name - for temporary objects only */
void SetName( const char* theName ) { myName = theName; } void SetName( const char* theName );
void UnsetName() { myName = ""; } void UnsetName();
/* Reimplemented from SALOME_Displayer */ /* Reimplemented from SALOME_Displayer */
virtual void Update( SALOME_OCCPrs* ); virtual void Update( SALOME_OCCPrs* );
@ -146,7 +148,7 @@ public:
void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); void GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
void GlobalSelection( const TColStd_MapOfInteger&, const bool = false ); void GlobalSelection( const TColStd_MapOfInteger&, const bool = false );
SalomeApp_Study* getStudy() const {return myStudy;} SalomeApp_Study* getStudy() const;
protected: protected:
/* internal methods */ /* internal methods */
@ -154,10 +156,10 @@ protected:
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ); virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
/* Sets interactive object */ /* Sets interactive object */
void setIO( const Handle(SALOME_InteractiveObject)& theIO ) { myIO = theIO; } void setIO( const Handle(SALOME_InteractiveObject)& theIO );
/* Sets shape */ /* Sets shape */
void setShape( const TopoDS_Shape& theShape ) { myShape = theShape; } void setShape( const TopoDS_Shape& theShape );
/* Resets internal data */ /* Resets internal data */
void internalReset(); void internalReset();
@ -181,7 +183,7 @@ protected:
int myDisplayMode; int myDisplayMode;
private: private:
SalomeApp_Study* myStudy; SalomeApp_Application* myApp;
}; };
#endif // __GEOM_DISPLAYER_H #endif // __GEOM_DISPLAYER_H