X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_SingleEditDlg.cxx;h=e40b5b4d1516841d33fbe45b7eeeba8e83bb7715;hp=ef9bf001419494b50f9827bfa14357697eadba9e;hb=8301b1e71a0a9833c5bcf7951b426949f647ae9f;hpb=88b3dbe23b236bd1746405155ae33a76aaf59ecd diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index ef9bf0014..e40b5b4d1 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 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 @@ -93,8 +93,8 @@ private: SMESHGUI_SingleEditDlg ::SMESHGUI_SingleEditDlg(SMESHGUI* theModule) : QDialog(SMESH::GetDesktop(theModule)), - mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySelectionMgr(SMESH::GetSelectionMgr(theModule)), + mySelector(SMESH::GetViewWindow(theModule)->GetSelector()), mySMESHGUI(theModule) { setModal(false); @@ -223,6 +223,8 @@ void SMESHGUI_SingleEditDlg::Init() connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); + connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT(onOpenView())); + connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT(onCloseView())); connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); myOkBtn->setEnabled(false); @@ -305,7 +307,7 @@ static bool findTriangles (const SMDS_MeshNode * theNode1, SMDS_ElemIteratorPtr it = theNode1->GetInverseElementIterator(); while (it->more()) { const SMDS_MeshElement* elem = it->next(); - if (elem->GetType() == SMDSAbs_Face && elem->NbNodes() == 3) + if (elem->GetType() == SMDSAbs_Face && elem->NbCornerNodes() == 3) emap.insert(elem); } it = theNode2->GetInverseElementIterator(); @@ -444,6 +446,29 @@ void SMESHGUI_SingleEditDlg::onDeactivate() setEnabled(false); } +//================================================================================= +// function : onOpenView() +// purpose : +//================================================================================= +void SMESHGUI_SingleEditDlg::onOpenView() +{ + if ( !mySelector ) { + mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector(); + mySMESHGUI->EmitSignalDeactivateDialog(); + setEnabled(true); + } +} + +//================================================================================= +// function : onCloseView() +// purpose : +//================================================================================= +void SMESHGUI_SingleEditDlg::onCloseView() +{ + onDeactivate(); + mySelector = 0; +} + //======================================================================= // name : enterEvent() // Purpose : Event filter @@ -452,8 +477,12 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*) { if (!isEnabled()) { mySMESHGUI->EmitSignalDeactivateDialog(); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ); + if ( aViewWindow) { aViewWindow->SetSelectionMode(EdgeOfCellSelection); + if (!mySelector) + mySelector = aViewWindow->GetSelector(); + } setEnabled(true); } }