+enum { DIRECT_GEOM_INDEX = 0, GEOM_BY_MESH_INDEX };
+
+void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable )
+{
+ if ( QToolButton* selBtn = qobject_cast<QToolButton*>( objectWg( Geom, Btn )))
+ {
+ if ( enable ) {
+ if ( ! myGeomPopup ) {
+ myGeomPopup = new QMenu();
+ myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
+ myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
+ connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
+ connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+ }
+ }
+ else {
+ disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+ if ( myGeomPopup ) {
+ delete myGeomPopup;
+ myGeomPopup = 0;
+ }
+ }
+ }
+}
+
+
+//================================================================================
+/*!
+ * \brief Disable tab
+ * \param int - tab ID
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::disableTab(const int theTabId) {
+ myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), false );
+ if ( theTabId == Dim3D ) myHypoSetButton->setEnabled( false );
+}
+
+//================================================================================
+/*!
+ * \brief Enable tabs
+ * \param int - tab ID
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::enableTab(const int theTabId) {
+ myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), true );
+ if ( theTabId == Dim3D ) {
+ QMenu* aHypoSetPopup = myHypoSetButton->menu();
+ myHypoSetButton->setEnabled( aHypoSetPopup && !aHypoSetPopup->actions().isEmpty() );
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Check if tab enabled
+ * \param int - tab ID
+ */
+//================================================================================
+bool SMESHGUI_MeshDlg::isTabEnabled(const int theTabId) const {
+ return myTabWg->isTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ) );
+}
+
+void SMESHGUI_MeshDlg::onGeomSelectionButton(bool isBtnOn)
+{
+ if ( myGeomPopup && isBtnOn )
+ myGeomPopup->exec( QCursor::pos() );
+}
+
+void SMESHGUI_MeshDlg::onGeomPopup( QAction* a )
+{
+ emit geomSelectionByMesh( a->data().toInt() == GEOM_BY_MESH_INDEX );
+}
+
+int SMESHGUI_MeshDlg::getActiveObject()
+{
+ for (int i = 0; i < 3; ++i )
+ if ( isObjectShown( i ) &&
+ (( QToolButton* )objectWg( i, Btn ))->isChecked())
+ return i;
+ return -1;
+}
+//================================================================================
+/*!
+ * \brief Sets available types of mesh
+ * \param theTypeMesh - list of available types of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::setAvailableMeshType( const QStringList& theTypeMesh )
+{
+ myMeshType->clear();
+ myMeshType->addItems(theTypeMesh);
+}
+//================================================================================
+/*!
+ * \brief Emits selectMeshType( const int, const int ) signal
+ *
+ * SLOT is called when a combo box "mesh type" is selected.
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::onChangedMeshType( const int isIndex )
+{
+ emit selectMeshType( Dim3D - myTabWg->currentIndex(), isIndex );
+}
+//================================================================================
+/*!
+ * \brief Get current index types of mesh
+ */
+//================================================================================
+int SMESHGUI_MeshDlg::currentMeshType( )
+{
+ return myMeshType->currentIndex( );
+}
+//================================================================================
+/*!
+ * \brief Set current index types of mesh
+ */
+//================================================================================
+void SMESHGUI_MeshDlg::setCurrentMeshType( const int theIndex )