Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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 = "moving_nodes_page.html";
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                 QString platform;
361 #ifdef WIN32
362                 platform = "winapplication";
363 #else
364                 platform = "application";
365 #endif
366     SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
367                            QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
368                            arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
369                            QObject::tr("BUT_OK"));
370   }
371 }
372
373 //=======================================================================
374 // name    : SMESHGUI_MoveNodesDlg::onTextChange
375 // Purpose :
376 //=======================================================================
377 void SMESHGUI_MoveNodesDlg::onTextChange (const QString& theNewText)
378 {
379   if (myBusy) return;
380
381   myOkBtn->setEnabled(false);
382   myApplyBtn->setEnabled(false);
383   erasePreview();
384
385   // select entered node
386   if(myMeshActor){
387     if(SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()){
388       myBusy = true;
389       Handle(SALOME_InteractiveObject) anIO = myMeshActor->getIO();
390       SALOME_ListIO aList;
391       aList.Append(anIO);
392       mySelectionMgr->setSelectedObjects(aList,false);
393       myBusy = false;
394
395       if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
396         TColStd_MapOfInteger aListInd;
397         aListInd.Add(anElem->GetID());
398         mySelector->AddOrRemoveIndex(anIO,aListInd, false);
399         if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
400           aViewWindow->highlight(anIO,true,true);
401         
402         onSelectionDone();
403       }
404     }
405   }
406 }
407
408 //=======================================================================
409 // name    : SMESHGUI_MoveNodesDlg::onSelectionDone
410 // Purpose : SLOT called when selection changed
411 //=======================================================================
412 void SMESHGUI_MoveNodesDlg::onSelectionDone()
413 {
414   if (myBusy) return;
415   myMeshActor = 0;
416
417   SALOME_ListIO aList;
418   mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
419
420   if (aList.Extent() == 1) {
421     Handle(SALOME_InteractiveObject) anIO = aList.First();
422     myMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
423     if(myMeshActor){
424       QString aText;
425       if (SMESH::GetNameOfSelectedNodes(mySelector,anIO,aText) == 1) {
426         if(SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()) {
427           if(const SMDS_MeshNode* aNode = aMesh->FindNode(aText.toInt())) {
428             myBusy = true;
429             myId->setText(aText);
430             myX->SetValue(aNode->X());
431             myY->SetValue(aNode->Y());
432             myZ->SetValue(aNode->Z());
433             myBusy = false;
434             erasePreview(); // avoid overlapping of a selection and a preview
435             updateButtons();
436             return;
437           }
438         }
439       }
440     }
441   }
442
443   reset();
444 }
445
446 //=======================================================================
447 // name    : SMESHGUI_MoveNodesDlg::onDeactivate
448 // Purpose : SLOT called when dialog must be deativated
449 //=======================================================================
450 void SMESHGUI_MoveNodesDlg::onDeactivate()
451 {
452   setEnabled(false);
453   erasePreview();
454 }
455
456 //=======================================================================
457 // name    : SMESHGUI_MoveNodesDlg::enterEvent
458 // Purpose : Event filter
459 //=======================================================================
460 void SMESHGUI_MoveNodesDlg::enterEvent (QEvent*)
461 {
462   if (!isEnabled()) {
463     mySMESHGUI->EmitSignalDeactivateDialog();
464
465     // set selection mode
466     SMESH::SetPointRepresentation(true);
467     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
468       aViewWindow->SetSelectionMode(NodeSelection);
469
470     redisplayPreview();
471
472     setEnabled(true);
473   }
474 }
475
476 //=======================================================================
477 // name    : SMESHGUI_MoveNodesDlg::closeEvent
478 // Purpose :
479 //=======================================================================
480 void SMESHGUI_MoveNodesDlg::closeEvent (QCloseEvent*)
481 {
482   onClose();
483   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
484     aViewWindow->Repaint();
485 }
486
487 //=======================================================================
488 // name    : SMESHGUI_MoveNodesDlg::hideEvent
489 // Purpose : may be caused by ESC key
490 //=======================================================================
491 void SMESHGUI_MoveNodesDlg::hideEvent (QHideEvent*)
492 {
493   if (!isMinimized())
494     onClose();
495 }
496
497 //=======================================================================
498 // name    : SMESHGUI_MoveNodesDlg::updateButtons
499 // Purpose : Update buttons state
500 //=======================================================================
501 void SMESHGUI_MoveNodesDlg::updateButtons()
502 {
503   bool isEnabled = isValid(false);
504   myOkBtn->setEnabled(isEnabled);
505   myApplyBtn->setEnabled(isEnabled);
506 }
507
508 //=======================================================================
509 // name    : SMESHGUI_MoveNodesDlg::erasePreview
510 // Purpose : Erase preview
511 //=======================================================================
512 void  SMESHGUI_MoveNodesDlg::erasePreview()
513 {
514   if (myPreviewActor == 0)
515     return;
516
517   SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
518   if (aViewWindow)
519     aViewWindow->RemoveActor(myPreviewActor);
520   myPreviewActor->Delete();
521   myPreviewActor = 0;
522   if (aViewWindow)
523     aViewWindow->Repaint();
524 }
525
526 //=======================================================================
527 // name    : SMESHGUI_MoveNodesDlg::redisplayPreview
528 // Purpose : Redisplay preview
529 //=======================================================================
530 void SMESHGUI_MoveNodesDlg::redisplayPreview()
531 {
532   if (myBusy)
533     return;
534
535   if (myPreviewActor != 0)
536     erasePreview();
537
538   if (!isValid(false))
539     return;
540
541   vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
542
543   vtkPoints* aPoints = vtkPoints::New();
544   aPoints->SetNumberOfPoints(1);
545   aPoints->SetPoint(0, myX->GetValue(), myY->GetValue(), myZ->GetValue());
546
547   // Create cells
548
549   vtkIdList *anIdList = vtkIdList::New();
550   anIdList->SetNumberOfIds(1);
551
552   vtkCellArray *aCells = vtkCellArray::New();
553   aCells->Allocate(2, 0);
554
555   vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
556   aCellTypesArray->SetNumberOfComponents(1);
557   aCellTypesArray->Allocate(1);
558
559   anIdList->SetId(0, 0);
560   aCells->InsertNextCell(anIdList);
561   aCellTypesArray->InsertNextValue(VTK_VERTEX);
562   anIdList->Delete();
563
564   VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
565   aCellLocationsArray->SetNumberOfComponents(1);
566   aCellLocationsArray->SetNumberOfTuples(1);
567
568   aCells->InitTraversal();
569   vtkIdType npts;
570   aCellLocationsArray->SetValue(0, aCells->GetTraversalLocation(npts));
571
572   aGrid->SetPoints(aPoints);
573   aPoints->Delete();
574
575   aGrid->SetCells(aCellTypesArray,aCellLocationsArray,aCells);
576   aCellLocationsArray->Delete();
577   aCellTypesArray->Delete();
578   aCells->Delete();
579
580   // Create and display actor
581   vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
582   aMapper->SetInput(aGrid);
583   aGrid->Delete();
584
585   myPreviewActor = SALOME_Actor::New();
586   myPreviewActor->PickableOff();
587   myPreviewActor->SetMapper(aMapper);
588   aMapper->Delete();
589
590   vtkProperty* aProp = vtkProperty::New();
591   aProp->SetRepresentationToWireframe();
592   aProp->SetColor(250, 0, 250);
593   aProp->SetPointSize(5);
594   myPreviewActor->SetProperty(aProp);
595   aProp->Delete();
596
597   if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
598     {
599       aViewWindow->AddActor(myPreviewActor);
600       aViewWindow->Repaint();
601     }
602 }
603
604 //=================================================================================
605 // function : keyPressEvent()
606 // purpose  :
607 //=================================================================================
608 void SMESHGUI_MoveNodesDlg::keyPressEvent( QKeyEvent* e )
609 {
610   QDialog::keyPressEvent( e );
611   if ( e->isAccepted() )
612     return;
613
614   if ( e->key() == Key_F1 )
615     {
616       e->accept();
617       onHelp();
618     }
619 }