From: asl Date: Fri, 1 Jul 2005 09:34:00 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f4b5c42b70ab512fa0d27143c0135bfbd12757ee;p=modules%2Fsmesh.git *** empty log message *** --- diff --git a/src/SMESHGUI/SMESHGUI_Operation.cxx b/src/SMESHGUI/SMESHGUI_Operation.cxx index f9a19802f..f81029837 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.cxx +++ b/src/SMESHGUI/SMESHGUI_Operation.cxx @@ -8,7 +8,12 @@ // Author : Sergey LITONIN // Module : SALOME -#include "SMESHGUI_Operation.h" +#include +#include +#include + +#include +#include /* @@ -20,8 +25,10 @@ // name : SMESHGUI_Operation // Purpose : Constructor //======================================================================= -SMESHGUI_Operation::SMESHGUI_Operation( SalomeApp_Application* theApp ) -: SalomeApp_Operation( theApp ) +SMESHGUI_Operation::SMESHGUI_Operation( SalomeApp_Application* app ) +: SalomeApp_Operation( app ), + myViewWindow( 0 ), + mySelector( 0 ) { } @@ -31,5 +38,44 @@ SMESHGUI_Operation::~SMESHGUI_Operation() } +void SMESHGUI_Operation::setSelectionMode( const Selection_Mode mode ) +{ + if( myViewWindow ) + myViewWindow->SetSelectionMode( mode ); +} + +void SMESHGUI_Operation::highlight( const Handle( SALOME_InteractiveObject )& obj, + const bool hilight, const bool immediately ) +{ + if( myViewWindow ) + myViewWindow->highlight( obj, hilight, immediately ); +} +void SMESHGUI_Operation::addOrRemoveIndex( const Handle( SALOME_InteractiveObject )& obj, + const TColStd_MapOfInteger& indices, const bool isModeShift ) +{ + if( mySelector ) + mySelector->AddOrRemoveIndex( obj, indices, isModeShift ); +} +SMESHGUI* SMESHGUI_Operation::getSMESHGUI() const +{ + return dynamic_cast( module() ); +} + +SVTK_ViewWindow* SMESHGUI_Operation::getViewWindow() const +{ + return myViewWindow; +} + +SVTK_Selector* SMESHGUI_Operation::getSelector() const +{ + return mySelector; +} + +void SMESHGUI_Operation::startOperation() +{ + SalomeApp_Operation::startOperation(); + myViewWindow = SMESH::GetViewWindow( getSMESHGUI() ); + mySelector = myViewWindow ? myViewWindow->GetSelector() : 0; +} diff --git a/src/SMESHGUI/SMESHGUI_Operation.h b/src/SMESHGUI/SMESHGUI_Operation.h index 95e2ce03e..9c6c303fd 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.h +++ b/src/SMESHGUI/SMESHGUI_Operation.h @@ -13,6 +13,14 @@ #define SMESHGUI_Operation_H #include +#include +#include + +class SMESHGUI; +class SVTK_ViewWindow; +class SVTK_Selector; +class TColStd_MapOfInteger; + /* Class : SMESHGUI_Operation @@ -24,10 +32,23 @@ class SMESHGUI_Operation : public SalomeApp_Operation Q_OBJECT public: - SMESHGUI_Operation( SalomeApp_Application* ); virtual ~SMESHGUI_Operation(); +protected: + void setSelectionMode( const Selection_Mode ); + void highlight( const Handle( SALOME_InteractiveObject )&, const bool, const bool = true ); + void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&, const TColStd_MapOfInteger&, const bool ); + + virtual void startOperation(); + + SMESHGUI* getSMESHGUI() const; + SVTK_ViewWindow* getViewWindow() const; + SVTK_Selector* getSelector() const; + +private: + SVTK_ViewWindow* myViewWindow; + SVTK_Selector* mySelector; }; #endif