Salome HOME
a3f0966ff07c7d98f65a89fec57077464f036332
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_NodesDlg.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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : SMESHGUI_NodesDlg.cxx
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28
29 #include "SMESHGUI_NodesDlg.h"
30
31 #include "SMESHGUI.h"
32 #include "SMESHGUI_SpinBox.h"
33 #include "SMESHGUI_Utils.h"
34 #include "SMESHGUI_VTKUtils.h"
35 #include "SMESHGUI_MeshUtils.h"
36
37 #include "SMESH_Actor.h"
38 #include "SMESH_ActorUtils.h"
39 #include "SMESH_ObjectDef.h"
40
41 #include "SMDS_Mesh.hxx"
42 #include "SMDS_MeshNode.hxx"
43
44 #include "SUIT_Session.h"
45 #include "SUIT_OverrideCursor.h"
46 #include "SUIT_ViewWindow.h"
47 #include "SUIT_ViewManager.h"
48 #include "SUIT_MessageBox.h"
49
50 #include "SalomeApp_Study.h"
51 #include "SalomeApp_Application.h"
52
53 #include "SVTK_ViewWindow.h"
54
55 #include "SALOME_Actor.h"
56 #include "SALOME_ListIO.hxx"
57 #include "SVTK_Selection.h"
58
59 #include "utilities.h"
60
61 // VTK Includes
62 #include <vtkCell.h>
63 #include <vtkIdList.h>
64 #include <vtkIntArray.h>
65 #include <vtkCellArray.h>
66 #include <vtkUnsignedCharArray.h>
67 #include <vtkUnstructuredGrid.h>
68 #include <vtkDataSetMapper.h>
69 #include <vtkActorCollection.h>
70 #include <vtkRenderer.h>
71
72 // QT Includes
73 #include <qbuttongroup.h>
74 #include <qframe.h>
75 #include <qgroupbox.h>
76 #include <qlabel.h>
77 #include <qlineedit.h>
78 #include <qpushbutton.h>
79 #include <qradiobutton.h>
80 #include <qlayout.h>
81 #include <qvariant.h>
82 #include <qtooltip.h>
83 #include <qwhatsthis.h>
84 #include <qimage.h>
85 #include <qpixmap.h>
86 #include <qvalidator.h>
87 #include <qevent.h>
88
89 using namespace std;
90
91
92 namespace SMESH {
93
94   void AddNode (SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z)
95   {
96     SUIT_OverrideCursor wc;
97     try {
98       _PTR(SObject) aSobj = SMESH::FindSObject(theMesh);
99       SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
100       aMeshEditor->AddNode(x,y,z);
101       _PTR(Study) aStudy = GetActiveStudyDocument();
102       CORBA::Long anId = aStudy->StudyId();
103       if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId, aSobj->GetID().c_str())) {
104         aVisualObj->Update(true);
105       }
106     } catch (SALOME::SALOME_Exception& exc) {
107       INFOS("Follow exception was cought:\n\t" << exc.details.text);
108     } catch (const std::exception& exc) {
109       INFOS("Follow exception was cought:\n\t" << exc.what());
110     } catch (...) {
111       INFOS("Unknown exception was cought !!!");
112     }
113   }
114
115   class TNodeSimulation {
116     SalomeApp_Application* myApplication;
117     SUIT_ViewWindow* myViewWindow;
118     SVTK_ViewWindow* myVTKViewWindow;
119
120     SALOME_Actor *myPreviewActor;
121     vtkDataSetMapper* myMapper;
122     vtkPoints* myPoints;
123
124   public:
125     TNodeSimulation (SalomeApp_Application* theApplication)
126     {
127       myApplication = theApplication;
128       SUIT_ViewManager* mgr = theApplication->activeViewManager();
129       if (!mgr) return;
130       myViewWindow = mgr->getActiveView();
131       myVTKViewWindow = GetVtkViewWindow(myViewWindow);
132
133       vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
134
135       // Create points
136       myPoints = vtkPoints::New();
137       myPoints->SetNumberOfPoints(1);
138       myPoints->SetPoint(0,0.0,0.0,0.0);
139
140       // Create cells
141       vtkIdList *anIdList = vtkIdList::New();
142       anIdList->SetNumberOfIds(1);
143
144       vtkCellArray *aCells = vtkCellArray::New();
145       aCells->Allocate(2, 0);
146
147       vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
148       aCellTypesArray->SetNumberOfComponents(1);
149       aCellTypesArray->Allocate(1);
150
151       anIdList->SetId(0, 0);
152       aCells->InsertNextCell(anIdList);
153       aCellTypesArray->InsertNextValue(VTK_VERTEX);
154
155       vtkIntArray* aCellLocationsArray = vtkIntArray::New();
156       aCellLocationsArray->SetNumberOfComponents(1);
157       aCellLocationsArray->SetNumberOfTuples(1);
158
159       aCells->InitTraversal();
160       vtkIdType npts;
161       aCellLocationsArray->SetValue(0, aCells->GetTraversalLocation(npts));
162
163       aGrid->SetCells(aCellTypesArray, aCellLocationsArray, aCells);
164
165       aGrid->SetPoints(myPoints);
166       aGrid->SetCells(aCellTypesArray, aCellLocationsArray,aCells);
167       aCellLocationsArray->Delete();
168       aCellTypesArray->Delete();
169       aCells->Delete();
170       anIdList->Delete();
171
172       // Create and display actor
173       myMapper = vtkDataSetMapper::New();
174       myMapper->SetInput(aGrid);
175       aGrid->Delete();
176
177       myPreviewActor = SALOME_Actor::New();
178       myPreviewActor->SetInfinitive(true);
179       myPreviewActor->VisibilityOff();
180       myPreviewActor->PickableOff();
181       myPreviewActor->SetMapper(myMapper);
182
183       vtkProperty* aProp = vtkProperty::New();
184       aProp->SetRepresentationToPoints();
185
186       float anRGB[3];
187       anRGB[0] = GetFloat("SMESH:SettingsNodeColorRed",0)/255.;
188       anRGB[1] = GetFloat("SMESH:SettingsNodeColorGreen",255)/255.;
189       anRGB[2] = GetFloat("SMESH:SettingsNodeColorBlue",0)/255.;
190       aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
191
192       float aPointSize = GetFloat("SMESH:SettingsNodesSize",3);
193       aProp->SetPointSize(aPointSize);
194
195       myPreviewActor->SetProperty(aProp);
196       aProp->Delete();
197
198       myVTKViewWindow->AddActor(myPreviewActor);
199     }
200
201     void SetPosition (float x, float y, float z)
202     {
203       myPoints->SetPoint(0,x,y,z);
204       myPoints->Modified();
205       SetVisibility(true);
206     }
207
208     void SetVisibility (bool theVisibility)
209     {
210       myPreviewActor->SetVisibility(theVisibility);
211       RepaintCurrentView();
212     }
213
214     ~TNodeSimulation()
215     {
216       if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
217         myVTKViewWindow->RemoveActor(myPreviewActor);
218       }
219       myPreviewActor->Delete();
220
221       myMapper->RemoveAllInputs();
222       myMapper->Delete();
223
224       myPoints->Delete();
225     }
226   };
227 }
228
229 //=================================================================================
230 // class    : SMESHGUI_NodesDlg()
231 // purpose  :
232 //=================================================================================
233 SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (QWidget* parent,
234                                       const char* name,
235                                       SalomeApp_SelectionMgr* Sel,
236                                       bool modal,
237                                       WFlags fl)
238   : QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder |
239             WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose)
240 {
241   SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
242     (SUIT_Session::session()->activeApplication());
243   mySimulation = new SMESH::TNodeSimulation (anApp);
244
245   QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
246   if (!name)
247     setName("SMESHGUI_NodesDlg");
248   resize(303, 185);
249   setCaption(tr("MESH_NODE_TITLE"));
250   setSizeGripEnabled(TRUE);
251   SMESHGUI_NodesDlgLayout = new QGridLayout(this);
252   SMESHGUI_NodesDlgLayout->setSpacing(6);
253   SMESHGUI_NodesDlgLayout->setMargin(11);
254
255   /***************************************************************/
256   GroupButtons = new QGroupBox(this, "GroupButtons");
257   GroupButtons->setGeometry(QRect(10, 10, 281, 48));
258   GroupButtons->setTitle(tr("" ));
259   GroupButtons->setColumnLayout(0, Qt::Vertical);
260   GroupButtons->layout()->setSpacing(0);
261   GroupButtons->layout()->setMargin(0);
262   GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
263   GroupButtonsLayout->setAlignment(Qt::AlignTop);
264   GroupButtonsLayout->setSpacing(6);
265   GroupButtonsLayout->setMargin(11);
266   buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
267   buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
268   buttonCancel->setAutoDefault(TRUE);
269   GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
270   buttonApply = new QPushButton(GroupButtons, "buttonApply");
271   buttonApply->setText(tr("SMESH_BUT_APPLY" ));
272   buttonApply->setAutoDefault(TRUE);
273   GroupButtonsLayout->addWidget(buttonApply, 0, 1);
274   QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
275   GroupButtonsLayout->addItem(spacer_9, 0, 2);
276   buttonOk = new QPushButton(GroupButtons, "buttonOk");
277   buttonOk->setText(tr("SMESH_BUT_OK" ));
278   buttonOk->setAutoDefault(TRUE);
279   buttonOk->setDefault(TRUE);
280   GroupButtonsLayout->addWidget(buttonOk, 0, 0);
281   SMESHGUI_NodesDlgLayout->addWidget(GroupButtons, 2, 0);
282
283   /***************************************************************/
284   GroupConstructors = new QButtonGroup(this, "GroupConstructors");
285   GroupConstructors->setTitle(tr("MESH_NODE" ));
286   GroupConstructors->setExclusive(TRUE);
287   GroupConstructors->setColumnLayout(0, Qt::Vertical);
288   GroupConstructors->layout()->setSpacing(0);
289   GroupConstructors->layout()->setMargin(0);
290   GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
291   GroupConstructorsLayout->setAlignment(Qt::AlignTop);
292   GroupConstructorsLayout->setSpacing(6);
293   GroupConstructorsLayout->setMargin(11);
294   Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
295   Constructor1->setText(tr("" ));
296   Constructor1->setPixmap(image0);
297   Constructor1->setChecked(TRUE);
298   GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
299   QSpacerItem* spacer_2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
300   GroupConstructorsLayout->addItem(spacer_2, 0, 1);
301   SMESHGUI_NodesDlgLayout->addWidget(GroupConstructors, 0, 0);
302
303   /***************************************************************/
304   GroupCoordinates = new QGroupBox(this, "GroupCoordinates");
305   GroupCoordinates->setTitle(tr("SMESH_COORDINATES" ));
306   GroupCoordinates->setColumnLayout(0, Qt::Vertical);
307   GroupCoordinates->layout()->setSpacing(0);
308   GroupCoordinates->layout()->setMargin(0);
309   GroupCoordinatesLayout = new QGridLayout(GroupCoordinates->layout());
310   GroupCoordinatesLayout->setAlignment(Qt::AlignTop);
311   GroupCoordinatesLayout->setSpacing(6);
312   GroupCoordinatesLayout->setMargin(11);
313   TextLabel_X = new QLabel(GroupCoordinates, "TextLabel_X");
314   TextLabel_X->setText(tr("SMESH_X" ));
315   GroupCoordinatesLayout->addWidget(TextLabel_X, 0, 0);
316   TextLabel_Y = new QLabel(GroupCoordinates, "TextLabel_Y");
317   TextLabel_Y->setText(tr("SMESH_Y" ));
318   GroupCoordinatesLayout->addWidget(TextLabel_Y, 0, 2);
319
320   TextLabel_Z = new QLabel(GroupCoordinates, "TextLabel_Z");
321   TextLabel_Z->setText(tr("SMESH_Z" ));
322   GroupCoordinatesLayout->addWidget(TextLabel_Z, 0, 4);
323
324   SpinBox_X = new SMESHGUI_SpinBox(GroupCoordinates, "SpinBox_X");
325   GroupCoordinatesLayout->addWidget(SpinBox_X, 0, 1);
326
327   SpinBox_Y = new SMESHGUI_SpinBox(GroupCoordinates, "SpinBox_Y");
328   GroupCoordinatesLayout->addWidget(SpinBox_Y, 0, 3);
329
330   SpinBox_Z = new SMESHGUI_SpinBox(GroupCoordinates, "SpinBox_Z");
331   GroupCoordinatesLayout->addWidget(SpinBox_Z, 0, 5);
332
333   SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0);
334
335   /* Initialisation and display */
336   Init(Sel);
337 }
338
339 //=======================================================================
340 // function : ~SMESHGUI_NodesDlg()
341 // purpose  : Destructor
342 //=======================================================================
343 SMESHGUI_NodesDlg::~SMESHGUI_NodesDlg()
344 {
345   delete mySimulation;
346 }
347
348 //=================================================================================
349 // function : Init()
350 // purpose  :
351 //=================================================================================
352 void SMESHGUI_NodesDlg::Init (SalomeApp_SelectionMgr* Sel)
353 {
354   /* Get setting of step value from file configuration */
355   double step;
356   // QString St = SUIT_CONFIG->getSetting("xxxxxxxxxxxxx");  TODO
357   // step = St.toDouble();                                    TODO
358   step = 25.0;
359
360   /* min, max, step and decimals for spin boxes */
361   SpinBox_X->RangeStepAndValidator(-999.999, +999.999, step, 3);
362   SpinBox_Y->RangeStepAndValidator(-999.999, +999.999, step, 3);
363   SpinBox_Z->RangeStepAndValidator(-999.999, +999.999, step, 3);
364   SpinBox_X->SetValue(0.0);
365   SpinBox_Y->SetValue(0.0);
366   SpinBox_Z->SetValue(0.0);
367
368   mySelectionMgr = Sel;
369   myMeshGUI = SMESHGUI::GetSMESHGUI();
370   myMeshGUI->SetActiveDialogBox((QDialog*)this);
371
372   /* signals and slots connections */
373   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
374   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
375   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
376
377   connect(SpinBox_X, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
378   connect(SpinBox_Y, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
379   connect(SpinBox_Z, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
380
381   connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
382   connect(myMeshGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
383   /* to close dialog if study frame change */
384   connect(myMeshGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
385
386   /* Move widget on the botton right corner of main widget */
387   int x, y;
388   myMeshGUI->DefineDlgPosition(this, x, y);
389   this->move(x, y);
390   this->show();
391
392   // set selection mode
393   SMESH::SetPointRepresentation(true);
394 #ifdef NEW_GUI
395   mySelectionMgr->setSelectionModes(NodeSelection, true);
396 #else
397   mySelectionMgr->setSelectionModes(NodeSelection);
398 #endif
399
400   SelectionIntoArgument();
401 }
402
403 //=================================================================================
404 // function : ValueChangedInSpinBox()
405 // purpose  :
406 //=================================================================================
407 void SMESHGUI_NodesDlg::ValueChangedInSpinBox (double newValue)
408 {
409   if (!myMesh->_is_nil()) {
410     double vx = SpinBox_X->GetValue();
411     double vy = SpinBox_Y->GetValue();
412     double vz = SpinBox_Z->GetValue();
413
414     mySimulation->SetPosition(vx,vy,vz);
415   }
416 }
417
418 //=================================================================================
419 // function : ClickOnOk()
420 // purpose  :
421 //=================================================================================
422 void SMESHGUI_NodesDlg::ClickOnOk()
423 {
424   if (ClickOnApply())
425     ClickOnCancel();
426 }
427
428 //=================================================================================
429 // function : ClickOnApply()
430 // purpose  :
431 //=================================================================================
432 bool SMESHGUI_NodesDlg::ClickOnApply()
433 {
434   if (myMeshGUI->isActiveStudyLocked())
435     return false;
436
437   if (myMesh->_is_nil()) {
438     SUIT_MessageBox::warn1(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
439                            tr("MESH_IS_NOT_SELECTED"), tr("SMESH_BUT_OK"));
440     return false;
441   }
442
443   /* Recup args and call method */
444   double x = SpinBox_X->GetValue();
445   double y = SpinBox_Y->GetValue();
446   double z = SpinBox_Z->GetValue();
447   mySimulation->SetVisibility(false);
448   SMESH::AddNode(myMesh,x,y,z);
449   SMESH::SetPointRepresentation(true);
450
451   // select myMesh
452   SALOME_ListIO aList;
453   mySelectionMgr->selectedObjects(aList);
454   if (aList.Extent() != 1) {
455     if (SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView()) {
456       vtkActorCollection *aCollection = aViewWindow->getRenderer()->GetActors();
457       aCollection->InitTraversal();
458       while (vtkActor *anAct = aCollection->GetNextActor()) {
459         if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
460           if (anActor->hasIO()) {
461             if (SMESH_MeshObj *aMeshObj = dynamic_cast<SMESH_MeshObj*>(anActor->GetObject().get())) {
462               if (myMesh->_is_equivalent(aMeshObj->GetMeshServer())) {
463 #ifdef NEW_GUI
464                 mySelectionMgr->clearSelected();
465                 mySelectionMgr->AddIObject(anActor->getIO(), false);
466 #else
467                 aList.Clear();
468                 aList.Append(anActor->getIO());
469                 mySelectionMgr->setSelectedObjects(aList, false);
470 #endif
471                 break;
472               }
473             }
474           }
475         }
476       }
477     }
478   }
479   return true;
480 }
481
482 //=================================================================================
483 // function : ClickOnCancel()
484 // purpose  :
485 //=================================================================================
486 void SMESHGUI_NodesDlg::ClickOnCancel()
487 {
488   MESSAGE("SMESHGUI_NodesDlg::ClickOnCancel() 1");
489   disconnect(mySelectionMgr, 0, this, 0);
490   mySelectionMgr->clearSelected();
491   mySelectionMgr->setSelectionModes(ActorSelection);
492
493   MESSAGE("SMESHGUI_NodesDlg::ClickOnCancel() 2");
494   mySimulation->SetVisibility(false);
495   SMESH::SetPointRepresentation(false);
496   myMeshGUI->ResetState();
497
498   reject();
499   MESSAGE("SMESHGUI_NodesDlg::ClickOnCancel() 3");
500 }
501
502 //=================================================================================
503 // function : SelectionIntoArgument()
504 // purpose  : Called when selection as changed or other case
505 //=================================================================================
506 void SMESHGUI_NodesDlg::SelectionIntoArgument()
507 {
508   if (!GroupConstructors->isEnabled())
509     return;
510
511   mySimulation->SetVisibility(false);
512   SMESH::SetPointRepresentation(true);
513
514   SALOME_ListIO aList;
515   mySelectionMgr->selectedObjects(aList);
516   if (aList.Extent() == 1) {
517     Handle(SALOME_InteractiveObject) anIO = aList.First();
518     if (anIO->hasEntry()) {
519       myMesh = SMESH::GetMeshByIO(anIO);
520       if (myMesh->_is_nil()) return;
521       QString aText;
522       if (SMESH::GetNameOfSelectedNodes(mySelectionMgr, aText) == 1) {
523         if (SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh.in())) {
524           if (SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh()) {
525             if (const SMDS_MeshNode* aNode = aMesh->FindNode(aText.toInt())) {
526               SpinBox_X->SetValue(aNode->X());
527               SpinBox_Y->SetValue(aNode->Y());
528               SpinBox_Z->SetValue(aNode->Z());
529             }
530           }
531         }
532       }
533       mySimulation->SetPosition(SpinBox_X->GetValue(),
534                                 SpinBox_Y->GetValue(),
535                                 SpinBox_Z->GetValue());
536     }
537   }
538 }
539
540 //=================================================================================
541 // function : closeEvent()
542 // purpose  :
543 //=================================================================================
544 void SMESHGUI_NodesDlg::closeEvent (QCloseEvent*)
545 {
546   this->ClickOnCancel(); /* same than click on cancel button */
547 }
548
549 //=================================================================================
550 // function : hideEvent()
551 // purpose  : caused by ESC key
552 //=================================================================================
553 void SMESHGUI_NodesDlg::hideEvent (QHideEvent*)
554 {
555   if (!isMinimized())
556     ClickOnCancel();
557 }
558
559 //=================================================================================
560 // function : enterEvent()
561 // purpose  : to reactivate this dialog box when mouse enter onto the window
562 //=================================================================================
563 void SMESHGUI_NodesDlg::enterEvent(QEvent*)
564 {
565   if (!GroupConstructors->isEnabled())
566     ActivateThisDialog();
567 }
568
569 //=================================================================================
570 // function : DeactivateActiveDialog()
571 // purpose  : public slot to deactivate if active
572 //=================================================================================
573 void SMESHGUI_NodesDlg::DeactivateActiveDialog()
574 {
575   if (GroupConstructors->isEnabled()) {
576     GroupConstructors->setEnabled(false);
577     GroupCoordinates->setEnabled(false);
578     GroupButtons->setEnabled(false);
579     mySimulation->SetVisibility(false);
580     myMeshGUI->ResetState();
581     myMeshGUI->SetActiveDialogBox(0);
582   }
583 }
584
585 //=================================================================================
586 // function : ActivateThisDialog()
587 // purpose  :
588 //=================================================================================
589 void SMESHGUI_NodesDlg::ActivateThisDialog()
590 {
591   myMeshGUI->EmitSignalDeactivateDialog();
592   GroupConstructors->setEnabled(true);
593   GroupCoordinates->setEnabled(true);
594   GroupButtons->setEnabled(true);
595
596   SMESH::SetPointRepresentation(true);
597 #ifdef NEW_GUI
598   mySelectionMgr->setSelectionModes(NodeSelection, true);
599 #else
600   mySelectionMgr->setSelectionModes(NodeSelection);
601 #endif
602
603   SelectionIntoArgument();
604 }