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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHGUI_ExtrusionAlongPathDlg.cxx
25 // Author : Vadim SANDLER
29 #include "SMESHGUI_ExtrusionAlongPathDlg.h"
31 #include "SMESHGUI_SpinBox.h"
32 #include "SMESHGUI_Utils.h"
33 #include "SMESHGUI_VTKUtils.h"
34 #include "SMESHGUI_MeshUtils.h"
35 #include "SMESHGUI_IdValidator.h"
36 #include "SMESH_Actor.h"
37 #include "SMESH_NumberFilter.hxx"
38 #include "SMDS_Mesh.hxx"
39 #include "GEOM_ShapeTypeFilter.hxx"
42 #include "QAD_Application.h"
43 #include "QAD_WaitCursor.h"
44 #include "QAD_Desktop.h"
45 #include "QAD_MessageBox.h"
46 #include "utilities.h"
48 #include <BRep_Tool.hxx>
49 #include <TopoDS_Shape.hxx>
51 #include <TopoDS_Vertex.hxx>
55 #include <qapplication.h>
56 #include <qbuttongroup.h>
57 #include <qgroupbox.h>
59 #include <qlineedit.h>
60 #include <qpushbutton.h>
61 #include <qtoolbutton.h>
62 #include <qradiobutton.h>
63 #include <qcheckbox.h>
66 #include <qvalidator.h>
70 #include "SALOMEconfig.h"
71 #include CORBA_SERVER_HEADER(SMESH_Group)
75 //=================================================================================
76 // function : SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg()
77 // purpose : constructor
78 //=================================================================================
79 SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( QWidget* parent, SALOME_Selection* Sel, bool modal )
80 : QDialog( parent, "SMESHGUI_ExtrusionAlongPathDlg", modal,
81 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose )
83 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg");
85 QPixmap edgeImage ( QAD_Desktop::getResourceManager()->loadPixmap( "SMESH", tr( "ICON_DLG_EDGE" ) ) );
86 QPixmap faceImage ( QAD_Desktop::getResourceManager()->loadPixmap( "SMESH", tr( "ICON_DLG_TRIANGLE" ) ) );
87 QPixmap selectImage( QAD_Desktop::getResourceManager()->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
88 QPixmap addImage ( QAD_Desktop::getResourceManager()->loadPixmap( "SMESH", tr( "ICON_APPEND" ) ) );
89 QPixmap removeImage( QAD_Desktop::getResourceManager()->loadPixmap( "SMESH", tr( "ICON_REMOVE" ) ) );
91 setCaption( tr( "EXTRUSION_ALONG_PATH" ) );
92 setSizeGripEnabled( TRUE );
94 QGridLayout* topLayout = new QGridLayout( this );
95 topLayout->setSpacing( 6 ); topLayout->setMargin( 11 );
97 /***************************************************************/
98 // Elements type group box (1d / 2d elements)
99 ElementsTypeGrp = new QButtonGroup( tr( "SMESH_EXTRUSION" ), this );
100 ElementsTypeGrp->setColumnLayout( 0, Qt::Vertical );
101 ElementsTypeGrp->layout()->setSpacing( 0 ); ElementsTypeGrp->layout()->setMargin( 0 );
102 QGridLayout* ElementsTypeGrpLayout = new QGridLayout( ElementsTypeGrp->layout() );
103 ElementsTypeGrpLayout->setAlignment( Qt::AlignTop );
104 ElementsTypeGrpLayout->setSpacing( 6 ); ElementsTypeGrpLayout->setMargin( 11 );
106 Elements1dRB = new QRadioButton( ElementsTypeGrp );
107 Elements1dRB->setPixmap( edgeImage );
108 Elements2dRB = new QRadioButton( ElementsTypeGrp );
109 Elements2dRB->setPixmap( faceImage );
110 Elements1dRB->setChecked( true );
113 ElementsTypeGrpLayout->addWidget( Elements1dRB, 0, 0 );
114 ElementsTypeGrpLayout->addWidget( Elements2dRB, 0, 2 );
116 /***************************************************************/
117 // Arguments group box
118 ArgumentsGrp = new QGroupBox( tr( "EXTRUSION_1D" ), this );
119 ArgumentsGrp->setColumnLayout( 0, Qt::Vertical );
120 ArgumentsGrp->layout()->setSpacing( 0 ); ArgumentsGrp->layout()->setMargin( 0 );
121 QGridLayout* ArgumentsGrpLayout = new QGridLayout( ArgumentsGrp->layout() );
122 ArgumentsGrpLayout->setAlignment( Qt::AlignTop );
123 ArgumentsGrpLayout->setSpacing( 6 ); ArgumentsGrpLayout->setMargin( 11 );
125 // Controls for elements selection
126 ElementsLab = new QLabel( tr( "SMESH_ID_ELEMENTS" ), ArgumentsGrp );
128 SelectElementsButton = new QToolButton( ArgumentsGrp );
129 SelectElementsButton->setPixmap( selectImage );
131 ElementsLineEdit = new QLineEdit( ArgumentsGrp );
132 ElementsLineEdit->setValidator( new SMESHGUI_IdValidator( this ) );
134 // Controls for the whole mesh selection
135 MeshCheck = new QCheckBox( tr( "SMESH_SELECT_WHOLE_MESH" ), ArgumentsGrp );
137 // Controls for path selection
138 PathGrp = new QGroupBox( tr( "SMESH_PATH" ), ArgumentsGrp );
139 PathGrp->setColumnLayout( 0, Qt::Vertical );
140 PathGrp->layout()->setSpacing( 0 ); PathGrp->layout()->setMargin( 0 );
141 QGridLayout* PathGrpLayout = new QGridLayout( PathGrp->layout() );
142 PathGrpLayout->setAlignment( Qt::AlignTop );
143 PathGrpLayout->setSpacing( 6 ); PathGrpLayout->setMargin( 11 );
145 // Controls for path mesh selection
146 PathMeshLab = new QLabel( tr( "SMESH_PATH_MESH" ), PathGrp );
148 SelectPathMeshButton = new QToolButton( PathGrp );
149 SelectPathMeshButton->setPixmap( selectImage );
151 PathMeshLineEdit = new QLineEdit( PathGrp );
152 PathMeshLineEdit->setReadOnly( true );
154 // Controls for path shape selection
155 PathShapeLab = new QLabel( tr( "SMESH_PATH_SHAPE" ), PathGrp );
157 SelectPathShapeButton = new QToolButton( PathGrp );
158 SelectPathShapeButton->setPixmap( selectImage );
160 PathShapeLineEdit = new QLineEdit( PathGrp );
161 PathShapeLineEdit->setReadOnly( true );
163 // Controls for path starting point selection
164 StartPointLab = new QLabel( tr( "SMESH_PATH_START" ), PathGrp );
166 SelectStartPointButton = new QToolButton( PathGrp );
167 SelectStartPointButton->setPixmap( selectImage );
169 StartPointLineEdit = new QLineEdit( PathGrp );
170 StartPointLineEdit->setValidator( new QIntValidator( this ) );
173 PathGrpLayout->addWidget( PathMeshLab, 0, 0 );
174 PathGrpLayout->addWidget( SelectPathMeshButton, 0, 1 );
175 PathGrpLayout->addWidget( PathMeshLineEdit, 0, 2 );
176 PathGrpLayout->addWidget( PathShapeLab, 1, 0 );
177 PathGrpLayout->addWidget( SelectPathShapeButton, 1, 1 );
178 PathGrpLayout->addWidget( PathShapeLineEdit, 1, 2 );
179 PathGrpLayout->addWidget( StartPointLab, 2, 0 );
180 PathGrpLayout->addWidget( SelectStartPointButton, 2, 1 );
181 PathGrpLayout->addWidget( StartPointLineEdit, 2, 2 );
183 // Controls for base point defining
184 BasePointCheck = new QCheckBox( tr( "SMESH_USE_BASE_POINT" ), ArgumentsGrp );
186 BasePointGrp = new QGroupBox( tr( "SMESH_BASE_POINT" ), ArgumentsGrp );
187 BasePointGrp->setColumnLayout( 0, Qt::Vertical );
188 BasePointGrp->layout()->setSpacing( 0 ); BasePointGrp->layout()->setMargin( 0 );
189 QGridLayout* BasePointGrpLayout = new QGridLayout( BasePointGrp->layout() );
190 BasePointGrpLayout->setAlignment( Qt::AlignTop );
191 BasePointGrpLayout->setSpacing( 6 ); BasePointGrpLayout->setMargin( 11 );
193 SelectBasePointButton = new QToolButton( BasePointGrp );
194 SelectBasePointButton->setPixmap( selectImage );
196 XLab = new QLabel( tr( "SMESH_X" ), BasePointGrp );
197 XSpin = new SMESHGUI_SpinBox( BasePointGrp );
198 YLab = new QLabel( tr( "SMESH_Y" ), BasePointGrp );
199 YSpin = new SMESHGUI_SpinBox( BasePointGrp );
200 ZLab = new QLabel( tr( "SMESH_Z" ), BasePointGrp );
201 ZSpin = new SMESHGUI_SpinBox( BasePointGrp );
204 BasePointGrpLayout->addWidget( SelectBasePointButton, 0, 0 );
205 BasePointGrpLayout->addWidget( XLab, 0, 1 );
206 BasePointGrpLayout->addWidget( XSpin, 0, 2 );
207 BasePointGrpLayout->addWidget( YLab, 0, 3 );
208 BasePointGrpLayout->addWidget( YSpin, 0, 4 );
209 BasePointGrpLayout->addWidget( ZLab, 0, 5 );
210 BasePointGrpLayout->addWidget( ZSpin, 0, 6 );
212 // Controls for angles defining
213 AnglesCheck = new QCheckBox( tr( "SMESH_USE_ANGLES" ), ArgumentsGrp );
215 AnglesGrp = new QGroupBox( tr( "SMESH_ANGLES" ), ArgumentsGrp );
216 AnglesGrp->setColumnLayout( 0, Qt::Vertical );
217 AnglesGrp->layout()->setSpacing( 0 ); AnglesGrp->layout()->setMargin( 0 );
218 QGridLayout* AnglesGrpLayout = new QGridLayout( AnglesGrp->layout() );
219 AnglesGrpLayout->setAlignment( Qt::AlignTop );
220 AnglesGrpLayout->setSpacing( 6 ); AnglesGrpLayout->setMargin( 11 );
222 AnglesList = new QListBox( AnglesGrp );
223 AnglesList->setSelectionMode( QListBox::Extended );
225 AddAngleButton = new QToolButton( AnglesGrp );
226 AddAngleButton->setPixmap( addImage );
228 RemoveAngleButton = new QToolButton( AnglesGrp );
229 RemoveAngleButton->setPixmap( removeImage );
231 AngleSpin = new SMESHGUI_SpinBox( AnglesGrp );
234 QVBoxLayout* bLayout = new QVBoxLayout();
235 bLayout->addWidget( AddAngleButton );
236 bLayout->addSpacing( 6 );
237 bLayout->addWidget( RemoveAngleButton );
238 bLayout->addStretch();
239 AnglesGrpLayout->addMultiCellWidget( AnglesList, 0, 1, 0, 0 );
240 AnglesGrpLayout->addMultiCellLayout( bLayout, 0, 1, 1, 1 );
241 AnglesGrpLayout->addWidget( AngleSpin, 0, 2 );
242 AnglesGrpLayout->setRowStretch( 1, 10 );
245 ArgumentsGrpLayout->addWidget( ElementsLab, 0, 0 );
246 ArgumentsGrpLayout->addWidget( SelectElementsButton, 0, 1 );
247 ArgumentsGrpLayout->addWidget( ElementsLineEdit, 0, 2 );
248 ArgumentsGrpLayout->addMultiCellWidget( MeshCheck, 1, 1, 0, 2 );
249 ArgumentsGrpLayout->addMultiCellWidget( PathGrp, 2, 2, 0, 2 );
250 ArgumentsGrpLayout->addWidget( BasePointCheck, 3, 0 );
251 ArgumentsGrpLayout->addMultiCellWidget( BasePointGrp, 3, 4, 1, 2 );
252 ArgumentsGrpLayout->addWidget( AnglesCheck, 5, 0 );
253 ArgumentsGrpLayout->addMultiCellWidget( AnglesGrp, 5, 6, 1, 2 );
254 ArgumentsGrpLayout->setRowStretch( 6, 10 );
256 /***************************************************************/
257 // common buttons group box
258 ButtonsGrp = new QGroupBox( this );
259 ButtonsGrp->setColumnLayout( 0, Qt::Vertical );
260 ButtonsGrp->layout()->setSpacing( 0 ); ButtonsGrp->layout()->setMargin( 0 );
261 QGridLayout* ButtonsGrpLayout = new QGridLayout( ButtonsGrp->layout() );
262 ButtonsGrpLayout->setAlignment( Qt::AlignTop );
263 ButtonsGrpLayout->setSpacing( 6 ); ButtonsGrpLayout->setMargin( 11 );
265 OkButton = new QPushButton( tr( "SMESH_BUT_OK" ), ButtonsGrp );
266 OkButton->setAutoDefault( true );
267 OkButton->setDefault( true );
269 ApplyButton = new QPushButton( tr( "SMESH_BUT_APPLY" ), ButtonsGrp );
270 ApplyButton->setAutoDefault( true );
272 CloseButton = new QPushButton( tr( "SMESH_BUT_CLOSE" ), ButtonsGrp );
273 CloseButton->setAutoDefault( true );
276 ButtonsGrpLayout->addWidget( OkButton, 0, 0 );
277 ButtonsGrpLayout->addWidget( ApplyButton, 0, 1 );
278 ButtonsGrpLayout->addWidget( CloseButton, 0, 3 );
279 ButtonsGrpLayout->addColSpacing( 2, 10 );
280 ButtonsGrpLayout->setColStretch( 2, 10 );
282 /***************************************************************/
284 topLayout->addWidget( ElementsTypeGrp, 0, 0 );
285 topLayout->addWidget( ArgumentsGrp, 1, 0 );
286 topLayout->addWidget( ButtonsGrp, 2, 0 );
288 /***************************************************************/
290 XSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
291 YSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
292 ZSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 );
293 AngleSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 5.0, 3 );
294 //?? AngleSpin->RangeStepAndValidator( -360., +360., 5.0, 3 );
297 mySMESHGUI = SMESHGUI::GetSMESHGUI() ;
298 mySMESHGUI->SetActiveDialogBox( this ) ;
300 // Costruction of the logical filter for the elements: mesh/sub-mesh/group
301 SMESH_ListOfFilter aListOfFilters;
302 Handle(SMESH_TypeFilter) aMeshOrSubMeshFilter = new SMESH_TypeFilter( MESHorSUBMESH );
303 if ( !aMeshOrSubMeshFilter.IsNull() )
304 aListOfFilters.Append( aMeshOrSubMeshFilter );
305 Handle(SMESH_TypeFilter) aSmeshGroupFilter = new SMESH_TypeFilter( GROUP );
306 if ( !aSmeshGroupFilter.IsNull() )
307 aListOfFilters.Append( aSmeshGroupFilter );
309 myElementsFilter = new SMESH_LogicalFilter( aListOfFilters, SMESH_LogicalFilter::LO_OR );
311 myPathMeshFilter = new SMESH_TypeFilter( MESH );
315 /***************************************************************/
316 // signals-slots connections
317 connect( OkButton, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
318 connect( CloseButton, SIGNAL( clicked() ), this, SLOT( reject() ) ) ;
319 connect( ApplyButton, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
321 connect( AddAngleButton, SIGNAL( clicked() ), this, SLOT( OnAngleAdded() ) );
322 connect( RemoveAngleButton, SIGNAL( clicked() ), this, SLOT( OnAngleRemoved() ) );
324 connect( ElementsTypeGrp, SIGNAL( clicked( int ) ), SLOT( TypeChanged( int ) ) );
326 connect( SelectElementsButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
327 connect( SelectPathMeshButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
328 connect( SelectPathShapeButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
329 connect( SelectStartPointButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
330 connect( SelectBasePointButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
332 connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
333 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
334 connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) ) ;
336 connect( ElementsLineEdit, SIGNAL( textChanged( const QString& ) ),
337 SLOT( onTextChange( const QString& ) ) );
338 connect( StartPointLineEdit, SIGNAL( textChanged( const QString& ) ),
339 SLOT( onTextChange( const QString& ) ) );
341 connect( MeshCheck, SIGNAL( toggled( bool ) ), SLOT( onSelectMesh() ) );
342 connect( AnglesCheck, SIGNAL( toggled( bool ) ), SLOT( onAnglesCheck() ) );
343 connect( BasePointCheck, SIGNAL( toggled( bool ) ), SLOT( onBasePointCheck() ) );
345 AnglesList->installEventFilter( this );
346 ElementsLineEdit->installEventFilter( this );
347 StartPointLineEdit->installEventFilter( this );
348 XSpin->editor()->installEventFilter( this );
349 YSpin->editor()->installEventFilter( this );
350 ZSpin->editor()->installEventFilter( this );
352 /***************************************************************/
353 // set position and show dialog box
355 mySMESHGUI->DefineDlgPosition( this, x, y ) ;
357 this->show() ; // displays Dialog
360 //=================================================================================
361 // function : SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
362 // purpose : destructor
363 //=================================================================================
364 SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
366 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg");
367 // no need to delete child widgets, Qt does it all for us
370 //=================================================================================
371 // function : SMESHGUI_ExtrusionAlongPathDlg::eventFilter
372 // purpose : event filter
373 //=================================================================================
374 bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter( QObject* object, QEvent* event )
376 if ( event->type() == QEvent::KeyPress ) {
377 QKeyEvent* ke = ( QKeyEvent* )event;
378 if ( object == AnglesList ) {
379 if ( ke->key() == Key_Delete )
383 else if ( event->type() == QEvent::FocusIn ) {
384 if ( object == ElementsLineEdit ) {
385 if ( myEditCurrentArgument != ElementsLineEdit )
386 SetEditCurrentArgument( SelectElementsButton );
388 else if ( object == StartPointLineEdit ) {
389 if ( myEditCurrentArgument != StartPointLineEdit )
390 SetEditCurrentArgument( SelectStartPointButton );
392 else if ( object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor() ) {
393 if ( myEditCurrentArgument != XSpin )
394 SetEditCurrentArgument( SelectBasePointButton );
397 return QDialog::eventFilter( object, event );
400 //=================================================================================
401 // function : SMESHGUI_ExtrusionAlongPathDlg::Init()
402 // purpose : initialization
403 //=================================================================================
404 void SMESHGUI_ExtrusionAlongPathDlg::Init( bool ResetControls )
406 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::Init");
408 myEditCurrentArgument = 0;
410 myMesh = SMESH::SMESH_Mesh::_nil();
411 myIDSource = SMESH::SMESH_IDSource::_nil();
413 myPathMesh = SMESH::SMESH_Mesh::_nil();
414 myPathShape = GEOM::GEOM_Object::_nil();
416 ElementsLineEdit->clear();
417 PathMeshLineEdit->clear();
418 PathShapeLineEdit->clear();
419 StartPointLineEdit->clear();
421 if( ResetControls ) {
422 XSpin->SetValue( 0.0 );
423 YSpin->SetValue( 0.0 );
424 ZSpin->SetValue( 0.0 );
426 AngleSpin->SetValue( 45 );
427 MeshCheck->setChecked( false );
433 SetEditCurrentArgument( 0 );
436 //=================================================================================
437 // function : SMESHGUI_ExtrusionAlongPathDlg::TypeChanged()
438 // purpose : Called when user changes type of elements ( 1d / 2d )
439 //=================================================================================
440 void SMESHGUI_ExtrusionAlongPathDlg::TypeChanged( int type )
442 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::TypeChanged");
443 if ( myType != type ) {
444 disconnect( mySelection, 0, this, 0 );
447 ArgumentsGrp->setTitle( tr( "EXTRUSION_1D" ) );
448 else if ( type == 1 )
449 ArgumentsGrp->setTitle( tr( "EXTRUSION_2D" ) );
451 // clear elements ID list
452 if ( !MeshCheck->isChecked() ) {
453 ElementsLineEdit->clear();
455 // set selection mode if necessary
456 if( myEditCurrentArgument == ElementsLineEdit ) {
457 mySelection->ClearIObjects();
458 mySelection->ClearFilters();
459 SMESH::SetPickable();
461 SMESH::SetPointRepresentation( false );
462 if ( MeshCheck->isChecked() ) {
463 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
464 mySelection->AddFilter( myElementsFilter );
468 QAD_Application::getDesktop()->SetSelectionMode( EdgeSelection, true );
470 QAD_Application::getDesktop()->SetSelectionMode( FaceSelection, true );
473 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
479 //=================================================================================
480 // function : SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
481 // purpose : Called when user presses <Apply> button
482 //=================================================================================
483 bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
485 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply");
486 if ( mySMESHGUI->ActiveStudyLocked() ) {
490 if( myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() || !myMeshActor || myPathMesh->_is_nil() || myPathShape->_is_nil() ) {
494 SMESH::long_array_var anElementsId = new SMESH::long_array;
496 if ( MeshCheck->isChecked() ) {
497 // If "Select whole mesh, submesh or group" check box is on ->
498 // get all elements of the required type from the object selected
500 // if MESH object is selected
501 if ( !CORBA::is_nil( SMESH::SMESH_Mesh::_narrow( myIDSource ) ) ) {
503 SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( myIDSource );
504 // get IDs from mesh...
505 if ( Elements1dRB->isChecked() )
507 anElementsId = aMesh->GetElementsByType( SMESH::EDGE );
508 else if ( Elements2dRB->isChecked() ) {
509 anElementsId = aMesh->GetElementsByType( SMESH::FACE );
512 // SUBMESH is selected
513 if ( !CORBA::is_nil( SMESH::SMESH_subMesh::_narrow( myIDSource ) ) ) {
515 SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( myIDSource );
516 // get IDs from submesh
517 if ( Elements1dRB->isChecked() )
519 anElementsId = aSubMesh->GetElementsByType( SMESH::EDGE );
520 else if ( Elements2dRB->isChecked() )
522 anElementsId = aSubMesh->GetElementsByType( SMESH::FACE );
525 if ( !CORBA::is_nil( SMESH::SMESH_GroupBase::_narrow( myIDSource ) ) ) {
527 SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( myIDSource );
528 // get IDs from group
529 // 1d elements or 2d elements
530 if ( Elements1dRB->isChecked() && aGroup->GetType() == SMESH::EDGE ||
531 Elements2dRB->isChecked() && aGroup->GetType() == SMESH::FACE )
532 anElementsId = aGroup->GetListOfID();
536 // If "Select whole mesh, submesh or group" check box is off ->
537 // use only elements of given type selected by user
539 SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh();
541 QStringList aListElementsId = QStringList::split( " ", ElementsLineEdit->text(), false );
542 anElementsId = new SMESH::long_array;
543 anElementsId->length( aListElementsId.count() );
546 for ( int i = 0; i < aListElementsId.count(); i++ ) {
547 long ind = aListElementsId[ i ].toLong( &bOk );
549 const SMDS_MeshElement* e = aMesh->FindElement( ind );
551 bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
552 Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
554 anElementsId[ j++ ] = ind;
558 anElementsId->length( j );
562 if ( anElementsId->length() <= 0 ) {
566 if ( StartPointLineEdit->text().stripWhiteSpace().isEmpty() ) {
571 long aNodeStart = StartPointLineEdit->text().toLong( &bOk );
577 SMESH::double_array_var anAngles = new SMESH::double_array;
578 if ( AnglesCheck->isChecked() ) {
579 anAngles->length( AnglesList->count() );
582 for ( int i = 0; i < AnglesList->count(); i++ ) {
583 double angle = AnglesList->text( i ).toDouble( &bOk );
585 anAngles[ j++ ] = angle*PI/180;
587 anAngles->length( j );
591 SMESH::PointStruct aBasePoint;
592 if ( BasePointCheck->isChecked() ) {
593 aBasePoint.x = XSpin->GetValue();
594 aBasePoint.y = YSpin->GetValue();
595 aBasePoint.z = ZSpin->GetValue();
600 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
601 SMESH::SMESH_MeshEditor::Extrusion_Error retVal =
602 aMeshEditor->ExtrusionAlongPath( anElementsId.inout(), myPathMesh, myPathShape, aNodeStart,
603 AnglesCheck->isChecked(), anAngles.inout(),
604 BasePointCheck->isChecked(), aBasePoint );
608 case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
609 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
611 tr( "NO_ELEMENTS_SELECTED" ),
612 tr( "SMESH_BUT_OK" ) );
614 case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
615 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
617 tr( "SELECTED_PATH_IS_NOT_EDGE" ),
618 tr( "SMESH_BUT_OK" ) );
620 case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
621 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
623 tr( "BAD_SHAPE_TYPE" ),
624 tr( "SMESH_BUT_OK" ) );
626 case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
627 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
629 tr( "EXTR_BAD_STARTING_NODE" ),
630 tr( "SMESH_BUT_OK" ) );
632 case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
633 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
635 tr( "WRONG_ANGLES_NUMBER" ),
636 tr( "SMESH_BUT_OK" ) );
638 case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
639 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
641 tr( "CANT_GET_TANGENT" ),
642 tr( "SMESH_BUT_OK" ) );
644 case SMESH::SMESH_MeshEditor::EXTR_OK:
652 mySelection->ClearIObjects();
655 TypeChanged( GetConstructorId() );
659 //=================================================================================
660 // function : SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
661 // purpose : Called when user presses <OK> button
662 //=================================================================================
663 void SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
665 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk");
666 if ( !ClickOnApply() )
671 //=======================================================================
672 // function : SMESHGUI_ExtrusionAlongPathDlg::onTextChange
674 //=======================================================================
676 void SMESHGUI_ExtrusionAlongPathDlg::onTextChange(const QString& theNewText)
678 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onTextChange");
679 QLineEdit* send = (QLineEdit*)sender();
680 if ( send != StartPointLineEdit && send != ElementsLineEdit )
681 send = ElementsLineEdit;
690 if ( send == ElementsLineEdit && myEditCurrentArgument == ElementsLineEdit ) {
691 // hilight entered elements
692 SMDS_Mesh* aMesh = 0;
694 aMesh = myMeshActor->GetObject()->GetMesh();
696 mySelection->ClearIObjects();
697 mySelection->AddIObject( myMeshActor->getIO() );
699 QStringList aListId = QStringList::split( " ", theNewText, false );
701 for ( int i = 0; i < aListId.count(); i++ ) {
702 long ind = aListId[ i ].toLong( &bOk );
704 const SMDS_MeshElement* e = aMesh->FindElement( ind );
706 // check also type of element
707 bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
708 Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
710 if ( !mySelection->IsIndexSelected( myMeshActor->getIO(), e->GetID() ) )
711 mySelection->AddOrRemoveIndex( myMeshActor->getIO(), e->GetID(), true );
718 else if ( send == StartPointLineEdit && myEditCurrentArgument == StartPointLineEdit ) {
719 if ( !myPathMesh->_is_nil() ) {
720 SMESH_Actor* aPathActor = SMESH::FindActorByObject( myPathMesh );
721 SMDS_Mesh* aMesh = 0;
723 aMesh = aPathActor->GetObject()->GetMesh();
725 mySelection->ClearIObjects();
726 mySelection->AddIObject( aPathActor->getIO() );
729 long ind = theNewText.toLong( &bOk );
731 const SMDS_MeshNode* n = aMesh->FindNode( ind );
733 if ( !mySelection->IsIndexSelected( aPathActor->getIO(), n->GetID() ) ) {
734 mySelection->AddOrRemoveIndex( aPathActor->getIO(), n->GetID(), true );
743 //=================================================================================
744 // function : SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
745 // purpose : Called when selection as changed or other case
746 //=================================================================================
747 void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
749 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument");
754 // return if dialog box is inactive
755 if ( !ButtonsGrp->isEnabled() )
758 // selected objects count
759 int nbSel = mySelection->IObjectCount();
764 if ( myEditCurrentArgument == ElementsLineEdit ) {
765 // we are now selecting mesh elements (or whole mesh/submesh/group)
767 ElementsLineEdit->clear();
768 myMesh = SMESH::SMESH_Mesh::_nil();
769 myIDSource = SMESH::SMESH_IDSource::_nil();
772 // only one object is acceptable
776 // try to get mesh from selection
777 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
778 myMesh = SMESH::GetMeshByIO( IO );
779 if( myMesh->_is_nil() )
782 myMeshActor = SMESH::FindActorByObject( myMesh );
786 if ( MeshCheck->isChecked() ) {
787 // If "Select whole mesh, submesh or group" check box is on ->
788 // get ID source and put it's name to the edit box
790 SMESH::GetNameOfSelectedIObjects( mySelection, aString );
792 myIDSource = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
793 ElementsLineEdit->setText( aString );
796 // If "Select whole mesh, submesh or group" check box is off ->
797 // try to get selected elements IDs
799 int aNbUnits = SMESH::GetNameOfSelectedElements( mySelection, aString );
800 ElementsLineEdit->setText( aString );
803 else if ( myEditCurrentArgument == PathMeshLineEdit ) {
804 // we are now selecting path mesh
806 PathMeshLineEdit->clear();
807 myPathMesh = SMESH::SMESH_Mesh::_nil();
808 PathShapeLineEdit->clear();
809 myPathShape = GEOM::GEOM_Object::_nil();
810 StartPointLineEdit->clear();
812 // only one object is acceptable
816 // try to get mesh from selection
817 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
818 myPathMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>( IO );
819 if( myPathMesh->_is_nil() )
823 SMESH::GetNameOfSelectedIObjects( mySelection, aString );
824 PathMeshLineEdit->setText( aString );
826 else if ( myEditCurrentArgument == PathShapeLineEdit ) {
827 // we are now selecting path mesh
829 PathShapeLineEdit->clear();
830 myPathShape = GEOM::GEOM_Object::_nil();
831 StartPointLineEdit->clear();
833 // return if path mesh is not yet selected
834 if ( myPathMesh->_is_nil() )
837 // only one object is acceptable
841 // try to get shape from selection
842 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
843 myPathShape = SMESH::IObjectToInterface<GEOM::GEOM_Object>( IO );
844 if ( myPathShape->_is_nil() )
848 SMESH::GetNameOfSelectedIObjects( mySelection, aString );
849 PathShapeLineEdit->setText( aString );
851 else if ( myEditCurrentArgument == StartPointLineEdit ) {
852 // we are now selecting start point of path
854 StartPointLineEdit->clear();
856 // return if path mesh or path shape is not yet selected
857 if ( myPathMesh->_is_nil() || myPathShape->_is_nil() )
860 // only one object is acceptable
864 // try to get shape from selection
865 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
868 int aNbUnits = SMESH::GetNameOfSelectedElements( mySelection, aString );
870 StartPointLineEdit->setText( aString.stripWhiteSpace() );
872 else if ( myEditCurrentArgument == XSpin ) {
873 // we are now selecting base point
874 // reset is not performed here!
876 // return if is not enabled
877 if ( !BasePointGrp->isEnabled() )
880 // only one object is acceptable
884 // try to get shape from selection
885 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
887 // check if geom vertex is selected
888 GEOM::GEOM_Object_var aGeomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( IO );
889 TopoDS_Vertex aVertex;
890 if( !aGeomObj->_is_nil() ) {
891 if( aGeomObj->IsShape() && GEOMBase::GetShape( aGeomObj, aVertex ) && !aVertex.IsNull() ) {
892 gp_Pnt aPnt = BRep_Tool::Pnt( aVertex );
893 XSpin->SetValue( aPnt.X() );
894 YSpin->SetValue( aPnt.Y() );
895 ZSpin->SetValue( aPnt.Z() );
900 // check if smesh node is selected
901 SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
902 if( aMesh->_is_nil() )
906 int aNbUnits = SMESH::GetNameOfSelectedNodes( mySelection, aString );
907 // return if more than one node is selected
911 SMESH_Actor* aMeshActor = SMESH::FindActorByObject( aMesh );
915 SMDS_Mesh* mesh = aMeshActor->GetObject()->GetMesh();
919 const SMDS_MeshNode* n = mesh->FindNode( aString.toLong() );
923 XSpin->SetValue( n->X() );
924 YSpin->SetValue( n->Y() );
925 ZSpin->SetValue( n->Z() );
929 //=================================================================================
930 // function : SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
932 //=================================================================================
933 void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
935 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument");
936 QToolButton* send = (QToolButton*)sender();
937 if ( send != SelectElementsButton &&
938 send != SelectPathMeshButton &&
939 send != SelectPathShapeButton &&
940 send != SelectStartPointButton &&
941 send != SelectBasePointButton )
943 SetEditCurrentArgument( send );
946 //=================================================================================
947 // function : SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
949 //=================================================================================
950 void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument( QToolButton* button )
952 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument(button)");
953 disconnect( mySelection, 0, this, 0 );
954 mySelection->ClearIObjects();
955 mySelection->ClearFilters();
956 SMESH::SetPickable();
958 if( button == SelectElementsButton ) {
959 myEditCurrentArgument = ElementsLineEdit;
960 SMESH::SetPointRepresentation( false );
961 if ( MeshCheck->isChecked() ) {
962 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
963 mySelection->AddFilter( myElementsFilter );
966 if ( Elements1dRB->isChecked() )
967 QAD_Application::getDesktop()->SetSelectionMode( EdgeSelection, true );
968 else if ( Elements2dRB->isChecked() )
969 QAD_Application::getDesktop()->SetSelectionMode( FaceSelection, true );
972 else if ( button == SelectPathMeshButton ) {
973 myEditCurrentArgument = PathMeshLineEdit;
974 SMESH::SetPointRepresentation( false );
975 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
976 mySelection->AddFilter( myPathMeshFilter );
978 else if ( button == SelectPathShapeButton ) {
979 myEditCurrentArgument = PathShapeLineEdit;
980 SMESH::SetPointRepresentation( false );
981 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
983 if ( !myPathMesh->_is_nil() ) {
984 GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
985 SMESH_Actor* aPathActor = SMESH::FindActorByObject( myPathMesh );
987 if ( !aMainShape->_is_nil() && aPathActor )
988 mySelection->AddFilter( new SMESH_NumberFilter( "GEOM", TopAbs_SHAPE, -1, TopAbs_EDGE, aMainShape ) );
989 //SMESH::SetPickable( aPathActor );
992 else if ( button == SelectStartPointButton ) {
993 myEditCurrentArgument = StartPointLineEdit;
994 if ( !myPathMesh->_is_nil() ) {
995 SMESH_Actor* aPathActor = SMESH::FindActorByObject( myPathMesh );
997 SMESH::SetPointRepresentation( true );
998 QAD_Application::getDesktop()->SetSelectionMode( NodeSelection, true );
999 SMESH::SetPickable( aPathActor );
1003 else if ( button == SelectBasePointButton ) {
1004 myEditCurrentArgument = XSpin;
1005 SMESH::SetPointRepresentation( true );
1006 QAD_Application::getDesktop()->SetSelectionMode( NodeSelection, true );
1008 SMESH_ListOfFilter aListOfFilters;
1009 Handle(SMESH_TypeFilter) aMeshOrSubMeshFilter = new SMESH_TypeFilter( MESHorSUBMESH );
1010 if ( !aMeshOrSubMeshFilter.IsNull() )
1011 aListOfFilters.Append( aMeshOrSubMeshFilter );
1012 Handle(SMESH_TypeFilter) aSmeshGroupFilter = new SMESH_TypeFilter( GROUP );
1013 if ( !aSmeshGroupFilter.IsNull() )
1014 aListOfFilters.Append( aSmeshGroupFilter );
1015 //Handle(GEOM_ShapeTypeFilter) aVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX );
1016 Handle(SMESH_NumberFilter) aVertexFilter = new SMESH_NumberFilter( "GEOM", TopAbs_SHAPE, -1, TopAbs_VERTEX, GEOM::GEOM_Object::_nil() );
1017 if ( !aVertexFilter.IsNull() )
1018 aListOfFilters.Append( aVertexFilter );
1020 mySelection->AddFilter( new SMESH_LogicalFilter( aListOfFilters, SMESH_LogicalFilter::LO_OR ) );
1023 if ( myEditCurrentArgument && !myEditCurrentArgument->hasFocus() )
1024 myEditCurrentArgument->setFocus();
1026 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
1027 SelectionIntoArgument();
1030 //=================================================================================
1031 // function : SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
1032 // purpose : Deactivates this dialog
1033 //=================================================================================
1034 void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
1036 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog");
1037 if ( ElementsTypeGrp->isEnabled() ) {
1038 ElementsTypeGrp->setEnabled( false );
1039 ArgumentsGrp->setEnabled( false );
1040 ButtonsGrp->setEnabled( false );
1041 mySMESHGUI->ResetState();
1042 mySMESHGUI->SetActiveDialogBox( 0 );
1046 //=================================================================================
1047 // function : SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
1048 // purpose : Activates this dialog
1049 //=================================================================================
1050 void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
1052 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog");
1053 // Emit a signal to deactivate the active dialog
1054 mySMESHGUI->EmitSignalDeactivateDialog();
1055 ElementsTypeGrp->setEnabled( true );
1056 ArgumentsGrp->setEnabled( true );
1057 ButtonsGrp->setEnabled( true );
1059 mySMESHGUI->SetActiveDialogBox( this );
1061 TypeChanged( GetConstructorId() );
1062 SelectionIntoArgument();
1065 //=================================================================================
1066 // function : SMESHGUI_ExtrusionAlongPathDlg::enterEvent()
1067 // purpose : Mouse enter event
1068 //=================================================================================
1069 void SMESHGUI_ExtrusionAlongPathDlg::enterEvent(QEvent* e)
1071 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::enterEvent");
1072 if ( ElementsTypeGrp->isEnabled() )
1074 ActivateThisDialog();
1077 //=================================================================================
1078 // function : SMESHGUI_ExtrusionAlongPathDlg::reject()
1079 // purpose : Called when dialog box is closed
1080 //=================================================================================
1081 void SMESHGUI_ExtrusionAlongPathDlg::reject()
1083 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::reject");
1084 disconnect( mySelection, 0, this, 0 );
1085 mySelection->ClearFilters();
1086 mySelection->ClearIObjects();
1087 SMESH::SetPickable();
1088 SMESH::SetPointRepresentation( false );
1089 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
1090 mySMESHGUI->ResetState() ;
1094 //=================================================================================
1095 // function : SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
1097 //=================================================================================
1098 int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
1100 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId");
1101 if ( ElementsTypeGrp != NULL && ElementsTypeGrp->selected() != NULL )
1102 return ElementsTypeGrp->id( ElementsTypeGrp->selected() );
1106 //=======================================================================
1107 // function : SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh
1109 //=======================================================================
1110 void SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh()
1112 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh");
1113 bool toSelectMesh = MeshCheck->isChecked();
1115 ElementsLineEdit->setReadOnly( toSelectMesh );
1116 ElementsLab->setText( toSelectMesh ? tr( "SMESH_NAME" ) : tr( "SMESH_ID_ELEMENTS" ) );
1117 ElementsLineEdit->clear();
1119 SetEditCurrentArgument( SelectElementsButton );
1122 //=======================================================================
1123 // function : SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck
1124 // purpose : called when "Use Angles" check box is switched
1125 //=======================================================================
1126 void SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck()
1128 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck");
1129 AnglesGrp->setEnabled( AnglesCheck->isChecked() );
1132 //=======================================================================
1133 // function : SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck
1134 // purpose : called when "Use Base Point" check box is switched
1135 //=======================================================================
1136 void SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck()
1138 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck");
1139 BasePointGrp->setEnabled( BasePointCheck->isChecked() );
1142 //=======================================================================
1143 // function : SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded
1144 // purpose : Called when user adds angle to the list
1145 //=======================================================================
1146 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
1148 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded");
1149 AnglesList->insertItem( QString::number( AngleSpin->GetValue() ) );
1152 //=======================================================================
1153 // function : SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved
1154 // purpose : Called when user removes angle(s) from the list
1155 //=======================================================================
1156 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
1158 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved");
1159 QList<QListBoxItem> aList;
1160 aList.setAutoDelete( false );
1161 for ( int i = 0; i < AnglesList->count(); i++ )
1162 if ( AnglesList->isSelected( i ) )
1163 aList.append( AnglesList->item( i ) );
1165 for ( int i = 0; i < aList.count(); i++ )
1166 delete aList.at( i );