-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
// 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
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);
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);
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();
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
{
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);
}
}