From 2e2429b2910c9769bf79a9a19189d2f660058df0 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 24 Feb 2009 10:51:35 +0000 Subject: [PATCH] 0020170: EDF SMESH: Selection behaviour in object browser from hypothesis editing windows + int getActiveObject(); --- src/SMESHGUI/SMESHGUI_MeshDlg.cxx | 9 +++++++++ src/SMESHGUI/SMESHGUI_MeshDlg.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index ed323c097..61fa18f4c 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -602,3 +602,12 @@ void SMESHGUI_MeshDlg::onGeomPopup( int index ) { emit geomSelectionByMesh( index == GEOM_BY_MESH_INDEX ); } + +int SMESHGUI_MeshDlg::getActiveObject() +{ + for (int i = 0; i < 3; ++i ) + if ( isObjectShown( i ) && + (( QToolButton* )objectWg( i, Btn ))->isOn()) + return i; + return -1; +} diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.h b/src/SMESHGUI/SMESHGUI_MeshDlg.h index 113f630cb..5c58f45f4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.h @@ -78,7 +78,7 @@ public: void setGeomPopupEnabled( const bool ); void disableTab(const int); void enableTab(const int); - + int getActiveObject(); signals: -- 2.39.2