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_ExtrusionAlongPathDlg.cxx
24 // Author : Vadim SANDLER, Open CASCADE S.A.S.
27 #include "SMESHGUI_ExtrusionAlongPathDlg.h"
30 #include "SMESHGUI_Utils.h"
31 #include "SMESHGUI_VTKUtils.h"
32 #include "SMESHGUI_MeshUtils.h"
33 #include "SMESHGUI_SpinBox.h"
34 #include "SMESHGUI_IdValidator.h"
35 #include "SMESHGUI_FilterDlg.h"
37 #include <SMESH_Actor.h>
38 #include <SMESH_TypeFilter.hxx>
39 #include <SMESH_NumberFilter.hxx>
40 #include <SMESH_LogicalFilter.hxx>
42 #include <SMDS_Mesh.hxx>
44 // SALOME GEOM includes
47 // SALOME GUI includes
48 #include <SUIT_ResourceMgr.h>
49 #include <SUIT_OverrideCursor.h>
50 #include <SUIT_Desktop.h>
51 #include <SUIT_MessageBox.h>
52 #include <SUIT_Session.h>
54 #include <LightApp_Application.h>
55 #include <LightApp_SelectionMgr.h>
57 #include <SVTK_ViewWindow.h>
60 #include <BRep_Tool.hxx>
61 #include <TopoDS_Vertex.hxx>
63 #include <TColStd_MapOfInteger.hxx>
66 #include <QButtonGroup>
70 #include <QPushButton>
71 #include <QToolButton>
72 #include <QRadioButton>
74 #include <QListWidget>
75 #include <QVBoxLayout>
76 #include <QHBoxLayout>
77 #include <QGridLayout>
81 #include <SALOMEconfig.h>
82 #include CORBA_SERVER_HEADER(SMESH_Group)
83 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
88 class SMESHGUI_ExtrusionAlongPathDlg::SetBusy
91 SetBusy( SMESHGUI_ExtrusionAlongPathDlg* _dlg )
99 myDlg->myBusy = false;
103 SMESHGUI_ExtrusionAlongPathDlg* myDlg;
106 //=================================================================================
107 // function : SMESHGUI_ExtrusionAlongPathDlg()
108 // purpose : constructor
109 //=================================================================================
110 SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
111 : QDialog( SMESH::GetDesktop( theModule ) ),
112 mySMESHGUI( theModule ),
113 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
116 SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
117 QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
118 QPixmap faceImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
119 QPixmap selectImage ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
120 QPixmap addImage ( mgr->loadPixmap("SMESH", tr("ICON_APPEND")));
121 QPixmap removeImage ( mgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
126 setAttribute( Qt::WA_DeleteOnClose, true );
127 setWindowTitle(tr("EXTRUSION_ALONG_PATH"));
128 setSizeGripEnabled(true);
130 QVBoxLayout* topLayout = new QVBoxLayout(this);
131 topLayout->setSpacing(SPACING);
132 topLayout->setMargin(MARGIN);
134 /***************************************************************/
135 // Elements type group box (1d / 2d elements)
136 ConstructorsBox = new QGroupBox(tr("SMESH_EXTRUSION"), this);
137 GroupConstructors = new QButtonGroup(this);
138 QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
139 ConstructorsBoxLayout->setSpacing(SPACING); ConstructorsBoxLayout->setMargin(MARGIN);
141 Elements1dRB = new QRadioButton(ConstructorsBox);
142 Elements1dRB->setIcon(edgeImage);
143 Elements2dRB = new QRadioButton(ConstructorsBox);
144 Elements2dRB->setIcon(faceImage);
145 Elements1dRB->setChecked(true);
148 ConstructorsBoxLayout->addWidget(Elements1dRB);
149 ConstructorsBoxLayout->addWidget(Elements2dRB);
150 GroupConstructors->addButton(Elements1dRB, 0);
151 GroupConstructors->addButton(Elements2dRB, 1);
153 /***************************************************************/
154 // Arguments group box
155 GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
156 QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
157 GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN);
159 myIdValidator = new SMESHGUI_IdValidator(this);
161 // Controls for elements selection
162 ElementsLab = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
164 SelectElementsButton = new QToolButton(GroupArguments);
165 SelectElementsButton->setIcon(selectImage);
167 ElementsLineEdit = new QLineEdit(GroupArguments);
168 ElementsLineEdit->setValidator(myIdValidator);
169 myFilterBtn = new QPushButton( tr( "SMESH_BUT_FILTER" ), GroupArguments );
170 connect(myFilterBtn, SIGNAL(clicked()), this, SLOT(setFilters()));
172 // Controls for the whole mesh selection
173 MeshCheck = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
175 // Controls for path selection
176 PathGrp = new QGroupBox(tr("SMESH_PATH"), GroupArguments);
177 QGridLayout* PathGrpLayout = new QGridLayout(PathGrp);
178 PathGrpLayout->setSpacing(SPACING); PathGrpLayout->setMargin(MARGIN);
180 // Controls for path mesh selection
181 QLabel* PathMeshLab = new QLabel(tr("SMESH_PATH_MESH"), PathGrp);
183 SelectPathMeshButton = new QToolButton(PathGrp);
184 SelectPathMeshButton->setIcon(selectImage);
186 PathMeshLineEdit = new QLineEdit(PathGrp);
187 PathMeshLineEdit->setReadOnly(true);
189 // Controls for path shape selection
190 QLabel* PathShapeLab = new QLabel(tr("SMESH_PATH_SHAPE"), PathGrp);
192 SelectPathShapeButton = new QToolButton(PathGrp);
193 SelectPathShapeButton->setIcon(selectImage);
195 PathShapeLineEdit = new QLineEdit(PathGrp);
196 PathShapeLineEdit->setReadOnly(true);
198 // Controls for path starting point selection
199 QLabel* StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
201 SelectStartPointButton = new QToolButton(PathGrp);
202 SelectStartPointButton->setIcon(selectImage);
204 StartPointLineEdit = new QLineEdit(PathGrp);
205 StartPointLineEdit->setValidator(new QIntValidator(this));
208 PathGrpLayout->addWidget(PathMeshLab, 0, 0);
209 PathGrpLayout->addWidget(SelectPathMeshButton, 0, 1);
210 PathGrpLayout->addWidget(PathMeshLineEdit, 0, 2);
211 PathGrpLayout->addWidget(PathShapeLab, 1, 0);
212 PathGrpLayout->addWidget(SelectPathShapeButton, 1, 1);
213 PathGrpLayout->addWidget(PathShapeLineEdit, 1, 2);
214 PathGrpLayout->addWidget(StartPointLab, 2, 0);
215 PathGrpLayout->addWidget(SelectStartPointButton, 2, 1);
216 PathGrpLayout->addWidget(StartPointLineEdit, 2, 2);
218 BasePointGrp = new QGroupBox(tr("SMESH_BASE_POINT"), GroupArguments);
219 BasePointGrp->setCheckable(true);
220 BasePointGrp->setChecked(false);
221 QHBoxLayout* BasePointGrpLayout = new QHBoxLayout(BasePointGrp);
222 BasePointGrpLayout->setSpacing(SPACING); BasePointGrpLayout->setMargin(MARGIN);
224 SelectBasePointButton = new QToolButton(BasePointGrp);
225 SelectBasePointButton->setIcon(selectImage);
227 QLabel* XLab = new QLabel(tr("SMESH_X"), BasePointGrp);
228 XSpin = new SMESHGUI_SpinBox(BasePointGrp);
229 QLabel* YLab = new QLabel(tr("SMESH_Y"), BasePointGrp);
230 YSpin = new SMESHGUI_SpinBox(BasePointGrp);
231 QLabel* ZLab = new QLabel(tr("SMESH_Z"), BasePointGrp);
232 ZSpin = new SMESHGUI_SpinBox(BasePointGrp);
235 BasePointGrpLayout->addWidget(SelectBasePointButton);
236 BasePointGrpLayout->addWidget(XLab);
237 BasePointGrpLayout->addWidget(XSpin);
238 BasePointGrpLayout->addWidget(YLab);
239 BasePointGrpLayout->addWidget(YSpin);
240 BasePointGrpLayout->addWidget(ZLab);
241 BasePointGrpLayout->addWidget(ZSpin);
243 AnglesGrp = new QGroupBox(tr("SMESH_ANGLES"), GroupArguments);
244 AnglesGrp->setCheckable(true);
245 AnglesGrp->setChecked(false);
246 QGridLayout* AnglesGrpLayout = new QGridLayout(AnglesGrp);
247 AnglesGrpLayout->setSpacing(SPACING); AnglesGrpLayout->setMargin(MARGIN);
249 AnglesList = new QListWidget(AnglesGrp);
250 AnglesList->setSelectionMode(QListWidget::ExtendedSelection);
252 AddAngleButton = new QToolButton(AnglesGrp);
253 AddAngleButton->setIcon(addImage);
255 RemoveAngleButton = new QToolButton(AnglesGrp);
256 RemoveAngleButton->setIcon(removeImage);
258 AngleSpin = new SMESHGUI_SpinBox(AnglesGrp);
260 LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp);
263 AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
264 AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
265 AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
266 AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
267 AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0);
268 AnglesGrpLayout->setRowMinimumHeight(1, 10);
269 AnglesGrpLayout->setRowStretch(3, 10);
271 // CheckBox for groups generation
272 MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
273 MakeGroupsCheck->setChecked(true);
276 GroupArgumentsLayout->addWidget(ElementsLab, 0, 0);
277 GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
278 GroupArgumentsLayout->addWidget(ElementsLineEdit, 0, 2);
279 GroupArgumentsLayout->addWidget(myFilterBtn, 0, 3);
280 GroupArgumentsLayout->addWidget(MeshCheck, 1, 0, 1, 4);
281 GroupArgumentsLayout->addWidget(PathGrp, 2, 0, 1, 4);
282 GroupArgumentsLayout->addWidget(BasePointGrp, 3, 0, 1, 4);
283 GroupArgumentsLayout->addWidget(AnglesGrp, 4, 0, 1, 4);
284 GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 4);
286 /***************************************************************/
287 // common buttons group box
288 GroupButtons = new QGroupBox(this);
289 QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
290 GroupButtonsLayout->setSpacing(SPACING); GroupButtonsLayout->setMargin(MARGIN);
292 OkButton = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
293 OkButton->setAutoDefault(true);
294 OkButton->setDefault(true);
296 ApplyButton = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
297 ApplyButton->setAutoDefault(true);
299 CloseButton = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
300 CloseButton->setAutoDefault(true);
302 HelpButton = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
303 HelpButton->setAutoDefault(true);
306 GroupButtonsLayout->addWidget(OkButton);
307 GroupButtonsLayout->addSpacing(10);
308 GroupButtonsLayout->addWidget(ApplyButton);
309 GroupButtonsLayout->addSpacing(10);
310 GroupButtonsLayout->addStretch();
311 GroupButtonsLayout->addWidget(CloseButton);
312 GroupButtonsLayout->addWidget(HelpButton);
314 /***************************************************************/
316 topLayout->addWidget(ConstructorsBox);
317 topLayout->addWidget(GroupArguments);
318 topLayout->addWidget(GroupButtons);
320 /***************************************************************/
322 XSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
323 YSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
324 ZSpin->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
325 AngleSpin->RangeStepAndValidator(-180.0, 180.0, 5.0, 3);
327 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
329 mySMESHGUI->SetActiveDialogBox(this);
331 // Costruction of the logical filter for the elements: mesh/sub-mesh/group
332 SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
333 SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
335 QList<SUIT_SelectionFilter*> aListOfFilters;
336 if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
337 if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
339 myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
340 myPathMeshFilter = new SMESH_TypeFilter (MESH);
342 myHelpFileName = "extrusion_along_path_page.html";
346 /***************************************************************/
347 // signals-slots connections
348 connect(OkButton, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
349 connect(CloseButton, SIGNAL(clicked()), this, SLOT(reject()));
350 connect(ApplyButton, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
351 connect(HelpButton, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
353 connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
354 connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
356 connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
358 connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
359 connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
360 connect(SelectPathShapeButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
361 connect(SelectStartPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
362 connect(SelectBasePointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
364 connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
365 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
366 connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
368 connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
369 SLOT(onTextChange(const QString&)));
370 connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
371 SLOT(onTextChange(const QString&)));
373 connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
375 AnglesList->installEventFilter(this);
376 ElementsLineEdit->installEventFilter(this);
377 StartPointLineEdit->installEventFilter(this);
378 XSpin->editor()->installEventFilter(this);
379 YSpin->editor()->installEventFilter(this);
380 ZSpin->editor()->installEventFilter(this);
383 //=================================================================================
384 // function : ~SMESHGUI_ExtrusionAlongPathDlg()
385 // purpose : destructor
386 //=================================================================================
387 SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
389 // no need to delete child widgets, Qt does it all for us
390 if ( myFilterDlg != 0 ) {
391 myFilterDlg->setParent( 0 );
396 //=================================================================================
398 // purpose : initialization
399 //=================================================================================
400 void SMESHGUI_ExtrusionAlongPathDlg::Init (bool ResetControls)
403 myEditCurrentArgument = 0;
405 myMesh = SMESH::SMESH_Mesh::_nil();
406 myIDSource = SMESH::SMESH_IDSource::_nil();
408 myPathMesh = SMESH::SMESH_Mesh::_nil();
409 myPathShape = GEOM::GEOM_Object::_nil();
411 ElementsLineEdit->clear();
412 PathMeshLineEdit->clear();
413 PathShapeLineEdit->clear();
414 StartPointLineEdit->clear();
417 XSpin->SetValue(0.0);
418 YSpin->SetValue(0.0);
419 ZSpin->SetValue(0.0);
421 AngleSpin->SetValue(45);
422 MeshCheck->setChecked(false);
423 ConstructorsClicked(0);
426 SetEditCurrentArgument(0);
429 //=================================================================================
430 // function : ConstructorsClicked()
431 // purpose : Called when user changes type of elements (1d / 2d)
432 //=================================================================================
433 void SMESHGUI_ExtrusionAlongPathDlg::ConstructorsClicked (int type)
435 if (myType == type) return;
437 disconnect(mySelectionMgr, 0, this, 0);
440 GroupArguments->setTitle(tr("EXTRUSION_1D"));
442 GroupArguments->setTitle(tr("EXTRUSION_2D"));
444 // clear elements ID list
445 if (!MeshCheck->isChecked()) {
446 ElementsLineEdit->clear();
448 // set selection mode if necessary
449 if (myEditCurrentArgument == ElementsLineEdit) {
450 mySelectionMgr->clearSelected();
451 mySelectionMgr->clearFilters();
452 SMESH::SetPickable();
454 SMESH::SetPointRepresentation(false);
455 if (MeshCheck->isChecked()) {
456 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
457 aViewWindow->SetSelectionMode(ActorSelection);
458 mySelectionMgr->installFilter(myElementsFilter);
462 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
463 aViewWindow->SetSelectionMode(EdgeSelection);
467 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
468 aViewWindow->SetSelectionMode(FaceSelection);
472 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
477 //=================================================================================
478 // function : ClickOnApply()
479 // purpose : Called when user presses <Apply> button
480 //=================================================================================
481 bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
483 if (mySMESHGUI->isActiveStudyLocked())
486 if (myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() ||
487 !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil())
493 SMESH::long_array_var anElementsId = new SMESH::long_array;
495 if (!MeshCheck->isChecked()) {
496 // If "Select whole mesh, submesh or group" check box is off ->
497 // use only elements of given type selected by user
499 SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh();
501 QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
502 anElementsId = new SMESH::long_array;
503 anElementsId->length(aListElementsId.count());
506 for (int i = 0; i < aListElementsId.count(); i++) {
507 long ind = aListElementsId[ i ].toLong(&bOk);
509 const SMDS_MeshElement* e = aMesh->FindElement(ind);
511 bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
512 Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
514 anElementsId[ j++ ] = ind;
518 anElementsId->length(j);
521 if (anElementsId->length() <= 0) {
526 if (StartPointLineEdit->text().trimmed().isEmpty()) {
531 long aNodeStart = StartPointLineEdit->text().toLong(&bOk);
536 QStringList aParameters;
539 SMESH::double_array_var anAngles = new SMESH::double_array;
540 if (AnglesGrp->isChecked()) {
541 anAngles->length(myAnglesList.count());
543 for (int i = 0; i < myAnglesList.count(); i++) {
544 double angle = myAnglesList[i];
545 anAngles[ j++ ] = angle*PI/180;
546 aParameters << AnglesList->item(i)->text();
552 SMESH::PointStruct aBasePoint;
553 if (BasePointGrp->isChecked()) {
554 aBasePoint.x = XSpin->GetValue();
555 aBasePoint.y = YSpin->GetValue();
556 aBasePoint.z = ZSpin->GetValue();
559 aParameters << XSpin->text();
560 aParameters << YSpin->text();
561 aParameters << ZSpin->text();
564 SUIT_OverrideCursor wc;
565 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
566 if ( LinearAnglesCheck->isChecked() )
567 anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
569 SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
570 if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
571 if( MeshCheck->isChecked() ) {
572 if( GetConstructorId() == 0 )
573 SMESH::ListOfGroups_var groups =
574 aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
575 myPathShape, aNodeStart,
576 AnglesGrp->isChecked(), anAngles,
577 BasePointGrp->isChecked(), aBasePoint, retVal);
579 SMESH::ListOfGroups_var groups =
580 aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
581 myPathShape, aNodeStart,
582 AnglesGrp->isChecked(), anAngles,
583 BasePointGrp->isChecked(), aBasePoint, retVal);
586 SMESH::ListOfGroups_var groups =
587 aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
588 myPathShape, aNodeStart,
589 AnglesGrp->isChecked(), anAngles,
590 BasePointGrp->isChecked(), aBasePoint, retVal);
593 if( MeshCheck->isChecked() ) {
594 if( GetConstructorId() == 0 )
595 retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
596 myPathShape, aNodeStart,
597 AnglesGrp->isChecked(), anAngles,
598 BasePointGrp->isChecked(), aBasePoint);
600 retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
601 myPathShape, aNodeStart,
602 AnglesGrp->isChecked(), anAngles,
603 BasePointGrp->isChecked(), aBasePoint);
606 retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
607 myPathShape, aNodeStart,
608 AnglesGrp->isChecked(), anAngles,
609 BasePointGrp->isChecked(), aBasePoint);
612 if( retVal == SMESH::SMESH_MeshEditor::EXTR_OK )
613 myMesh->SetParameters( SMESHGUI::JoinObjectParameters(aParameters) );
618 case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
619 SUIT_MessageBox::warning(this,
621 tr("NO_ELEMENTS_SELECTED"));
623 case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
624 SUIT_MessageBox::warning(this,
626 tr("SELECTED_PATH_IS_NOT_EDGE"));
628 case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
629 SUIT_MessageBox::warning(this,
631 tr("BAD_SHAPE_TYPE"));
633 case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
634 SUIT_MessageBox::warning(this,
636 tr("EXTR_BAD_STARTING_NODE"));
638 case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
639 SUIT_MessageBox::warning(this,
641 tr("WRONG_ANGLES_NUMBER"));
643 case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
644 SUIT_MessageBox::warning(this,
646 tr("CANT_GET_TANGENT"));
648 case SMESH::SMESH_MeshEditor::EXTR_OK:
655 //mySelectionMgr->clearSelected();
656 SMESH::Update( myMeshActor->getIO(), myMeshActor->GetVisibility() );
657 if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
658 mySMESHGUI->updateObjBrowser(true); // new groups may appear
659 //SMESH::UpdateView();
661 ConstructorsClicked(GetConstructorId());
665 //=================================================================================
666 // function : ClickOnOk()
667 // purpose : Called when user presses <OK> button
668 //=================================================================================
669 void SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
675 //=================================================================================
676 // function : ClickOnHelp()
678 //=================================================================================
679 void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
681 LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
683 app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
687 platform = "winapplication";
689 platform = "application";
691 SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
692 tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
693 arg(app->resourceMgr()->stringValue("ExternalBrowser",
695 arg(myHelpFileName));
699 //=================================================================================
700 // function : reject()
701 // purpose : Called when dialog box is closed
702 //=================================================================================
703 void SMESHGUI_ExtrusionAlongPathDlg::reject()
705 disconnect(mySelectionMgr, 0, this, 0);
706 mySelectionMgr->clearFilters();
707 //mySelectionMgr->clearSelected();
708 if (SMESH::GetCurrentVtkView()) {
709 SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
710 SMESH::SetPointRepresentation(false);
711 SMESH::SetPickable();
713 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
714 aViewWindow->SetSelectionMode(ActorSelection);
715 mySMESHGUI->ResetState();
719 //=======================================================================
720 // function : onTextChange()
722 //=======================================================================
723 void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText)
725 QLineEdit* send = (QLineEdit*)sender();
733 if (send != StartPointLineEdit && send != ElementsLineEdit)
734 send = ElementsLineEdit;
736 if (send == ElementsLineEdit && myEditCurrentArgument == ElementsLineEdit) {
737 // hilight entered elements
738 SMDS_Mesh* aMesh = 0;
740 aMesh = myMeshActor->GetObject()->GetMesh();
743 //mySelectionMgr->clearSelected();
744 //mySelectionMgr->AddIObject(myMeshActor->getIO());
746 aList.Append(myMeshActor->getIO());
747 mySelectionMgr->setSelectedObjects(aList, false);
749 QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
751 const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
752 TColStd_MapOfInteger newIndices;
753 for (int i = 0; i < aListId.count(); i++) {
754 long ind = aListId[ i ].toLong(&bOk);
756 const SMDS_MeshElement* e = aMesh->FindElement(ind);
758 // check also type of element
759 bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
760 Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
762 newIndices.Add(e->GetID());
766 mySelector->AddOrRemoveIndex(anIO, newIndices, false);
767 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
768 aViewWindow->highlight( anIO, true, true );
770 } else if (send == StartPointLineEdit &&
771 myEditCurrentArgument == StartPointLineEdit) {
772 if (!myPathMesh->_is_nil()) {
773 SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
774 SMDS_Mesh* aMesh = 0;
776 aMesh = aPathActor->GetObject()->GetMesh();
778 //mySelectionMgr->clearSelected();
779 //mySelectionMgr->AddIObject(aPathActor->getIO());
781 aList.Append(aPathActor->getIO());
782 mySelectionMgr->setSelectedObjects(aList, false);
785 long ind = theNewText.toLong(&bOk);
787 const SMDS_MeshNode* n = aMesh->FindNode(ind);
789 //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
790 TColStd_MapOfInteger newIndices;
791 newIndices.Add(n->GetID());
792 mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
793 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
794 aViewWindow->highlight( aPathActor->getIO(), true, true );
802 //=================================================================================
803 // function : SelectionIntoArgument()
804 // purpose : Called when selection as changed or other case
805 //=================================================================================
806 void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
810 // return if dialog box is inactive
811 if (!GroupButtons->isEnabled())
814 // selected objects count
815 const SALOME_ListIO& aList = mySelector->StoredIObjects();
816 int nbSel = aList.Extent();
823 if (myEditCurrentArgument == ElementsLineEdit) {
824 // we are now selecting mesh elements (or whole mesh/submesh/group)
826 ElementsLineEdit->clear();
827 myMesh = SMESH::SMESH_Mesh::_nil();
828 myIDSource = SMESH::SMESH_IDSource::_nil();
831 // try to get mesh from selection
832 Handle(SALOME_InteractiveObject) IO = aList.First();
833 myMesh = SMESH::GetMeshByIO(IO);
834 if (myMesh->_is_nil())
837 // MakeGroups is available if there are groups
838 if ( myMesh->NbGroups() == 0 ) {
839 MakeGroupsCheck->setChecked(false);
840 MakeGroupsCheck->setEnabled(false);
842 MakeGroupsCheck->setEnabled(true);
845 myMeshActor = SMESH::FindActorByObject(myMesh);
849 if (MeshCheck->isChecked()) {
850 // If "Select whole mesh, submesh or group" check box is on ->
851 // get ID source and put it's name to the edit box
853 SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
855 myIDSource = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
856 ElementsLineEdit->setText(aString);
858 // If "Select whole mesh, submesh or group" check box is off ->
859 // try to get selected elements IDs
861 //int aNbUnits = SMESH::GetNameOfSelectedElements(mySelectionMgr, aString);
862 SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
863 ElementsLineEdit->setText(aString);
865 } else if (myEditCurrentArgument == PathMeshLineEdit) {
866 // we are now selecting path mesh
868 PathMeshLineEdit->clear();
869 myPathMesh = SMESH::SMESH_Mesh::_nil();
870 PathShapeLineEdit->clear();
871 myPathShape = GEOM::GEOM_Object::_nil();
872 StartPointLineEdit->clear();
874 // try to get mesh from selection
875 Handle(SALOME_InteractiveObject) IO = aList.First();
876 myPathMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
877 if(myPathMesh->_is_nil())
881 SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
882 PathMeshLineEdit->setText(aString);
883 } else if (myEditCurrentArgument == PathShapeLineEdit) {
884 // we are now selecting path mesh
886 PathShapeLineEdit->clear();
887 myPathShape = GEOM::GEOM_Object::_nil();
888 StartPointLineEdit->clear();
890 // return if path mesh is not yet selected
891 if (myPathMesh->_is_nil())
894 // try to get shape from selection
895 Handle(SALOME_InteractiveObject) IO = aList.First();
896 myPathShape = SMESH::IObjectToInterface<GEOM::GEOM_Object>(IO);
897 if (myPathShape->_is_nil())
901 SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
902 PathShapeLineEdit->setText(aString);
903 } else if (myEditCurrentArgument == StartPointLineEdit) {
904 // we are now selecting start point of path
906 StartPointLineEdit->clear();
908 // return if path mesh or path shape is not yet selected
909 if (myPathMesh->_is_nil() || myPathShape->_is_nil())
912 // try to get shape from selection
913 Handle(SALOME_InteractiveObject) IO = aList.First();
915 SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
920 int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aPathActor->getIO(), aString);
922 StartPointLineEdit->setText(aString.trimmed());
924 } else if (myEditCurrentArgument == XSpin) {
925 // we are now selecting base point
926 // reset is not performed here!
928 // return if is not enabled
929 if (!BasePointGrp->isChecked())
932 // try to get shape from selection
933 Handle(SALOME_InteractiveObject) IO = aList.First();
935 // check if geom vertex is selected
936 GEOM::GEOM_Object_var aGeomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>(IO);
937 TopoDS_Vertex aVertex;
938 if (!aGeomObj->_is_nil()) {
939 if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
940 gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
941 XSpin->SetValue(aPnt.X());
942 YSpin->SetValue(aPnt.Y());
943 ZSpin->SetValue(aPnt.Z());
948 // check if smesh node is selected
949 SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(IO);
950 if (aMesh->_is_nil())
954 int aNbUnits = SMESH::GetNameOfSelectedNodes(mySelector, myMeshActor->getIO(), aString);
955 // return if more than one node is selected
959 SMESH_Actor* aMeshActor = SMESH::FindActorByObject(aMesh);
963 SMDS_Mesh* mesh = aMeshActor->GetObject()->GetMesh();
967 const SMDS_MeshNode* n = mesh->FindNode(aString.toLong());
971 XSpin->SetValue(n->X());
972 YSpin->SetValue(n->Y());
973 ZSpin->SetValue(n->Z());
977 //=================================================================================
978 // function : SetEditCurrentArgument()
980 //=================================================================================
981 void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
983 QToolButton* send = (QToolButton*)sender();
984 if (send != SelectElementsButton &&
985 send != SelectPathMeshButton &&
986 send != SelectPathShapeButton &&
987 send != SelectStartPointButton &&
988 send != SelectBasePointButton)
990 SetEditCurrentArgument(send);
993 //=================================================================================
994 // function : SetEditCurrentArgument()
996 //=================================================================================
997 void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument (QToolButton* button)
999 disconnect(mySelectionMgr, 0, this, 0);
1000 mySelectionMgr->clearSelected();
1001 mySelectionMgr->clearFilters();
1002 SMESH::SetPickable();
1004 if (button == SelectElementsButton) {
1005 myEditCurrentArgument = ElementsLineEdit;
1006 SMESH::SetPointRepresentation(false);
1007 if (MeshCheck->isChecked()) {
1008 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1009 aViewWindow->SetSelectionMode(ActorSelection);
1010 mySelectionMgr->installFilter(myElementsFilter);
1012 if (Elements1dRB->isChecked())
1014 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1015 aViewWindow->SetSelectionMode(EdgeSelection);
1017 else if (Elements2dRB->isChecked())
1019 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1020 aViewWindow->SetSelectionMode(FaceSelection);
1023 } else if (button == SelectPathMeshButton) {
1024 myEditCurrentArgument = PathMeshLineEdit;
1025 SMESH::SetPointRepresentation(false);
1026 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1027 aViewWindow->SetSelectionMode(ActorSelection);
1028 mySelectionMgr->installFilter(myPathMeshFilter);
1030 else if (button == SelectPathShapeButton) {
1031 myEditCurrentArgument = PathShapeLineEdit;
1032 SMESH::SetPointRepresentation(false);
1033 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1034 aViewWindow->SetSelectionMode(ActorSelection);
1036 if (!myPathMesh->_is_nil()) {
1037 GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
1038 SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
1040 if (!aMainShape->_is_nil() && aPathActor)
1041 mySelectionMgr->installFilter(new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE, -1,
1042 TopAbs_EDGE, aMainShape));
1043 //SMESH::SetPickable(aPathActor);
1046 else if (button == SelectStartPointButton) {
1047 myEditCurrentArgument = StartPointLineEdit;
1048 if (!myPathMesh->_is_nil()) {
1049 SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPathMesh);
1051 SMESH::SetPointRepresentation(true);
1052 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1053 aViewWindow->SetSelectionMode(NodeSelection);
1054 SMESH::SetPickable(aPathActor);
1058 else if (button == SelectBasePointButton) {
1059 myEditCurrentArgument = XSpin;
1060 SMESH::SetPointRepresentation(true);
1061 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
1062 aViewWindow->SetSelectionMode(NodeSelection);
1064 SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter(MESHorSUBMESH);
1065 SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(GROUP);
1066 SMESH_NumberFilter* aVertexFilter = new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE,
1068 QList<SUIT_SelectionFilter*> aListOfFilters;
1069 if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
1070 if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
1071 if (aVertexFilter) aListOfFilters.append(aVertexFilter);
1073 mySelectionMgr->installFilter(new SMESH_LogicalFilter
1074 (aListOfFilters, SMESH_LogicalFilter::LO_OR));
1077 if (myEditCurrentArgument && !myEditCurrentArgument->hasFocus())
1078 myEditCurrentArgument->setFocus();
1080 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
1081 SelectionIntoArgument();
1084 //=================================================================================
1085 // function : DeactivateActiveDialog()
1086 // purpose : Deactivates this dialog
1087 //=================================================================================
1088 void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
1090 if (ConstructorsBox->isEnabled()) {
1091 ConstructorsBox->setEnabled(false);
1092 GroupArguments->setEnabled(false);
1093 GroupButtons->setEnabled(false);
1094 mySMESHGUI->ResetState();
1095 mySMESHGUI->SetActiveDialogBox(0);
1099 //=================================================================================
1100 // function : ActivateThisDialog()
1101 // purpose : Activates this dialog
1102 //=================================================================================
1103 void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
1105 // Emit a signal to deactivate the active dialog
1106 mySMESHGUI->EmitSignalDeactivateDialog();
1107 ConstructorsBox->setEnabled(true);
1108 GroupArguments->setEnabled(true);
1109 GroupButtons->setEnabled(true);
1111 mySMESHGUI->SetActiveDialogBox(this);
1113 ConstructorsClicked(GetConstructorId());
1114 SelectionIntoArgument();
1117 //=================================================================================
1118 // function : enterEvent()
1119 // purpose : Mouse enter event
1120 //=================================================================================
1121 void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
1123 if (!ConstructorsBox->isEnabled())
1124 ActivateThisDialog();
1127 //=======================================================================
1128 // function : onSelectMesh()
1130 //=======================================================================
1131 void SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh()
1133 bool toSelectMesh = MeshCheck->isChecked();
1135 ElementsLineEdit->setReadOnly(toSelectMesh);
1136 ElementsLineEdit->setValidator(toSelectMesh ? 0 : myIdValidator);
1137 ElementsLab->setText(toSelectMesh ? tr("SMESH_NAME") : tr("SMESH_ID_ELEMENTS"));
1138 ElementsLineEdit->clear();
1139 myFilterBtn->setEnabled(!toSelectMesh);
1141 SetEditCurrentArgument(SelectElementsButton);
1144 //=================================================================================
1145 // function : GetConstructorId()
1147 //=================================================================================
1148 int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
1150 return GroupConstructors->checkedId();
1153 //=======================================================================
1154 // function : OnAngleAdded()
1155 // purpose : Called when user adds angle to the list
1156 //=======================================================================
1157 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
1160 if( !AngleSpin->isValid( msg, true ) ) {
1161 QString str( tr( "SMESH_INCORRECT_INPUT" ) );
1162 if ( !msg.isEmpty() )
1164 SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
1167 AnglesList->addItem(AngleSpin->text());
1168 myAnglesList.append(AngleSpin->GetValue());
1170 updateLinearAngles();
1173 //=======================================================================
1174 // function : OnAngleRemoved()
1175 // purpose : Called when user removes angle(s) from the list
1176 //=======================================================================
1177 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
1179 QList<QListWidgetItem*> aList = AnglesList->selectedItems();
1180 QListWidgetItem* anItem;
1181 foreach(anItem, aList) {
1182 myAnglesList.removeAt(AnglesList->row(anItem));
1186 updateLinearAngles();
1189 //=================================================================================
1190 // function : eventFilter()
1191 // purpose : event filter ???
1192 //=================================================================================
1193 bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter (QObject* object, QEvent* event)
1195 if (event->type() == QEvent::KeyPress) {
1196 QKeyEvent* ke = (QKeyEvent*)event;
1197 if (object == AnglesList) {
1198 if (ke->key() == Qt::Key_Delete)
1202 else if (event->type() == QEvent::FocusIn) {
1203 if (object == ElementsLineEdit) {
1204 if (myEditCurrentArgument != ElementsLineEdit)
1205 SetEditCurrentArgument(SelectElementsButton);
1207 else if (object == StartPointLineEdit) {
1208 if (myEditCurrentArgument != StartPointLineEdit)
1209 SetEditCurrentArgument(SelectStartPointButton);
1211 else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
1212 if (myEditCurrentArgument != XSpin)
1213 SetEditCurrentArgument(SelectBasePointButton);
1216 return QDialog::eventFilter(object, event);
1219 //=================================================================================
1220 // function : keyPressEvent()
1222 //=================================================================================
1223 void SMESHGUI_ExtrusionAlongPathDlg::keyPressEvent( QKeyEvent* e )
1225 QDialog::keyPressEvent( e );
1226 if ( e->isAccepted() )
1229 if ( e->key() == Qt::Key_F1 ) {
1235 //=================================================================================
1236 // function : setFilters()
1237 // purpose : SLOT. Called when "Filter" button pressed.
1238 //=================================================================================
1239 void SMESHGUI_ExtrusionAlongPathDlg::setFilters()
1241 if(myMesh->_is_nil()) {
1242 SUIT_MessageBox::critical(this,
1244 tr("NO_MESH_SELECTED"));
1250 types.append( SMESH::EDGE );
1251 types.append( SMESH::FACE );
1252 myFilterDlg = new SMESHGUI_FilterDlg( mySMESHGUI, types );
1254 myFilterDlg->Init( Elements1dRB->isChecked() ? SMESH::EDGE : SMESH::FACE );
1256 myFilterDlg->SetSelection();
1257 myFilterDlg->SetMesh( myMesh );
1258 myFilterDlg->SetSourceWg( ElementsLineEdit );
1260 myFilterDlg->show();
1263 //=================================================================================
1264 // function : isValid
1266 //=================================================================================
1267 bool SMESHGUI_ExtrusionAlongPathDlg::isValid()
1271 ok = XSpin->isValid( msg, true ) && ok;
1272 ok = YSpin->isValid( msg, true ) && ok;
1273 ok = ZSpin->isValid( msg, true ) && ok;
1276 QString str( tr( "SMESH_INCORRECT_INPUT" ) );
1277 if ( !msg.isEmpty() )
1279 SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
1285 //=================================================================================
1286 // function : updateLinearAngles
1288 //=================================================================================
1289 void SMESHGUI_ExtrusionAlongPathDlg::updateLinearAngles()
1291 bool enableLinear = true;
1292 for( int row = 0, nbRows = AnglesList->count(); row < nbRows; row++ ) {
1293 if( QListWidgetItem* anItem = AnglesList->item( row ) ) {
1294 enableLinear = false;
1295 anItem->text().toDouble(&enableLinear);
1301 LinearAnglesCheck->setChecked( false );
1302 LinearAnglesCheck->setEnabled( enableLinear );