1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File : SMESHGUI_AddMeshElementDlg.cxx
24 // Author : Nicolas REJNERI, Open CASCADE S.A.S.
27 #include "SMESHGUI_AddMeshElementDlg.h"
30 #include "SMESHGUI_Utils.h"
31 #include "SMESHGUI_VTKUtils.h"
32 #include "SMESHGUI_MeshUtils.h"
33 #include "SMESHGUI_IdValidator.h"
35 #include <SMESH_Actor.h>
36 #include <SMESH_ActorUtils.h>
37 #include <SMESH_FaceOrientationFilter.h>
38 #include <SMDS_Mesh.hxx>
41 #include <SUIT_Desktop.h>
42 #include <SUIT_Session.h>
43 #include <SUIT_ResourceMgr.h>
44 #include <SUIT_MessageBox.h>
45 #include <SUIT_ViewManager.h>
46 #include <LightApp_SelectionMgr.h>
47 #include <SALOME_ListIO.hxx>
48 #include <SalomeApp_Application.h>
49 #include <SVTK_ViewModel.h>
50 #include <SVTK_ViewWindow.h>
53 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
56 #include <TColStd_MapOfInteger.hxx>
60 #include <vtkIdList.h>
61 #include <vtkUnstructuredGrid.h>
62 #include <vtkDataSetMapper.h>
63 #include <vtkPolyDataMapper.h>
64 #include <vtkProperty.h>
70 #include <QPushButton>
71 #include <QRadioButton>
72 #include <QHBoxLayout>
73 #include <QVBoxLayout>
74 #include <QGridLayout>
78 #include <QButtonGroup>
85 class TElementSimulation
87 SalomeApp_Application* myApplication;
88 SUIT_ViewWindow* myViewWindow;
89 SVTK_ViewWindow* myVTKViewWindow;
91 SALOME_Actor* myPreviewActor;
92 vtkDataSetMapper* myMapper;
93 vtkUnstructuredGrid* myGrid;
95 SALOME_Actor* myFaceOrientation;
96 vtkPolyDataMapper* myFaceOrientationDataMapper;
97 SMESH_FaceOrientationFilter* myFaceOrientationFilter;
100 TElementSimulation (SalomeApp_Application* theApplication)
102 myApplication = theApplication;
103 SUIT_ViewManager* mgr = theApplication->activeViewManager();
105 myViewWindow = mgr->getActiveView();
106 myVTKViewWindow = GetVtkViewWindow(myViewWindow);
108 myGrid = vtkUnstructuredGrid::New();
110 // Create and display actor
111 myMapper = vtkDataSetMapper::New();
112 myMapper->SetInput(myGrid);
114 myPreviewActor = SALOME_Actor::New();
115 myPreviewActor->PickableOff();
116 myPreviewActor->VisibilityOff();
117 myPreviewActor->SetMapper(myMapper);
119 vtkFloatingPointType anRGB[3];
120 vtkProperty* aProp = vtkProperty::New();
121 GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
122 aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
123 myPreviewActor->SetProperty( aProp );
126 vtkProperty* aBackProp = vtkProperty::New();
127 GetColor( "SMESH", "backface_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 0, 255 ) );
128 aBackProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
129 myPreviewActor->SetBackfaceProperty( aBackProp );
132 myVTKViewWindow->AddActor(myPreviewActor);
134 // Orientation of faces
135 myFaceOrientationFilter = SMESH_FaceOrientationFilter::New();
136 myFaceOrientationFilter->SetInput(myGrid);
138 myFaceOrientationDataMapper = vtkPolyDataMapper::New();
139 myFaceOrientationDataMapper->SetInput(myFaceOrientationFilter->GetOutput());
141 myFaceOrientation = SALOME_Actor::New();
142 myFaceOrientation->PickableOff();
143 myFaceOrientation->VisibilityOff();
144 myFaceOrientation->SetMapper(myFaceOrientationDataMapper);
146 vtkProperty* anOrientationProp = vtkProperty::New();
147 GetColor( "SMESH", "orientation_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
148 anOrientationProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
149 myFaceOrientation->SetProperty( anOrientationProp );
150 anOrientationProp->Delete();
152 myVTKViewWindow->AddActor(myFaceOrientation);
155 typedef std::vector<vtkIdType> TVTKIds;
156 void SetPosition (SMESH_Actor* theActor,
158 const TVTKIds& theIds)
160 vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
161 myGrid->SetPoints(aGrid->GetPoints());
163 const int* aConn = NULL;
167 static int anIds[] = {0,2,1,3};
173 static int anIds[] = {0,3,2,1,4};
179 static int anIds[] = {0,3,2,1,4,7,6,5};
186 vtkIdList *anIds = vtkIdList::New();
189 for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
190 anIds->InsertId(i,theIds[aConn[i]]);
192 for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
193 anIds->InsertId(i,theIds[i]);
195 myGrid->InsertNextCell(theType,anIds);
200 SetVisibility(true, theActor->GetFacesOriented());
204 void SetVisibility (bool theVisibility, bool theShowOrientation = false)
206 myPreviewActor->SetVisibility(theVisibility);
207 myFaceOrientation->SetVisibility(theShowOrientation);
208 RepaintCurrentView();
212 ~TElementSimulation()
214 if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
215 myVTKViewWindow->RemoveActor(myPreviewActor);
216 myVTKViewWindow->RemoveActor(myFaceOrientation);
218 myPreviewActor->Delete();
219 myFaceOrientation->Delete();
221 myMapper->RemoveAllInputs();
224 myFaceOrientationFilter->Delete();
226 myFaceOrientationDataMapper->RemoveAllInputs();
227 myFaceOrientationDataMapper->Delete();
234 //=================================================================================
235 // function : SMESHGUI_AddMeshElementDlg()
236 // purpose : constructor
237 //=================================================================================
238 SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
239 SMDSAbs_ElementType ElementType,
241 : QDialog( SMESH::GetDesktop( theModule ) ),
242 mySMESHGUI( theModule ),
243 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
246 setAttribute( Qt::WA_DeleteOnClose, true );
248 SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
249 (SUIT_Session::session()->activeApplication());
251 mySimulation = new SMESH::TElementSimulation (anApp);
252 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
254 // verify nb nodes and type
256 myElementType = ElementType;
257 switch (ElementType) {
258 case SMDSAbs_0DElement:
263 // if (myNbNodes != 3 && myNbNodes != 4)
267 // if (myNbNodes != 4 && myNbNodes != 8) //(nbNodes < 4 || nbNodes > 8 || nbNodes == 7)
271 myElementType = SMDSAbs_Edge;
276 if (myNbNodes == 1) {
278 myHelpFileName = "adding_nodes_and_elements_page.html#adding_0delems_anchor";
280 else if (myNbNodes == 2) {
282 myHelpFileName = "adding_nodes_and_elements_page.html#adding_edges_anchor";
284 else if (myNbNodes == 3) {
285 elemName = "TRIANGLE";
286 myHelpFileName = "adding_nodes_and_elements_page.html#adding_triangles_anchor";
288 else if (myNbNodes == 4) {
289 if (myElementType == SMDSAbs_Face) {
290 elemName = "QUADRANGLE";
291 myHelpFileName = "adding_nodes_and_elements_page.html#adding_quadrangles_anchor";
295 myHelpFileName = "adding_nodes_and_elements_page.html#adding_tetrahedrons_anchor";
298 else if (myNbNodes == 8) {
300 myHelpFileName = "adding_nodes_and_elements_page.html#adding_hexahedrons_anchor";
302 else if (myElementType == SMDSAbs_Face) {
303 elemName = "POLYGON";
305 myHelpFileName = "adding_nodes_and_elements_page.html#adding_polygons_anchor";
307 else if (myElementType == SMDSAbs_Volume) {
308 myHelpFileName = "adding_nodes_and_elements_page.html#adding_polyhedrons_anchor";
311 QString iconName = tr(QString("ICON_DLG_%1").arg(elemName).toLatin1().data());
312 QString buttonGrTitle = tr(QString("SMESH_%1").arg(elemName).toLatin1().data());
313 QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(elemName).toLatin1().data());
314 QString grBoxTitle = tr(QString("SMESH_ADD_%1").arg(elemName).toLatin1().data());
316 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", iconName));
317 QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
319 setWindowTitle(caption);
320 setSizeGripEnabled(true);
322 QVBoxLayout* aTopLayout = new QVBoxLayout(this);
323 aTopLayout->setSpacing(SPACING);
324 aTopLayout->setMargin(MARGIN);
326 /***************************************************************/
327 GroupConstructors = new QGroupBox(buttonGrTitle, this);
328 QButtonGroup* ButtonGroup = new QButtonGroup(this);
329 QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
330 GroupConstructorsLayout->setSpacing(SPACING);
331 GroupConstructorsLayout->setMargin(MARGIN);
333 Constructor1 = new QRadioButton(GroupConstructors);
334 Constructor1->setIcon(image0);
335 Constructor1->setChecked(true);
337 GroupConstructorsLayout->addWidget(Constructor1);
338 ButtonGroup->addButton( Constructor1, 0 );
340 /***************************************************************/
341 GroupC1 = new QGroupBox(grBoxTitle, this);
342 QGridLayout* GroupC1Layout = new QGridLayout(GroupC1);
343 GroupC1Layout->setSpacing(SPACING);
344 GroupC1Layout->setMargin(MARGIN);
346 TextLabelC1A1 = new QLabel(tr("SMESH_ID_NODES"), GroupC1);
347 SelectButtonC1A1 = new QPushButton(GroupC1);
348 SelectButtonC1A1->setIcon(image1);
349 LineEditC1A1 = new QLineEdit(GroupC1);
350 // LineEditC1A1->setReadOnly(true);
352 LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, myNbNodes));
354 Reverse = myElementType == SMDSAbs_Face ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
356 GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
357 GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
358 GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
359 if ( Reverse ) GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
361 /***************************************************************/
362 GroupButtons = new QGroupBox(this);
363 QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
364 GroupButtonsLayout->setSpacing(SPACING);
365 GroupButtonsLayout->setMargin(MARGIN);
367 buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
368 buttonOk->setAutoDefault(true);
369 buttonOk->setDefault(true);
370 buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
371 buttonApply->setAutoDefault(true);
372 buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
373 buttonCancel->setAutoDefault(true);
374 buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
375 buttonHelp->setAutoDefault(true);
377 GroupButtonsLayout->addWidget(buttonOk);
378 GroupButtonsLayout->addSpacing(10);
379 GroupButtonsLayout->addWidget(buttonApply);
380 GroupButtonsLayout->addSpacing(10);
381 GroupButtonsLayout->addStretch();
382 GroupButtonsLayout->addWidget(buttonCancel);
383 GroupButtonsLayout->addWidget(buttonHelp);
385 /***************************************************************/
386 aTopLayout->addWidget(GroupConstructors);
387 aTopLayout->addWidget(GroupC1);
388 aTopLayout->addWidget(GroupButtons);
390 Init(); /* Initialisations */
393 //=================================================================================
394 // function : ~SMESHGUI_AddMeshElementDlg()
395 // purpose : Destroys the object and frees any allocated resources
396 //=================================================================================
397 SMESHGUI_AddMeshElementDlg::~SMESHGUI_AddMeshElementDlg()
402 //=================================================================================
405 //=================================================================================
406 void SMESHGUI_AddMeshElementDlg::Init()
409 Constructor1->setChecked(true);
410 myEditCurrentArgument = LineEditC1A1;
411 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
416 /* signals and slots connections */
417 connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk()));
418 connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel()));
419 connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply()));
420 connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp()));
422 connect(SelectButtonC1A1, SIGNAL(clicked()), SLOT(SetEditCurrentArgument()));
423 connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
424 connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
425 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
426 /* to close dialog if study frame change */
427 connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
430 connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int)));
432 // set selection mode
433 SMESH::SetPointRepresentation(true);
435 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
436 aViewWindow->SetSelectionMode( NodeSelection );
440 SelectionIntoArgument();
443 //=================================================================================
444 // function : ClickOnApply()
446 //=================================================================================
447 void SMESHGUI_AddMeshElementDlg::ClickOnApply()
449 if (myNbOkNodes && !mySMESHGUI->isActiveStudyLocked()) {
451 SMESH::long_array_var anArrayOfIndices = new SMESH::long_array;
452 anArrayOfIndices->length(myNbNodes);
453 bool reverse = (Reverse && Reverse->isChecked());
454 QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
455 for (int i = 0; i < aListId.count(); i++)
457 anArrayOfIndices[i] = aListId[ myNbNodes - i - 1 ].toInt();
459 anArrayOfIndices[i] = aListId[ i ].toInt();
461 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
462 switch (myElementType) {
463 case SMDSAbs_0DElement:
464 aMeshEditor->Add0DElement(anArrayOfIndices[0]); break;
466 aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
469 aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
471 aMeshEditor->AddFace(anArrayOfIndices.inout());
475 aMeshEditor->AddVolume(anArrayOfIndices.inout()); break;
479 SALOME_ListIO aList; aList.Append( myActor->getIO() );
480 mySelector->ClearIndex();
481 mySelectionMgr->setSelectedObjects( aList, false );
484 mySimulation->SetVisibility(false);
486 buttonOk->setEnabled(false);
487 buttonApply->setEnabled(false);
489 myEditCurrentArgument->setText("");
495 //=================================================================================
496 // function : ClickOnOk()
498 //=================================================================================
499 void SMESHGUI_AddMeshElementDlg::ClickOnOk()
505 //=================================================================================
506 // function : ClickOnCancel()
508 //=================================================================================
509 void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
511 //mySelectionMgr->clearSelected();
512 mySimulation->SetVisibility(false);
513 SMESH::SetPointRepresentation(false);
514 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
515 aViewWindow->SetSelectionMode( ActorSelection );
516 disconnect(mySelectionMgr, 0, this, 0);
517 mySMESHGUI->ResetState();
521 //=================================================================================
522 // function : ClickOnHelp()
524 //=================================================================================
525 void SMESHGUI_AddMeshElementDlg::ClickOnHelp()
527 LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
529 app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""),
534 platform = "winapplication";
536 platform = "application";
538 SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
539 tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
540 arg(app->resourceMgr()->stringValue("ExternalBrowser",
542 arg(myHelpFileName));
546 //=================================================================================
547 // function : onTextChange()
549 //=================================================================================
550 void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
557 buttonOk->setEnabled(false);
558 buttonApply->setEnabled(false);
560 mySimulation->SetVisibility(false);
562 // hilight entered nodes
563 SMDS_Mesh* aMesh = 0;
565 aMesh = myActor->GetObject()->GetMesh();
568 TColStd_MapOfInteger newIndices;
570 QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
572 for (int i = 0; i < aListId.count(); i++) {
573 if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
575 newIndices.Add( n->GetID() );
582 mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
583 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
584 aViewWindow->highlight( myActor->getIO(), true, true );
586 myNbOkNodes = ( allOk && myNbNodes == aListId.count() );
590 if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
593 myNbOkNodes = aListId.count();
598 buttonOk->setEnabled(true);
599 buttonApply->setEnabled(true);
606 //=================================================================================
607 // function : SelectionIntoArgument()
608 // purpose : Called when selection has changed
609 //=================================================================================
610 void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument()
619 myEditCurrentArgument->setText("");
622 if (!GroupButtons->isEnabled()) // inactive
625 buttonOk->setEnabled(false);
626 buttonApply->setEnabled(false);
628 mySimulation->SetVisibility(false);
629 // SMESH::SetPointRepresentation(true);
633 mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
635 if (aList.Extent() != 1)
638 Handle(SALOME_InteractiveObject) anIO = aList.First();
639 myMesh = SMESH::GetMeshByIO(anIO);
640 if (myMesh->_is_nil())
643 myActor = SMESH::FindActorByEntry(anIO->getEntry());
647 // get selected nodes
648 QString aString = "";
649 int nbNodes = SMESH::GetNameOfSelectedNodes(mySelector,myActor->getIO(),aString);
651 myEditCurrentArgument->setText(aString);
653 if (myIsPoly && myElementType == SMDSAbs_Face && nbNodes >= 3 ) {
655 } else if (myNbNodes != nbNodes) {
660 myNbOkNodes = nbNodes;
662 buttonOk->setEnabled(true);
663 buttonApply->setEnabled(true);
668 //=================================================================================
669 // function : displaySimulation()
671 //=================================================================================
672 void SMESHGUI_AddMeshElementDlg::displaySimulation()
674 if (myNbOkNodes && GroupButtons->isEnabled()) {
675 SMESH::TElementSimulation::TVTKIds anIds;
676 QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
677 for (int i = 0; i < aListId.count(); i++)
678 anIds.push_back(myActor->GetObject()->GetNodeVTKId(aListId[ i ].toInt()));
680 if (Reverse && Reverse->isChecked())
681 reverse(anIds.begin(),anIds.end());
685 switch ( myElementType ) {
686 case SMDSAbs_Face : aType = VTK_POLYGON; break;
691 case 2: aType = VTK_LINE; break;
692 case 3: aType = VTK_TRIANGLE; break;
693 case 4: aType = myElementType == SMDSAbs_Face ? VTK_QUAD : VTK_TETRA; break;
694 case 8: aType = VTK_HEXAHEDRON; break;
699 mySimulation->SetPosition(myActor,aType,anIds);
704 //=================================================================================
705 // function : SetEditCurrentArgument()
707 //=================================================================================
708 void SMESHGUI_AddMeshElementDlg::SetEditCurrentArgument()
710 QPushButton* send = (QPushButton*)sender();
711 if (send == SelectButtonC1A1) {
712 LineEditC1A1->setFocus();
713 myEditCurrentArgument = LineEditC1A1;
715 SelectionIntoArgument();
718 //=================================================================================
719 // function : DeactivateActiveDialog()
721 //=================================================================================
722 void SMESHGUI_AddMeshElementDlg::DeactivateActiveDialog()
724 if (GroupConstructors->isEnabled()) {
725 GroupConstructors->setEnabled(false);
726 GroupC1->setEnabled(false);
727 GroupButtons->setEnabled(false);
728 mySimulation->SetVisibility(false);
729 mySMESHGUI->ResetState();
730 mySMESHGUI->SetActiveDialogBox(0);
734 //=================================================================================
735 // function : ActivateThisDialog()
737 //=================================================================================
738 void SMESHGUI_AddMeshElementDlg::ActivateThisDialog()
740 /* Emit a signal to deactivate the active dialog */
741 mySMESHGUI->EmitSignalDeactivateDialog();
743 GroupConstructors->setEnabled(true);
744 GroupC1->setEnabled(true);
745 GroupButtons->setEnabled(true);
747 SMESH::SetPointRepresentation(true);
749 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
750 aViewWindow->SetSelectionMode( NodeSelection );
751 SelectionIntoArgument();
754 //=================================================================================
755 // function : enterEvent()
757 //=================================================================================
758 void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
760 if (GroupConstructors->isEnabled())
762 ActivateThisDialog();
765 //=================================================================================
766 // function : closeEvent()
768 //=================================================================================
769 void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*)
771 /* same than click on cancel button */
775 //=================================================================================
776 // function : hideEvent()
777 // purpose : caused by ESC key
778 //=================================================================================
779 void SMESHGUI_AddMeshElementDlg::hideEvent (QHideEvent*)
785 //=================================================================================
786 // function : CheckBox()
788 //=================================================================================
789 void SMESHGUI_AddMeshElementDlg::CheckBox (int state)
795 mySimulation->SetVisibility(false);
800 //=================================================================================
801 // function : keyPressEvent()
803 //=================================================================================
804 void SMESHGUI_AddMeshElementDlg::keyPressEvent( QKeyEvent* e )
806 QDialog::keyPressEvent( e );
807 if ( e->isAccepted() )
810 if ( e->key() == Qt::Key_F1 ) {