X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSVTK%2FSVTK_ViewModel.cxx;h=977da9440202d237548f10f5a280cbd83e265436;hb=e6caa123c65e3c4a3017364ec5bb4225fd898465;hp=4a13dd7ee74f1e95c14e3fff05cf0a308952d6e0;hpb=8d973f87a441c75acab8b1cf0d3f54434735008e;p=modules%2Fgui.git diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 4a13dd7ee..977da9440 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -504,6 +504,23 @@ void SVTK_Viewer::enableSelection(bool isEnabled) aView->SetSelectionEnabled( isEnabled ); } } + + if(!isEnabled) { + //clear current selection in the viewer + bool blocked = blockSignals( true ); + if ( SUIT_ViewManager* aViewMgr = getViewManager() ) { + if( SVTK_ViewWindow* aViewWindow = dynamic_cast( aViewMgr->getActiveView() ) ){ + if( SVTK_Selector* aSelector = aViewWindow->GetSelector() ) { + if(SVTK_View* aView = aViewWindow->getView()){ + aSelector->ClearIObjects(); + aView->onSelectionChanged(); + } + } + } + } + blockSignals( blocked ); + } + } /*! @@ -653,7 +670,7 @@ void SVTK_Viewer::Erase( const SALOME_VTKPrs* prs, const bool forced ) Erase all presentations \param forced - removes all objects from view */ -void SVTK_Viewer::EraseAll( const bool forced ) +void SVTK_Viewer::EraseAll( SALOME_Displayer* d, const bool forced ) { // Temporarily commented to avoid awful dependecy on SALOMEDS // TODO: better mechanism of storing display/erse status in a study @@ -694,6 +711,9 @@ void SVTK_Viewer::EraseAll( const bool forced ) } } } + + SALOME_View::EraseAll( d, forced ); + Repaint(); } @@ -703,7 +723,7 @@ void SVTK_Viewer::EraseAll( const bool forced ) */ SALOME_Prs* SVTK_Viewer::CreatePrs( const char* entry ) { - SVTK_Prs* prs = new SVTK_Prs(); + SVTK_Prs* prs = new SVTK_Prs( entry ); if ( entry ) { if(SVTK_ViewWindow* aViewWindow = dynamic_cast(getViewManager()->getActiveView())) if(SVTK_View* aView = aViewWindow->getView()){