1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 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 // File : SMESHGUI_AddMeshElementDlg.cxx
23 // 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) {
259 // if (myNbNodes != 3 && myNbNodes != 4)
263 // if (myNbNodes != 4 && myNbNodes != 8) //(nbNodes < 4 || nbNodes > 8 || nbNodes == 7)
267 myElementType = SMDSAbs_Edge;
272 if (myNbNodes == 2) {
274 myHelpFileName = "adding_nodes_and_elements_page.html#adding_edges_anchor";
276 else if (myNbNodes == 3) {
277 elemName = "TRIANGLE";
278 myHelpFileName = "adding_nodes_and_elements_page.html#adding_triangles_anchor";
280 else if (myNbNodes == 4)
281 if (myElementType == SMDSAbs_Face) {
282 elemName = "QUADRANGLE";
283 myHelpFileName = "adding_nodes_and_elements_page.html#adding_quadrangles_anchor";
287 myHelpFileName = "adding_nodes_and_elements_page.html#adding_tetrahedrons_anchor";
289 else if (myNbNodes == 8) {
291 myHelpFileName = "adding_nodes_and_elements_page.html#adding_hexahedrons_anchor";
293 else if (myElementType == SMDSAbs_Face) {
294 elemName = "POLYGON";
296 myHelpFileName = "adding_nodes_and_elements_page.html#adding_polygons_anchor";
298 else if (myElementType == SMDSAbs_Volume) {
299 myHelpFileName = "adding_nodes_and_elements_page.html#adding_polyhedrons_anchor";
302 QString iconName = tr(QString("ICON_DLG_%1").arg(elemName).toLatin1().data());
303 QString buttonGrTitle = tr(QString("SMESH_%1").arg(elemName).toLatin1().data());
304 QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(elemName).toLatin1().data());
305 QString grBoxTitle = tr(QString("SMESH_ADD_%1").arg(elemName).toLatin1().data());
307 QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", iconName));
308 QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
310 setWindowTitle(caption);
311 setSizeGripEnabled(true);
313 QVBoxLayout* aTopLayout = new QVBoxLayout(this);
314 aTopLayout->setSpacing(SPACING);
315 aTopLayout->setMargin(MARGIN);
317 /***************************************************************/
318 GroupConstructors = new QGroupBox(buttonGrTitle, this);
319 QButtonGroup* ButtonGroup = new QButtonGroup(this);
320 QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
321 GroupConstructorsLayout->setSpacing(SPACING);
322 GroupConstructorsLayout->setMargin(MARGIN);
324 Constructor1 = new QRadioButton(GroupConstructors);
325 Constructor1->setIcon(image0);
326 Constructor1->setChecked(true);
328 GroupConstructorsLayout->addWidget(Constructor1);
329 ButtonGroup->addButton( Constructor1, 0 );
331 /***************************************************************/
332 GroupC1 = new QGroupBox(grBoxTitle, this);
333 QGridLayout* GroupC1Layout = new QGridLayout(GroupC1);
334 GroupC1Layout->setSpacing(SPACING);
335 GroupC1Layout->setMargin(MARGIN);
337 TextLabelC1A1 = new QLabel(tr("SMESH_ID_NODES"), GroupC1);
338 SelectButtonC1A1 = new QPushButton(GroupC1);
339 SelectButtonC1A1->setIcon(image1);
340 LineEditC1A1 = new QLineEdit(GroupC1);
341 // LineEditC1A1->setReadOnly(true);
343 LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, myNbNodes));
345 Reverse = myElementType == SMDSAbs_Face ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
347 GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
348 GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
349 GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
350 if ( Reverse ) GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
352 /***************************************************************/
353 GroupButtons = new QGroupBox(this);
354 QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
355 GroupButtonsLayout->setSpacing(SPACING);
356 GroupButtonsLayout->setMargin(MARGIN);
358 buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
359 buttonOk->setAutoDefault(true);
360 buttonOk->setDefault(true);
361 buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
362 buttonApply->setAutoDefault(true);
363 buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
364 buttonCancel->setAutoDefault(true);
365 buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
366 buttonHelp->setAutoDefault(true);
368 GroupButtonsLayout->addWidget(buttonOk);
369 GroupButtonsLayout->addSpacing(10);
370 GroupButtonsLayout->addWidget(buttonApply);
371 GroupButtonsLayout->addSpacing(10);
372 GroupButtonsLayout->addStretch();
373 GroupButtonsLayout->addWidget(buttonCancel);
374 GroupButtonsLayout->addWidget(buttonHelp);
376 /***************************************************************/
377 aTopLayout->addWidget(GroupConstructors);
378 aTopLayout->addWidget(GroupC1);
379 aTopLayout->addWidget(GroupButtons);
381 Init(); /* Initialisations */
384 //=================================================================================
385 // function : ~SMESHGUI_AddMeshElementDlg()
386 // purpose : Destroys the object and frees any allocated resources
387 //=================================================================================
388 SMESHGUI_AddMeshElementDlg::~SMESHGUI_AddMeshElementDlg()
393 //=================================================================================
396 //=================================================================================
397 void SMESHGUI_AddMeshElementDlg::Init()
400 Constructor1->setChecked(true);
401 myEditCurrentArgument = LineEditC1A1;
402 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
407 /* signals and slots connections */
408 connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk()));
409 connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel()));
410 connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply()));
411 connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp()));
413 connect(SelectButtonC1A1, SIGNAL(clicked()), SLOT(SetEditCurrentArgument()));
414 connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
415 connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
416 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
417 /* to close dialog if study frame change */
418 connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
421 connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int)));
423 // set selection mode
424 SMESH::SetPointRepresentation(true);
426 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
427 aViewWindow->SetSelectionMode( NodeSelection );
431 SelectionIntoArgument();
434 //=================================================================================
435 // function : ClickOnApply()
437 //=================================================================================
438 void SMESHGUI_AddMeshElementDlg::ClickOnApply()
440 if (myNbOkNodes && !mySMESHGUI->isActiveStudyLocked()) {
442 SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
443 anArrayOfIdeces->length(myNbNodes);
444 bool reverse = (Reverse && Reverse->isChecked());
445 QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
446 for (int i = 0; i < aListId.count(); i++)
448 anArrayOfIdeces[i] = aListId[ myNbNodes - i - 1 ].toInt();
450 anArrayOfIdeces[i] = aListId[ i ].toInt();
452 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
453 switch (myElementType) {
455 aMeshEditor->AddEdge(anArrayOfIdeces.inout()); break;
458 aMeshEditor->AddPolygonalFace(anArrayOfIdeces.inout());
460 aMeshEditor->AddFace(anArrayOfIdeces.inout());
465 aMeshEditor->AddVolume(anArrayOfIdeces.inout()); break;
469 SALOME_ListIO aList; aList.Append( myActor->getIO() );
470 mySelector->ClearIndex();
471 mySelectionMgr->setSelectedObjects( aList, false );
474 mySimulation->SetVisibility(false);
476 buttonOk->setEnabled(false);
477 buttonApply->setEnabled(false);
479 myEditCurrentArgument->setText("");
485 //=================================================================================
486 // function : ClickOnOk()
488 //=================================================================================
489 void SMESHGUI_AddMeshElementDlg::ClickOnOk()
495 //=================================================================================
496 // function : ClickOnCancel()
498 //=================================================================================
499 void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
501 //mySelectionMgr->clearSelected();
502 mySimulation->SetVisibility(false);
503 SMESH::SetPointRepresentation(false);
504 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
505 aViewWindow->SetSelectionMode( ActorSelection );
506 disconnect(mySelectionMgr, 0, this, 0);
507 mySMESHGUI->ResetState();
511 //=================================================================================
512 // function : ClickOnHelp()
514 //=================================================================================
515 void SMESHGUI_AddMeshElementDlg::ClickOnHelp()
517 LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
519 app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
523 platform = "winapplication";
525 platform = "application";
527 SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
528 tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
529 arg(app->resourceMgr()->stringValue("ExternalBrowser",
531 arg(myHelpFileName));
535 //=================================================================================
536 // function : onTextChange()
538 //=================================================================================
539 void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText)
546 buttonOk->setEnabled(false);
547 buttonApply->setEnabled(false);
549 mySimulation->SetVisibility(false);
551 // hilight entered nodes
552 SMDS_Mesh* aMesh = 0;
554 aMesh = myActor->GetObject()->GetMesh();
557 TColStd_MapOfInteger newIndices;
559 QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
561 for (int i = 0; i < aListId.count(); i++) {
562 if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
564 newIndices.Add( n->GetID() );
571 mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
572 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
573 aViewWindow->highlight( myActor->getIO(), true, true );
575 myNbOkNodes = ( allOk && myNbNodes == aListId.count() );
579 if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
582 myNbOkNodes = aListId.count();
587 buttonOk->setEnabled(true);
588 buttonApply->setEnabled(true);
595 //=================================================================================
596 // function : SelectionIntoArgument()
597 // purpose : Called when selection has changed
598 //=================================================================================
599 void SMESHGUI_AddMeshElementDlg::SelectionIntoArgument()
608 myEditCurrentArgument->setText("");
611 if (!GroupButtons->isEnabled()) // inactive
614 buttonOk->setEnabled(false);
615 buttonApply->setEnabled(false);
617 mySimulation->SetVisibility(false);
618 // SMESH::SetPointRepresentation(true);
622 mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
624 if (aList.Extent() != 1)
627 Handle(SALOME_InteractiveObject) anIO = aList.First();
628 myMesh = SMESH::GetMeshByIO(anIO);
629 if (myMesh->_is_nil())
632 myActor = SMESH::FindActorByEntry(anIO->getEntry());
636 // get selected nodes
637 QString aString = "";
638 int nbNodes = SMESH::GetNameOfSelectedNodes(mySelector,myActor->getIO(),aString);
640 myEditCurrentArgument->setText(aString);
642 if (myIsPoly && myElementType == SMDSAbs_Face && nbNodes >= 3 ) {
644 } else if (myNbNodes != nbNodes) {
649 myNbOkNodes = nbNodes;
651 buttonOk->setEnabled(true);
652 buttonApply->setEnabled(true);
657 //=================================================================================
658 // function : displaySimulation()
660 //=================================================================================
661 void SMESHGUI_AddMeshElementDlg::displaySimulation()
663 if (myNbOkNodes && GroupButtons->isEnabled()) {
664 SMESH::TElementSimulation::TVTKIds anIds;
665 QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
666 for (int i = 0; i < aListId.count(); i++)
667 anIds.push_back(myActor->GetObject()->GetNodeVTKId(aListId[ i ].toInt()));
669 if (Reverse && Reverse->isChecked())
670 reverse(anIds.begin(),anIds.end());
674 switch ( myElementType ) {
675 case SMDSAbs_Face : aType = VTK_POLYGON; break;
680 case 2: aType = VTK_LINE; break;
681 case 3: aType = VTK_TRIANGLE; break;
682 case 4: aType = myElementType == SMDSAbs_Face ? VTK_QUAD : VTK_TETRA; break;
683 case 8: aType = VTK_HEXAHEDRON; break;
688 mySimulation->SetPosition(myActor,aType,anIds);
693 //=================================================================================
694 // function : SetEditCurrentArgument()
696 //=================================================================================
697 void SMESHGUI_AddMeshElementDlg::SetEditCurrentArgument()
699 QPushButton* send = (QPushButton*)sender();
700 if (send == SelectButtonC1A1) {
701 LineEditC1A1->setFocus();
702 myEditCurrentArgument = LineEditC1A1;
704 SelectionIntoArgument();
707 //=================================================================================
708 // function : DeactivateActiveDialog()
710 //=================================================================================
711 void SMESHGUI_AddMeshElementDlg::DeactivateActiveDialog()
713 if (GroupConstructors->isEnabled()) {
714 GroupConstructors->setEnabled(false);
715 GroupC1->setEnabled(false);
716 GroupButtons->setEnabled(false);
717 mySimulation->SetVisibility(false);
718 mySMESHGUI->ResetState();
719 mySMESHGUI->SetActiveDialogBox(0);
723 //=================================================================================
724 // function : ActivateThisDialog()
726 //=================================================================================
727 void SMESHGUI_AddMeshElementDlg::ActivateThisDialog()
729 /* Emit a signal to deactivate the active dialog */
730 mySMESHGUI->EmitSignalDeactivateDialog();
732 GroupConstructors->setEnabled(true);
733 GroupC1->setEnabled(true);
734 GroupButtons->setEnabled(true);
736 SMESH::SetPointRepresentation(true);
738 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
739 aViewWindow->SetSelectionMode( NodeSelection );
740 SelectionIntoArgument();
743 //=================================================================================
744 // function : enterEvent()
746 //=================================================================================
747 void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
749 if (GroupConstructors->isEnabled())
751 ActivateThisDialog();
754 //=================================================================================
755 // function : closeEvent()
757 //=================================================================================
758 void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*)
760 /* same than click on cancel button */
764 //=================================================================================
765 // function : hideEvent()
766 // purpose : caused by ESC key
767 //=================================================================================
768 void SMESHGUI_AddMeshElementDlg::hideEvent (QHideEvent*)
774 //=================================================================================
775 // function : CheckBox()
777 //=================================================================================
778 void SMESHGUI_AddMeshElementDlg::CheckBox (int state)
784 mySimulation->SetVisibility(false);
789 //=================================================================================
790 // function : keyPressEvent()
792 //=================================================================================
793 void SMESHGUI_AddMeshElementDlg::keyPressEvent( QKeyEvent* e )
795 QDialog::keyPressEvent( e );
796 if ( e->isAccepted() )
799 if ( e->key() == Qt::Key_F1 ) {