X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG_WITHIHM%2FlibSMESH_Swig.cxx;h=679a8d8532f5d04f6c26bc661b19270cff099aba;hp=eca22e91e77323f0d982a7df4b755de0010658b3;hb=f5016d85b7b4b88623723027a1585c6414c4dc66;hpb=e4f02cdb389c8e4170ac26760a3f0257a009fd3b diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx index eca22e91e..679a8d853 100644 --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx @@ -37,6 +37,9 @@ // SALOME GUI includes #include +#include +#include +#include #include #include #include @@ -575,6 +578,44 @@ void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry ) ProcessVoidEvent(new TEvent(Mesh_Entry)); } +void SMESH_Swig::EraseActor( const char* Mesh_Entry, const bool allViewers ) +{ + class TEvent: public SALOME_Event + { + private: + const char* _entry; + bool _allViewers; + public: + TEvent(const char* Mesh_Entry, const bool allViewers ) { + _entry = Mesh_Entry; + _allViewers = allViewers; + } + virtual void Execute() { + SUIT_Session* aSession = SUIT_Session::session(); + SUIT_Application* anApplication = aSession->activeApplication(); + SalomeApp_Application* anApp = dynamic_cast(anApplication); + SMESHGUI_Displayer* aDisp = new SMESHGUI_Displayer(anApp); + ViewManagerList aManagers; + if ( !_allViewers ) { + aManagers << anApp->activeViewManager(); + } + else { + aManagers = anApp->viewManagers(); + } + foreach( SUIT_ViewManager* aMgr, aManagers ) { + if ( aMgr && aMgr->getType() == VTKViewer_Viewer::Type() ) { + SALOME_View* aSalomeView = dynamic_cast(aMgr->getViewModel()); + if (aSalomeView) { + aDisp->Erase(_entry,true, true, aSalomeView); + } + } + } + } + }; + + ProcessVoidEvent(new TEvent(Mesh_Entry, allViewers)); +} + void SMESH_Swig::SetName(const char* theEntry, const char* theName) {