Salome HOME
PAL16892 (impossible to create Distribution of Layers hypothesis, for Radial Prism...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MoveNodesDlg.cxx
1 //  SMESH SMESHGUI : GUI for SMESH component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : SMESHGUI_MoveNodesDlg.cxx
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #include "SMESHGUI_MoveNodesDlg.h"
30
31 #include "SMESHGUI.h"
32 #include "SMESHGUI_SpinBox.h"
33 #include "SMESHGUI_IdValidator.h"
34 #include "SMESHGUI_Utils.h"
35 #include "SMESHGUI_VTKUtils.h"
36 #include "SMESHGUI_MeshUtils.h"
37
38 #include "SMESH_Actor.h"
39 #include "SMDS_Mesh.hxx"
40 #include "SMDS_MeshNode.hxx"
41
42 #include "LightApp_SelectionMgr.h"
43 #include "LightApp_Application.h"
44 #include "SUIT_ResourceMgr.h"
45 #include "SUIT_Desktop.h"
46 #include "SUIT_Session.h"
47 #include "SUIT_MessageBox.h"
48
49 #include "SVTK_Selector.h"
50 #include "SVTK_ViewModel.h"
51 #include "SVTK_ViewWindow.h"
52 #include "SALOME_ListIO.hxx"
53
54 #include "SVTK_ViewWindow.h"
55 #include "VTKViewer_CellLocationsArray.h"
56
57 #include "utilities.h"
58
59 // OCCT includes
60 #include <TColStd_MapOfInteger.hxx>
61
62 // VTK includes
63 #include <vtkCell.h>
64 #include <vtkIdList.h>
65 #include <vtkCellArray.h>
66 #include <vtkUnsignedCharArray.h>
67 #include <vtkUnstructuredGrid.h>
68 #include <vtkDataSetMapper.h>
69 #include <vtkProperty.h>
70
71 // QT includes
72 #include <qgroupbox.h>
73 #include <qlabel.h>
74 #include <qlineedit.h>
75 #include <qpushbutton.h>
76 #include <qradiobutton.h>
77 #include <qlayout.h>
78 #include <qpixmap.h>
79 #include <qmessagebox.h>
80 #include <qbuttongroup.h>
81
82 // IDL Headers
83 #include <SALOMEconfig.h>
84 #include CORBA_SERVER_HEADER(SMESH_Mesh)
85 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
86
87 #define MARGIN  10
88 #define SPACING 5
89
90
91 //=================================================================================
92 // name    : SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg
93 // Purpose :
94 //=================================================================================
95 SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule, 
96                                               const char* theName):
97   QDialog(SMESH::GetDesktop(theModule), 
98           theName, 
99           false,
100           WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
101   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
102   mySMESHGUI(theModule)
103 {
104   myPreviewActor = 0;
105   myBusy = false;
106
107   setCaption(tr("CAPTION"));
108
109   QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
110
111   QFrame* aMainFrame = createMainFrame  (this);
112   QFrame* aBtnFrame  = createButtonFrame(this);
113
114   aDlgLay->addWidget(aMainFrame);
115   aDlgLay->addWidget(aBtnFrame);
116
117   aDlgLay->setStretchFactor(aMainFrame, 1);
118
119   mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
120
121   myHelpFileName = "/files/displacing_nodes.htm";
122
123   Init();
124 }
125
126 //=======================================================================
127 // name    : SMESHGUI_MoveNodesDlg::createButtonFrame
128 // Purpose : Create frame containing buttons
129 //=======================================================================
130 QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent)
131 {
132   QFrame* aFrame = new QFrame(theParent);
133   aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
134
135   myOkBtn     = new QPushButton(tr("SMESH_BUT_OK"   ), aFrame);
136   myApplyBtn  = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
137   myCloseBtn  = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
138   myHelpBtn   = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
139
140   QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
141
142   QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
143
144   aLay->addWidget(myOkBtn);
145   aLay->addWidget(myApplyBtn);
146   aLay->addItem(aSpacer);
147   aLay->addWidget(myCloseBtn);
148   aLay->addWidget(myHelpBtn);
149
150   connect(myOkBtn,    SIGNAL(clicked()), SLOT(onOk()));
151   connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
152   connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
153   connect(myHelpBtn,  SIGNAL(clicked()), SLOT(onHelp()));
154
155   return aFrame;
156 }
157
158 //=======================================================================
159 // name    : SMESHGUI_MoveNodesDlg::createMainFrame
160 // Purpose : Create frame containing dialog's input fields
161 //=======================================================================
162 QFrame* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent)
163 {
164   QFrame* aFrame = new QFrame(theParent);
165
166   QPixmap iconMoveNode (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
167   QPixmap iconSelect   (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
168
169   QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("MESH_NODE"), aFrame);
170   aPixGrp->setExclusive(TRUE);
171   QRadioButton* aRBut = new QRadioButton(aPixGrp);
172   aRBut->setPixmap(iconMoveNode);
173   aRBut->setChecked(TRUE);
174
175   QGroupBox* anIdGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_MOVE"), aFrame);
176   new QLabel(tr("NODE_ID"), anIdGrp);
177   (new QPushButton(anIdGrp))->setPixmap(iconSelect);
178   myId = new QLineEdit(anIdGrp);
179   myId->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
180
181   QGroupBox* aCoordGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_COORDINATES"), aFrame);
182   QLabel* aXLabel = new QLabel(tr("SMESH_X"), aCoordGrp);
183   aXLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
184   myX = new SMESHGUI_SpinBox(aCoordGrp);
185
186   QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp);
187   //aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
188   aYLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
189   myY = new SMESHGUI_SpinBox(aCoordGrp);
190
191   QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
192   //aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
193   aZLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
194   myZ = new SMESHGUI_SpinBox(aCoordGrp);
195
196   myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
197   myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
198   myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
199
200   QVBoxLayout* aLay = new QVBoxLayout(aFrame);
201   aLay->addWidget(aPixGrp);
202   aLay->addWidget(anIdGrp);
203   aLay->addWidget(aCoordGrp);
204
205   // connect signale and slots
206   connect(myX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
207   connect(myY, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
208   connect(myZ, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
209   connect(myId, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
210
211   return aFrame;
212 }
213
214 //=======================================================================
215 // name    : SMESHGUI_MoveNodesDlg::~SMESHGUI_MoveNodesDlg
216 // Purpose :
217 //=======================================================================
218 SMESHGUI_MoveNodesDlg::~SMESHGUI_MoveNodesDlg()
219 {
220   erasePreview();
221 }
222
223 //=======================================================================
224 // name    : SMESHGUI_MoveNodesDlg::Init
225 // Purpose : Init dialog fields
226 //=======================================================================
227 void SMESHGUI_MoveNodesDlg::Init()
228 {
229   myPreviewActor = 0;
230   myMeshActor = 0;
231   myBusy = false;
232
233   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
234
235   // selection and SMESHGUI
236   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
237   connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
238   connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
239
240   reset();
241   setEnabled(true);
242
243   this->show();
244
245   // set selection mode
246   SMESH::SetPointRepresentation(true);
247   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
248     aViewWindow->SetSelectionMode(NodeSelection);
249
250   onSelectionDone();
251 }
252
253 //=======================================================================
254 // name    : SMESHGUI_MoveNodesDlg::isValid
255 // Purpose : Verify validity of entry information
256 //=======================================================================
257 bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess) const
258 {
259   if (myId->text().isEmpty()) {
260     if (theMess)
261       QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
262                                tr("NODE_ID_IS_NOT_DEFINED"), QMessageBox::Ok);
263     return false;
264   }
265   return true;
266 }
267
268 //=======================================================================
269 // name    : SMESHGUI_MoveNodesDlg::reset
270 // Purpose : Reset the dialog state
271 //=======================================================================
272 void SMESHGUI_MoveNodesDlg::reset()
273 {
274   myId->clear();
275   myX->SetValue(0);
276   myY->SetValue(0);
277   myZ->SetValue(0);
278   redisplayPreview();
279   updateButtons();
280 }
281
282 //=======================================================================
283 // name    : SMESHGUI_MoveNodesDlg::onApply
284 // Purpose : SLOT called when "Apply" button pressed.
285 //=======================================================================
286 bool SMESHGUI_MoveNodesDlg::onApply()
287 {
288   if (mySMESHGUI->isActiveStudyLocked())
289     return false;
290
291   if (!isValid(true))
292     return false;
293
294   SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
295   if (aMesh->_is_nil()) {
296     QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
297                              tr("SMESHG_NO_MESH"), QMessageBox::Ok);
298     return false;
299   }
300
301   SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
302   if (aMeshEditor->_is_nil())
303     return false;
304
305   int anId = myId->text().toInt();
306   bool aResult = false;
307   try {
308     aResult = aMeshEditor->MoveNode(anId, myX->GetValue(), myY->GetValue(), myZ->GetValue());
309   } catch (...) {
310   }
311
312   if (aResult) {
313     SALOME_ListIO aList;
314     aList.Append(myMeshActor->getIO());
315     mySelectionMgr->setSelectedObjects(aList,false);
316     SMESH::UpdateView();
317     reset();
318   }
319
320   return aResult;
321 }
322
323 //=======================================================================
324 // name    : SMESHGUI_MoveNodesDlg::onOk
325 // Purpose : SLOT called when "Ok" button pressed.
326 //=======================================================================
327 void SMESHGUI_MoveNodesDlg::onOk()
328 {
329   if (onApply())
330     onClose();
331 }
332
333 //=======================================================================
334 // name    : SMESHGUI_MoveNodesDlg::onClose
335 // Purpose : SLOT called when "Close" button pressed. Close dialog
336 //=======================================================================
337 void SMESHGUI_MoveNodesDlg::onClose()
338 {
339   //mySelectionMgr->clearSelected();
340   SMESH::SetPointRepresentation(false);
341   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
342     aViewWindow->SetSelectionMode(ActorSelection);
343   disconnect(mySelectionMgr, 0, this, 0);
344   disconnect(mySMESHGUI, 0, this, 0);
345   erasePreview();
346   mySMESHGUI->ResetState();
347   reject();
348 }
349
350 //=================================================================================
351 // function : onHelp()
352 // purpose  :
353 //=================================================================================
354 void SMESHGUI_MoveNodesDlg::onHelp()
355 {
356   LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
357   if (app) 
358     app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
359   else {
360     SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
361                            QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
362                            arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
363                            QObject::tr("BUT_OK"));
364   }
365 }
366
367 //=======================================================================
368 // name    : SMESHGUI_MoveNodesDlg::onTextChange
369 // Purpose :
370 //=======================================================================
371 void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
372 {
373   if (myBusy) return;
374
375   myOkBtn->setEnabled(false);
376   myApplyBtn->setEnabled(false);
377   erasePreview();
378
379   // select entered node
380   if(myMeshActor){
381     if(SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()){
382       myBusy = true;
383       Handle(SALOME_InteractiveObject) anIO = myMeshActor->getIO();
384       SALOME_ListIO aList;
385       aList.Append(anIO);
386       mySelectionMgr->setSelectedObjects(aList,false);
387       myBusy = false;
388
389       if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
390         TColStd_MapOfInteger aListInd;
391         aListInd.Add(anElem->GetID());
392         mySelector->AddOrRemoveIndex(anIO,aListInd, false);
393         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
394           aViewWindow->highlight(anIO,true,true);
395         
396         onSelectionDone();
397       }
398     }
399   }
400 }
401
402 //=======================================================================
403 // name    : SMESHGUI_MoveNodesDlg::onSelectionDone
404 // Purpose : SLOT called when selection changed
405 //=======================================================================
406 void SMESHGUI_MoveNodesDlg::onSelectionDone()
407 {
408   if (myBusy) return;
409   myMeshActor = 0;
410
411   SALOME_ListIO aList;
412   mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
413
414   if (aList.Extent() == 1) {
415     Handle(SALOME_InteractiveObject) anIO = aList.First();
416     myMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
417     if(myMeshActor){
418       QString aText;
419       if (SMESH::GetNameOfSelectedNodes(mySelector,anIO,aText) == 1) {
420         if(SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()) {
421           if(const SMDS_MeshNode* aNode = aMesh->FindNode(aText.toInt())) {
422             myBusy = true;
423             myId->setText(aText);
424             myX->SetValue(aNode->X());
425             myY->SetValue(aNode->Y());
426             myZ->SetValue(aNode->Z());
427             myBusy = false;
428             erasePreview(); // avoid overlapping of a selection and a preview
429             updateButtons();
430             return;
431           }
432         }
433       }
434     }
435   }
436
437   reset();
438 }
439
440 //=======================================================================
441 // name    : SMESHGUI_MoveNodesDlg::onDeactivate
442 // Purpose : SLOT called when dialog must be deativated
443 //=======================================================================
444 void SMESHGUI_MoveNodesDlg::onDeactivate()
445 {
446   setEnabled(false);
447   erasePreview();
448 }
449
450 //=======================================================================
451 // name    : SMESHGUI_MoveNodesDlg::enterEvent
452 // Purpose : Event filter
453 //=======================================================================
454 void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
455 {
456   if (!isEnabled()) {
457     mySMESHGUI->EmitSignalDeactivateDialog();
458
459     // set selection mode
460     SMESH::SetPointRepresentation(true);
461     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
462       aViewWindow->SetSelectionMode(NodeSelection);
463
464     redisplayPreview();
465
466     setEnabled(true);
467   }
468 }
469
470 //=======================================================================
471 // name    : SMESHGUI_MoveNodesDlg::closeEvent
472 // Purpose :
473 //=======================================================================
474 void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*)
475 {
476   onClose();
477   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
478     aViewWindow->Repaint();
479 }
480
481 //=======================================================================
482 // name    : SMESHGUI_MoveNodesDlg::hideEvent
483 // Purpose : may be caused by ESC key
484 //=======================================================================
485 void SMESHGUI_MoveNodesDlg::hideEvent (QHideEvent*)
486 {
487   if (!isMinimized())
488     onClose();
489 }
490
491 //=======================================================================
492 // name    : SMESHGUI_MoveNodesDlg::updateButtons
493 // Purpose : Update buttons state
494 //=======================================================================
495 void SMESHGUI_MoveNodesDlg::updateButtons()
496 {
497   bool isEnabled = isValid(false);
498   myOkBtn->setEnabled(isEnabled);
499   myApplyBtn->setEnabled(isEnabled);
500 }
501
502 //=======================================================================
503 // name    : SMESHGUI_MoveNodesDlg::erasePreview
504 // Purpose : Erase preview
505 //=======================================================================
506 void  SMESHGUI_MoveNodesDlg::erasePreview()
507 {
508   if (myPreviewActor == 0)
509     return;
510
511   SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
512   if (aViewWindow)
513     aViewWindow->RemoveActor(myPreviewActor);
514   myPreviewActor->Delete();
515   myPreviewActor = 0;
516   if (aViewWindow)
517     aViewWindow->Repaint();
518 }
519
520 //=======================================================================
521 // name    : SMESHGUI_MoveNodesDlg::redisplayPreview
522 // Purpose : Redisplay preview
523 //=======================================================================
524 void SMESHGUI_MoveNodesDlg::redisplayPreview()
525 {
526   if (myBusy)
527     return;
528
529   if (myPreviewActor != 0)
530     erasePreview();
531
532   if (!isValid(false))
533     return;
534
535   vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
536
537   vtkPoints* aPoints = vtkPoints::New();
538   aPoints->SetNumberOfPoints(1);
539   aPoints->SetPoint(0, myX->GetValue(), myY->GetValue(), myZ->GetValue());
540
541   // Create cells
542
543   vtkIdList *anIdList = vtkIdList::New();
544   anIdList->SetNumberOfIds(1);
545
546   vtkCellArray *aCells = vtkCellArray::New();
547   aCells->Allocate(2, 0);
548
549   vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
550   aCellTypesArray->SetNumberOfComponents(1);
551   aCellTypesArray->Allocate(1);
552
553   anIdList->SetId(0, 0);
554   aCells->InsertNextCell(anIdList);
555   aCellTypesArray->InsertNextValue(VTK_VERTEX);
556   anIdList->Delete();
557
558   VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
559   aCellLocationsArray->SetNumberOfComponents(1);
560   aCellLocationsArray->SetNumberOfTuples(1);
561
562   aCells->InitTraversal();
563   vtkIdType npts;
564   aCellLocationsArray->SetValue(0, aCells->GetTraversalLocation(npts));
565
566   aGrid->SetPoints(aPoints);
567   aPoints->Delete();
568
569   aGrid->SetCells(aCellTypesArray,aCellLocationsArray,aCells);
570   aCellLocationsArray->Delete();
571   aCellTypesArray->Delete();
572   aCells->Delete();
573
574   // Create and display actor
575   vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
576   aMapper->SetInput(aGrid);
577   aGrid->Delete();
578
579   myPreviewActor = SALOME_Actor::New();
580   myPreviewActor->PickableOff();
581   myPreviewActor->SetMapper(aMapper);
582   aMapper->Delete();
583
584   vtkProperty* aProp = vtkProperty::New();
585   aProp->SetRepresentationToWireframe();
586   aProp->SetColor(250, 0, 250);
587   aProp->SetPointSize(5);
588   myPreviewActor->SetProperty(aProp);
589   aProp->Delete();
590
591   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
592     {
593       aViewWindow->AddActor(myPreviewActor);
594       aViewWindow->Repaint();
595     }
596 }
597
598 //=================================================================================
599 // function : keyPressEvent()
600 // purpose  :
601 //=================================================================================
602 void SMESHGUI_MoveNodesDlg::keyPressEvent( QKeyEvent* e )
603 {
604   QDialog::keyPressEvent( e );
605   if ( e->isAccepted() )
606     return;
607
608   if ( e->key() == Key_F1 )
609     {
610       e->accept();
611       onHelp();
612     }
613 }