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( -999999.999, +999999.999, 10.0, 3 );
291 YSpin->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
292 ZSpin->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 );
293 AngleSpin->RangeStepAndValidator( -999999.999, +999999.999, 5.0, 3 );
296 mySMESHGUI = SMESHGUI::GetSMESHGUI() ;
297 mySMESHGUI->SetActiveDialogBox( this ) ;
299 // Costruction of the logical filter for the elements: mesh/sub-mesh/group
300 SMESH_ListOfFilter aListOfFilters;
301 Handle(SMESH_TypeFilter) aMeshOrSubMeshFilter = new SMESH_TypeFilter( MESHorSUBMESH );
302 if ( !aMeshOrSubMeshFilter.IsNull() )
303 aListOfFilters.Append( aMeshOrSubMeshFilter );
304 Handle(SMESH_TypeFilter) aSmeshGroupFilter = new SMESH_TypeFilter( GROUP );
305 if ( !aSmeshGroupFilter.IsNull() )
306 aListOfFilters.Append( aSmeshGroupFilter );
308 myElementsFilter = new SMESH_LogicalFilter( aListOfFilters, SMESH_LogicalFilter::LO_OR );
310 myPathMeshFilter = new SMESH_TypeFilter( MESH );
314 /***************************************************************/
315 // signals-slots connections
316 connect( OkButton, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
317 connect( CloseButton, SIGNAL( clicked() ), this, SLOT( reject() ) ) ;
318 connect( ApplyButton, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
320 connect( AddAngleButton, SIGNAL( clicked() ), this, SLOT( OnAngleAdded() ) );
321 connect( RemoveAngleButton, SIGNAL( clicked() ), this, SLOT( OnAngleRemoved() ) );
323 connect( ElementsTypeGrp, SIGNAL( clicked( int ) ), SLOT( TypeChanged( int ) ) );
325 connect( SelectElementsButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
326 connect( SelectPathMeshButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
327 connect( SelectPathShapeButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
328 connect( SelectStartPointButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
329 connect( SelectBasePointButton, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
331 connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
332 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
333 connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) ) ;
335 connect( ElementsLineEdit, SIGNAL( textChanged( const QString& ) ),
336 SLOT( onTextChange( const QString& ) ) );
337 connect( StartPointLineEdit, SIGNAL( textChanged( const QString& ) ),
338 SLOT( onTextChange( const QString& ) ) );
340 connect( MeshCheck, SIGNAL( toggled( bool ) ), SLOT( onSelectMesh() ) );
341 connect( AnglesCheck, SIGNAL( toggled( bool ) ), SLOT( onAnglesCheck() ) );
342 connect( BasePointCheck, SIGNAL( toggled( bool ) ), SLOT( onBasePointCheck() ) );
344 AnglesList->installEventFilter( this );
345 ElementsLineEdit->installEventFilter( this );
346 StartPointLineEdit->installEventFilter( this );
347 XSpin->editor()->installEventFilter( this );
348 YSpin->editor()->installEventFilter( this );
349 ZSpin->editor()->installEventFilter( this );
351 /***************************************************************/
352 // set position and show dialog box
354 mySMESHGUI->DefineDlgPosition( this, x, y ) ;
356 this->show() ; // displays Dialog
359 //=================================================================================
360 // function : SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
361 // purpose : destructor
362 //=================================================================================
363 SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg()
365 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::~SMESHGUI_ExtrusionAlongPathDlg");
366 // no need to delete child widgets, Qt does it all for us
369 //=================================================================================
370 // function : SMESHGUI_ExtrusionAlongPathDlg::eventFilter
371 // purpose : event filter
372 //=================================================================================
373 bool SMESHGUI_ExtrusionAlongPathDlg::eventFilter( QObject* object, QEvent* event )
375 if ( event->type() == QEvent::KeyPress ) {
376 QKeyEvent* ke = ( QKeyEvent* )event;
377 if ( object == AnglesList ) {
378 if ( ke->key() == Key_Delete )
382 else if ( event->type() == QEvent::FocusIn ) {
383 if ( object == ElementsLineEdit ) {
384 if ( myEditCurrentArgument != ElementsLineEdit )
385 SetEditCurrentArgument( SelectElementsButton );
387 else if ( object == StartPointLineEdit ) {
388 if ( myEditCurrentArgument != StartPointLineEdit )
389 SetEditCurrentArgument( SelectStartPointButton );
391 else if ( object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor() ) {
392 if ( myEditCurrentArgument != XSpin )
393 SetEditCurrentArgument( SelectBasePointButton );
396 return QDialog::eventFilter( object, event );
399 //=================================================================================
400 // function : SMESHGUI_ExtrusionAlongPathDlg::Init()
401 // purpose : initialization
402 //=================================================================================
403 void SMESHGUI_ExtrusionAlongPathDlg::Init( bool ResetControls )
405 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::Init");
407 myEditCurrentArgument = 0;
409 myMesh = SMESH::SMESH_Mesh::_nil();
410 myIDSource = SMESH::SMESH_IDSource::_nil();
412 myPathMesh = SMESH::SMESH_Mesh::_nil();
413 myPathShape = GEOM::GEOM_Object::_nil();
415 ElementsLineEdit->clear();
416 PathMeshLineEdit->clear();
417 PathShapeLineEdit->clear();
418 StartPointLineEdit->clear();
420 if( ResetControls ) {
421 XSpin->SetValue( 0.0 );
422 YSpin->SetValue( 0.0 );
423 ZSpin->SetValue( 0.0 );
425 AngleSpin->SetValue( 45 );
426 MeshCheck->setChecked( false );
432 SetEditCurrentArgument( 0 );
435 //=================================================================================
436 // function : SMESHGUI_ExtrusionAlongPathDlg::TypeChanged()
437 // purpose : Called when user changes type of elements ( 1d / 2d )
438 //=================================================================================
439 void SMESHGUI_ExtrusionAlongPathDlg::TypeChanged( int type )
441 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::TypeChanged");
442 if ( myType != type ) {
443 disconnect( mySelection, 0, this, 0 );
446 ArgumentsGrp->setTitle( tr( "EXTRUSION_1D" ) );
447 else if ( type == 1 )
448 ArgumentsGrp->setTitle( tr( "EXTRUSION_2D" ) );
450 // clear elements ID list
451 if ( !MeshCheck->isChecked() ) {
452 ElementsLineEdit->clear();
454 // set selection mode if necessary
455 if( myEditCurrentArgument == ElementsLineEdit ) {
456 mySelection->ClearIObjects();
457 mySelection->ClearFilters();
458 SMESH::SetPickable();
460 SMESH::SetPointRepresentation( false );
461 if ( MeshCheck->isChecked() ) {
462 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
463 mySelection->AddFilter( myElementsFilter );
467 QAD_Application::getDesktop()->SetSelectionMode( EdgeSelection, true );
469 QAD_Application::getDesktop()->SetSelectionMode( FaceSelection, true );
472 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
478 //=================================================================================
479 // function : SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
480 // purpose : Called when user presses <Apply> button
481 //=================================================================================
482 bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
484 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply");
485 if ( mySMESHGUI->ActiveStudyLocked() ) {
489 if( myMesh->_is_nil() || MeshCheck->isChecked() && myIDSource->_is_nil() || !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 on ->
497 // get all elements of the required type from the object selected
499 // if MESH object is selected
500 if ( !CORBA::is_nil( SMESH::SMESH_Mesh::_narrow( myIDSource ) ) ) {
502 SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( myIDSource );
503 // get IDs from mesh...
504 if ( Elements1dRB->isChecked() )
506 anElementsId = aMesh->GetElementsByType( SMESH::EDGE );
507 else if ( Elements2dRB->isChecked() ) {
508 anElementsId = aMesh->GetElementsByType( SMESH::FACE );
511 // SUBMESH is selected
512 if ( !CORBA::is_nil( SMESH::SMESH_subMesh::_narrow( myIDSource ) ) ) {
514 SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( myIDSource );
515 // get IDs from submesh
516 if ( Elements1dRB->isChecked() )
518 anElementsId = aSubMesh->GetElementsByType( SMESH::EDGE );
519 else if ( Elements2dRB->isChecked() )
521 anElementsId = aSubMesh->GetElementsByType( SMESH::FACE );
524 if ( !CORBA::is_nil( SMESH::SMESH_GroupBase::_narrow( myIDSource ) ) ) {
526 SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( myIDSource );
527 // get IDs from group
528 // 1d elements or 2d elements
529 if ( Elements1dRB->isChecked() && aGroup->GetType() == SMESH::EDGE ||
530 Elements2dRB->isChecked() && aGroup->GetType() == SMESH::FACE )
531 anElementsId = aGroup->GetListOfID();
535 // If "Select whole mesh, submesh or group" check box is off ->
536 // use only elements of given type selected by user
538 SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh();
540 QStringList aListElementsId = QStringList::split( " ", ElementsLineEdit->text(), false );
541 anElementsId = new SMESH::long_array;
542 anElementsId->length( aListElementsId.count() );
545 for ( int i = 0; i < aListElementsId.count(); i++ ) {
546 long ind = aListElementsId[ i ].toLong( &bOk );
548 const SMDS_MeshElement* e = aMesh->FindElement( ind );
550 bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
551 Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
553 anElementsId[ j++ ] = ind;
557 anElementsId->length( j );
561 if ( anElementsId->length() <= 0 ) {
565 if ( StartPointLineEdit->text().stripWhiteSpace().isEmpty() ) {
570 long aNodeStart = StartPointLineEdit->text().toLong( &bOk );
576 SMESH::double_array_var anAngles = new SMESH::double_array;
577 if ( AnglesCheck->isChecked() ) {
578 anAngles->length( AnglesList->count() );
581 for ( int i = 0; i < AnglesList->count(); i++ ) {
582 double angle = AnglesList->text( i ).toDouble( &bOk );
584 anAngles[ j++ ] = angle*PI/180;
586 anAngles->length( j );
590 SMESH::PointStruct aBasePoint;
591 if ( BasePointCheck->isChecked() ) {
592 aBasePoint.x = XSpin->GetValue();
593 aBasePoint.y = YSpin->GetValue();
594 aBasePoint.z = ZSpin->GetValue();
599 SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
600 SMESH::SMESH_MeshEditor::Extrusion_Error retVal =
601 aMeshEditor->ExtrusionAlongPath( anElementsId.inout(), myPathMesh, myPathShape, aNodeStart,
602 AnglesCheck->isChecked(), anAngles.inout(),
603 BasePointCheck->isChecked(), aBasePoint );
607 case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
608 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
610 tr( "NO_ELEMENTS_SELECTED" ),
611 tr( "SMESH_BUT_OK" ) );
613 case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
614 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
616 tr( "SELECTED_PATH_IS_NOT_EDGE" ),
617 tr( "SMESH_BUT_OK" ) );
619 case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
620 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
622 tr( "BAD_SHAPE_TYPE" ),
623 tr( "SMESH_BUT_OK" ) );
625 case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
626 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
628 tr( "EXTR_BAD_STARTING_NODE" ),
629 tr( "SMESH_BUT_OK" ) );
631 case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
632 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
634 tr( "WRONG_ANGLES_NUMBER" ),
635 tr( "SMESH_BUT_OK" ) );
637 case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
638 QAD_MessageBox::warn1( QAD_Application::getDesktop(),
640 tr( "CANT_GET_TANGENT" ),
641 tr( "SMESH_BUT_OK" ) );
643 case SMESH::SMESH_MeshEditor::EXTR_OK:
651 mySelection->ClearIObjects();
654 TypeChanged( GetConstructorId() );
658 //=================================================================================
659 // function : SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
660 // purpose : Called when user presses <OK> button
661 //=================================================================================
662 void SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
664 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk");
665 if ( !ClickOnApply() )
670 //=======================================================================
671 // function : SMESHGUI_ExtrusionAlongPathDlg::onTextChange
673 //=======================================================================
675 void SMESHGUI_ExtrusionAlongPathDlg::onTextChange(const QString& theNewText)
677 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onTextChange");
678 QLineEdit* send = (QLineEdit*)sender();
679 if ( send != StartPointLineEdit && send != ElementsLineEdit )
680 send = ElementsLineEdit;
689 if ( send == ElementsLineEdit && myEditCurrentArgument == ElementsLineEdit ) {
690 // hilight entered elements
691 SMDS_Mesh* aMesh = 0;
693 aMesh = myMeshActor->GetObject()->GetMesh();
695 mySelection->ClearIObjects();
696 mySelection->AddIObject( myMeshActor->getIO() );
698 QStringList aListId = QStringList::split( " ", theNewText, false );
700 for ( int i = 0; i < aListId.count(); i++ ) {
701 long ind = aListId[ i ].toLong( &bOk );
703 const SMDS_MeshElement* e = aMesh->FindElement( ind );
705 // check also type of element
706 bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
707 Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
709 if ( !mySelection->IsIndexSelected( myMeshActor->getIO(), e->GetID() ) )
710 mySelection->AddOrRemoveIndex( myMeshActor->getIO(), e->GetID(), true );
717 else if ( send == StartPointLineEdit && myEditCurrentArgument == StartPointLineEdit ) {
718 if ( !myPathMesh->_is_nil() ) {
719 SMESH_Actor* aPathActor = SMESH::FindActorByObject( myPathMesh );
720 SMDS_Mesh* aMesh = 0;
722 aMesh = aPathActor->GetObject()->GetMesh();
724 mySelection->ClearIObjects();
725 mySelection->AddIObject( aPathActor->getIO() );
728 long ind = theNewText.toLong( &bOk );
730 const SMDS_MeshNode* n = aMesh->FindNode( ind );
732 if ( !mySelection->IsIndexSelected( aPathActor->getIO(), n->GetID() ) ) {
733 mySelection->AddOrRemoveIndex( aPathActor->getIO(), n->GetID(), true );
742 //=================================================================================
743 // function : SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
744 // purpose : Called when selection as changed or other case
745 //=================================================================================
746 void SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument()
748 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SelectionIntoArgument");
753 // return if dialog box is inactive
754 if ( !ButtonsGrp->isEnabled() )
757 // selected objects count
758 int nbSel = mySelection->IObjectCount();
763 if ( myEditCurrentArgument == ElementsLineEdit ) {
764 // we are now selecting mesh elements (or whole mesh/submesh/group)
766 ElementsLineEdit->clear();
767 myMesh = SMESH::SMESH_Mesh::_nil();
768 myIDSource = SMESH::SMESH_IDSource::_nil();
771 // only one object is acceptable
775 // try to get mesh from selection
776 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
777 myMesh = SMESH::GetMeshByIO( IO );
778 if( myMesh->_is_nil() )
781 myMeshActor = SMESH::FindActorByObject( myMesh );
785 if ( MeshCheck->isChecked() ) {
786 // If "Select whole mesh, submesh or group" check box is on ->
787 // get ID source and put it's name to the edit box
789 SMESH::GetNameOfSelectedIObjects( mySelection, aString );
791 myIDSource = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>( IO );
792 ElementsLineEdit->setText( aString );
795 // If "Select whole mesh, submesh or group" check box is off ->
796 // try to get selected elements IDs
798 int aNbUnits = SMESH::GetNameOfSelectedElements( mySelection, aString );
799 ElementsLineEdit->setText( aString );
802 else if ( myEditCurrentArgument == PathMeshLineEdit ) {
803 // we are now selecting path mesh
805 PathMeshLineEdit->clear();
806 myPathMesh = SMESH::SMESH_Mesh::_nil();
807 PathShapeLineEdit->clear();
808 myPathShape = GEOM::GEOM_Object::_nil();
809 StartPointLineEdit->clear();
811 // only one object is acceptable
815 // try to get mesh from selection
816 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
817 myPathMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>( IO );
818 if( myPathMesh->_is_nil() )
822 SMESH::GetNameOfSelectedIObjects( mySelection, aString );
823 PathMeshLineEdit->setText( aString );
825 else if ( myEditCurrentArgument == PathShapeLineEdit ) {
826 // we are now selecting path mesh
828 PathShapeLineEdit->clear();
829 myPathShape = GEOM::GEOM_Object::_nil();
830 StartPointLineEdit->clear();
832 // return if path mesh is not yet selected
833 if ( myPathMesh->_is_nil() )
836 // only one object is acceptable
840 // try to get shape from selection
841 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
842 myPathShape = SMESH::IObjectToInterface<GEOM::GEOM_Object>( IO );
843 if ( myPathShape->_is_nil() )
847 SMESH::GetNameOfSelectedIObjects( mySelection, aString );
848 PathShapeLineEdit->setText( aString );
850 else if ( myEditCurrentArgument == StartPointLineEdit ) {
851 // we are now selecting start point of path
853 StartPointLineEdit->clear();
855 // return if path mesh or path shape is not yet selected
856 if ( myPathMesh->_is_nil() || myPathShape->_is_nil() )
859 // only one object is acceptable
863 // try to get shape from selection
864 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
867 int aNbUnits = SMESH::GetNameOfSelectedElements( mySelection, aString );
869 StartPointLineEdit->setText( aString.stripWhiteSpace() );
871 else if ( myEditCurrentArgument == XSpin ) {
872 // we are now selecting base point
873 // reset is not performed here!
875 // return if is not enabled
876 if ( !BasePointGrp->isEnabled() )
879 // only one object is acceptable
883 // try to get shape from selection
884 Handle( SALOME_InteractiveObject ) IO = mySelection->firstIObject();
886 // check if geom vertex is selected
887 GEOM::GEOM_Object_var aGeomObj = SMESH::IObjectToInterface<GEOM::GEOM_Object>( IO );
888 TopoDS_Vertex aVertex;
889 if( !aGeomObj->_is_nil() ) {
890 if( aGeomObj->IsShape() && GEOMBase::GetShape( aGeomObj, aVertex ) && !aVertex.IsNull() ) {
891 gp_Pnt aPnt = BRep_Tool::Pnt( aVertex );
892 XSpin->SetValue( aPnt.X() );
893 YSpin->SetValue( aPnt.Y() );
894 ZSpin->SetValue( aPnt.Z() );
899 // check if smesh node is selected
900 SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO( IO );
901 if( aMesh->_is_nil() )
905 int aNbUnits = SMESH::GetNameOfSelectedNodes( mySelection, aString );
906 // return if more than one node is selected
910 SMESH_Actor* aMeshActor = SMESH::FindActorByObject( aMesh );
914 SMDS_Mesh* mesh = aMeshActor->GetObject()->GetMesh();
918 const SMDS_MeshNode* n = mesh->FindNode( aString.toLong() );
922 XSpin->SetValue( n->X() );
923 YSpin->SetValue( n->Y() );
924 ZSpin->SetValue( n->Z() );
928 //=================================================================================
929 // function : SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
931 //=================================================================================
932 void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
934 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument");
935 QToolButton* send = (QToolButton*)sender();
936 if ( send != SelectElementsButton &&
937 send != SelectPathMeshButton &&
938 send != SelectPathShapeButton &&
939 send != SelectStartPointButton &&
940 send != SelectBasePointButton )
942 SetEditCurrentArgument( send );
945 //=================================================================================
946 // function : SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument()
948 //=================================================================================
949 void SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument( QToolButton* button )
951 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::SetEditCurrentArgument(button)");
952 disconnect( mySelection, 0, this, 0 );
953 mySelection->ClearIObjects();
954 mySelection->ClearFilters();
955 SMESH::SetPickable();
957 if( button == SelectElementsButton ) {
958 myEditCurrentArgument = ElementsLineEdit;
959 SMESH::SetPointRepresentation( false );
960 if ( MeshCheck->isChecked() ) {
961 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
962 mySelection->AddFilter( myElementsFilter );
965 if ( Elements1dRB->isChecked() )
966 QAD_Application::getDesktop()->SetSelectionMode( EdgeSelection, true );
967 else if ( Elements2dRB->isChecked() )
968 QAD_Application::getDesktop()->SetSelectionMode( FaceSelection, true );
971 else if ( button == SelectPathMeshButton ) {
972 myEditCurrentArgument = PathMeshLineEdit;
973 SMESH::SetPointRepresentation( false );
974 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
975 mySelection->AddFilter( myPathMeshFilter );
977 else if ( button == SelectPathShapeButton ) {
978 myEditCurrentArgument = PathShapeLineEdit;
979 SMESH::SetPointRepresentation( false );
980 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
982 if ( !myPathMesh->_is_nil() ) {
983 GEOM::GEOM_Object_var aMainShape = myPathMesh->GetShapeToMesh();
984 SMESH_Actor* aPathActor = SMESH::FindActorByObject( myPathMesh );
986 if ( !aMainShape->_is_nil() && aPathActor )
987 mySelection->AddFilter( new SMESH_NumberFilter( "GEOM", TopAbs_SHAPE, -1, TopAbs_EDGE, aMainShape ) );
988 //SMESH::SetPickable( aPathActor );
991 else if ( button == SelectStartPointButton ) {
992 myEditCurrentArgument = StartPointLineEdit;
993 if ( !myPathMesh->_is_nil() ) {
994 SMESH_Actor* aPathActor = SMESH::FindActorByObject( myPathMesh );
996 SMESH::SetPointRepresentation( true );
997 QAD_Application::getDesktop()->SetSelectionMode( NodeSelection, true );
998 SMESH::SetPickable( aPathActor );
1002 else if ( button == SelectBasePointButton ) {
1003 myEditCurrentArgument = XSpin;
1004 SMESH::SetPointRepresentation( true );
1005 QAD_Application::getDesktop()->SetSelectionMode( NodeSelection, true );
1007 SMESH_ListOfFilter aListOfFilters;
1008 Handle(SMESH_TypeFilter) aMeshOrSubMeshFilter = new SMESH_TypeFilter( MESHorSUBMESH );
1009 if ( !aMeshOrSubMeshFilter.IsNull() )
1010 aListOfFilters.Append( aMeshOrSubMeshFilter );
1011 Handle(SMESH_TypeFilter) aSmeshGroupFilter = new SMESH_TypeFilter( GROUP );
1012 if ( !aSmeshGroupFilter.IsNull() )
1013 aListOfFilters.Append( aSmeshGroupFilter );
1014 //Handle(GEOM_ShapeTypeFilter) aVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX );
1015 Handle(SMESH_NumberFilter) aVertexFilter = new SMESH_NumberFilter( "GEOM", TopAbs_SHAPE, -1, TopAbs_VERTEX, GEOM::GEOM_Object::_nil() );
1016 if ( !aVertexFilter.IsNull() )
1017 aListOfFilters.Append( aVertexFilter );
1019 mySelection->AddFilter( new SMESH_LogicalFilter( aListOfFilters, SMESH_LogicalFilter::LO_OR ) );
1022 if ( myEditCurrentArgument && !myEditCurrentArgument->hasFocus() )
1023 myEditCurrentArgument->setFocus();
1025 connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
1026 SelectionIntoArgument();
1029 //=================================================================================
1030 // function : SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
1031 // purpose : Deactivates this dialog
1032 //=================================================================================
1033 void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
1035 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog");
1036 if ( ElementsTypeGrp->isEnabled() ) {
1037 ElementsTypeGrp->setEnabled( false );
1038 ArgumentsGrp->setEnabled( false );
1039 ButtonsGrp->setEnabled( false );
1040 mySMESHGUI->ResetState();
1041 mySMESHGUI->SetActiveDialogBox( 0 );
1045 //=================================================================================
1046 // function : SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
1047 // purpose : Activates this dialog
1048 //=================================================================================
1049 void SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog()
1051 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::ActivateThisDialog");
1052 // Emit a signal to deactivate the active dialog
1053 mySMESHGUI->EmitSignalDeactivateDialog();
1054 ElementsTypeGrp->setEnabled( true );
1055 ArgumentsGrp->setEnabled( true );
1056 ButtonsGrp->setEnabled( true );
1058 mySMESHGUI->SetActiveDialogBox( this );
1060 TypeChanged( GetConstructorId() );
1061 SelectionIntoArgument();
1064 //=================================================================================
1065 // function : SMESHGUI_ExtrusionAlongPathDlg::enterEvent()
1066 // purpose : Mouse enter event
1067 //=================================================================================
1068 void SMESHGUI_ExtrusionAlongPathDlg::enterEvent(QEvent* e)
1070 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::enterEvent");
1071 if ( ElementsTypeGrp->isEnabled() )
1073 ActivateThisDialog();
1076 //=================================================================================
1077 // function : SMESHGUI_ExtrusionAlongPathDlg::reject()
1078 // purpose : Called when dialog box is closed
1079 //=================================================================================
1080 void SMESHGUI_ExtrusionAlongPathDlg::reject()
1082 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::reject");
1083 disconnect( mySelection, 0, this, 0 );
1084 mySelection->ClearFilters();
1085 mySelection->ClearIObjects();
1086 SMESH::SetPickable();
1087 SMESH::SetPointRepresentation( false );
1088 QAD_Application::getDesktop()->SetSelectionMode( ActorSelection );
1089 mySMESHGUI->ResetState() ;
1093 //=================================================================================
1094 // function : SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
1096 //=================================================================================
1097 int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
1099 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId");
1100 if ( ElementsTypeGrp != NULL && ElementsTypeGrp->selected() != NULL )
1101 return ElementsTypeGrp->id( ElementsTypeGrp->selected() );
1105 //=======================================================================
1106 // function : SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh
1108 //=======================================================================
1109 void SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh()
1111 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh");
1112 bool toSelectMesh = MeshCheck->isChecked();
1114 ElementsLineEdit->setReadOnly( toSelectMesh );
1115 ElementsLab->setText( toSelectMesh ? tr( "SMESH_NAME" ) : tr( "SMESH_ID_ELEMENTS" ) );
1116 ElementsLineEdit->clear();
1118 SetEditCurrentArgument( SelectElementsButton );
1121 //=======================================================================
1122 // function : SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck
1123 // purpose : called when "Use Angles" check box is switched
1124 //=======================================================================
1125 void SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck()
1127 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck");
1128 AnglesGrp->setEnabled( AnglesCheck->isChecked() );
1131 //=======================================================================
1132 // function : SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck
1133 // purpose : called when "Use Base Point" check box is switched
1134 //=======================================================================
1135 void SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck()
1137 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck");
1138 BasePointGrp->setEnabled( BasePointCheck->isChecked() );
1141 //=======================================================================
1142 // function : SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded
1143 // purpose : Called when user adds angle to the list
1144 //=======================================================================
1145 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
1147 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded");
1148 AnglesList->insertItem( QString::number( AngleSpin->GetValue() ) );
1151 //=======================================================================
1152 // function : SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved
1153 // purpose : Called when user removes angle(s) from the list
1154 //=======================================================================
1155 void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
1157 MESSAGE("SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved");
1158 QList<QListBoxItem> aList;
1159 aList.setAutoDelete( false );
1160 for ( int i = 0; i < AnglesList->count(); i++ )
1161 if ( AnglesList->isSelected( i ) )
1162 aList.append( AnglesList->item( i ) );
1164 for ( int i = 0; i < aList.count(); i++ )
1165 delete aList.at( i );