Salome HOME
0fbdf57ddf383fc22c7f2436e66ef9100727cf75
[modules/geom.git] / src / OperationGUI / OperationGUI_PartitionDlg.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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, or (at your option) any later version.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : OperationGUI_PartitionDlg.cxx
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26
27 #include "OperationGUI_PartitionDlg.h"
28
29 #include <DlgRef.h>
30 #include <GeometryGUI.h>
31 #include <GEOMBase.h>
32
33 #include <GEOMImpl_Types.hxx>
34
35 #include <SUIT_Desktop.h>
36 #include <SUIT_Session.h>
37 #include <SUIT_ResourceMgr.h>
38 #include <SUIT_MessageBox.h>
39 #include <SalomeApp_Application.h>
40 #include <LightApp_SelectionMgr.h>
41
42 #include <TopoDS_Iterator.hxx>
43 #include <TopoDS_Shape.hxx>
44
45 // VSR 22/08/2012: issue 0021787: remove "Preview" button from BOP and Partition operations
46 // Comment next line to enable preview in Partition dialog box
47 #define NO_PREVIEW
48
49 //=================================================================================
50 // class    : OperationGUI_PartitionDlg()
51 // purpose  : Constructs a OperationGUI_PartitionDlg which is a child of 'parent', with the
52 //            name 'name' and widget flags set to 'f'.
53 //            The dialog will by default be modeless, unless you set 'modal' to
54 //            TRUE to construct a modal dialog.
55 //=================================================================================
56 OperationGUI_PartitionDlg::OperationGUI_PartitionDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
57   : GEOMBase_Skeleton( theGeometryGUI, parent, false )
58 {
59   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
60   QPixmap image0( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PARTITION" ) ) );
61   QPixmap image1( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PARTITION_PLANE" ) ) );
62   QPixmap image2( aResMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
63
64   setWindowTitle( tr( "GEOM_PARTITION_TITLE" ) );
65
66   /***************************************************************/
67   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PARTITION" ) );
68   mainFrame()->RadioButton1->setIcon( image0 );
69   mainFrame()->RadioButton2->setIcon( image1 );
70   mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
71   mainFrame()->RadioButton2->close();
72   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
73   mainFrame()->RadioButton3->close();
74
75   // Full partition (contains half-space partition)
76   GroupPoints = new DlgRef_2Sel1List2Check( centralWidget() );
77   GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) );
78   GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
79   GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) );
80   GroupPoints->TextLabel3->setText( tr( "GEOM_RECONSTRUCTION_LIMIT" ) );
81   GroupPoints->PushButton1->setIcon( image2 );
82   GroupPoints->PushButton2->setIcon( image2 );
83   GroupPoints->LineEdit1->setReadOnly( true );
84   GroupPoints->LineEdit2->setReadOnly( true );
85   GroupPoints->LineEdit1->setEnabled( true );
86   GroupPoints->LineEdit2->setEnabled( false );
87   GroupPoints->CheckButton1->setText( tr( "GEOM_KEEP_NONLIMIT_SHAPES" ) );
88   GroupPoints->CheckButton2->setText( tr( "GEOM_NO_SELF_INTERSECTION" ) );
89
90   mySelfInte = new QCheckBox(GroupPoints->GroupBox1);
91   mySelfInte->setText(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
92   GroupPoints->gridLayout1->addWidget(mySelfInte, 5, 0, 1, 3);
93
94   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
95   layout->setMargin( 0 ); layout->setSpacing( 6 );
96   layout->addWidget( GroupPoints );
97
98   /***************************************************************/
99
100   setHelpFileName( "partition_page.html" );
101
102 #ifdef NO_PREVIEW
103   mainFrame()->CheckBoxPreview->setChecked( false );
104   mainFrame()->CheckBoxPreview->hide();
105 #endif
106   Init();
107 }
108
109
110 //=================================================================================
111 // function : ~OperationGUI_PartitionDlg()
112 // purpose  : Destroys the object and frees any allocated resources
113 //=================================================================================
114 OperationGUI_PartitionDlg::~OperationGUI_PartitionDlg()
115 {
116   // no need to delete child widgets, Qt does it all for us
117 }
118
119 void OperationGUI_PartitionDlg::SetListMaterials( GEOM::ListOfLong ListMaterials )
120 {
121   myListMaterials = ListMaterials;
122 }
123
124 GEOM::ListOfLong OperationGUI_PartitionDlg::GetListMaterials()
125 {
126   return myListMaterials;
127 }
128
129 //=================================================================================
130 // function : Init()
131 // purpose  :
132 //=================================================================================
133 void OperationGUI_PartitionDlg::Init()
134 {
135   /* type for sub-shape selection */
136   GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_SOLID" ) );
137   GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::SOLID);
138   GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_SHELL" ) );
139   GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::SHELL);
140   GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_FACE" ) );
141   GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::FACE);
142   GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_WIRE" ) );
143   GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::WIRE);
144   GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_EDGE" ) );
145   GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::EDGE);
146   GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_VERTEX" ) );
147   GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::VERTEX);
148   GroupPoints->CheckButton1->setChecked( false );
149   mySelfInte->setChecked(false);
150
151   mainFrame()->GroupBoxPublish->show();
152
153   /* signals and slots connections */
154   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
155   connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
156
157   connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
158
159   connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
160   connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
161
162   connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
163   connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
164
165   connect( GroupPoints->ComboBox1, SIGNAL( activated( int ) ), this, SLOT( ComboTextChanged() ) );
166
167   connect( myGeomGUI->getApp()->selectionMgr(),
168            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
169
170   connect( GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(processPreview()) );
171   connect( GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(processPreview()) );
172   connect( GroupPoints->CheckButton2, SIGNAL(toggled(bool)), mySelfInte, SLOT(setEnabled(bool)) );
173   connect( mySelfInte,                SIGNAL(toggled(bool)), this, SLOT(processPreview()) );
174
175   mySelfInte->setEnabled(GroupPoints->CheckButton2->isChecked());
176   initName( tr( "GEOM_PARTITION" ) );
177
178   ConstructorsClicked( 0 );
179   GroupPoints->PushButton1->click();
180 }
181
182
183 //=================================================================================
184 // function : ConstructorsClicked()
185 // purpose  : Radio button management
186 //=================================================================================
187 void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId )
188 {
189   disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
190   globalSelection();
191
192   //myListShapes.length( 0 );
193   //myListTools.length( 0 );
194   //myListKeepInside.length( 0 );   // obsolete
195   //myListRemoveInside.length( 0 ); // obsolete
196   //myListMaterials.length( 0 );    // obsolete
197
198   switch ( constructorId ) {
199   case 0: /*Full partition */
200     GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) );
201     GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
202     GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) );
203     GroupPoints->TextLabel3->show();
204     GroupPoints->ComboBox1->show();
205     GroupPoints->ComboBox1->setCurrentIndex( 0 );
206     GroupPoints->CheckButton1->show();
207     GroupPoints->CheckButton2->show();
208     mySelfInte->show();
209     GroupPoints->PushButton1->setDown( true );
210     GroupPoints->PushButton2->setDown( false );
211     GroupPoints->LineEdit1->setEnabled(true);
212     GroupPoints->LineEdit2->setEnabled(false);
213     break;
214   case 1: /*Half-space partition */
215     GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION_HALFSPACE" ) );
216     GroupPoints->TextLabel3->hide();
217     GroupPoints->ComboBox1->hide();
218     GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
219     GroupPoints->TextLabel2->setText( tr( "GEOM_PLANE" ) );
220     GroupPoints->CheckButton1->hide();
221     GroupPoints->CheckButton2->hide();
222     mySelfInte->hide();
223     GroupPoints->PushButton1->setDown( true );
224     GroupPoints->LineEdit1->setEnabled(true);
225     break;
226   }
227
228   myEditCurrentArgument = GroupPoints->LineEdit1;
229   GroupPoints->LineEdit1->clear();
230   GroupPoints->LineEdit2->clear();
231
232   qApp->processEvents();
233   updateGeometry();
234   resize( minimumSizeHint() );
235
236   myEditCurrentArgument->setFocus();
237   connect( myGeomGUI->getApp()->selectionMgr(),
238            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
239   SelectionIntoArgument();
240 }
241
242
243 //=================================================================================
244 // function : ClickOnOk()
245 // purpose  :
246 //=================================================================================
247 void OperationGUI_PartitionDlg::ClickOnOk()
248 {
249   setIsApplyAndClose( true );
250   if ( ClickOnApply() )
251     ClickOnCancel();
252 }
253
254
255 //=================================================================================
256 // function : ClickOnApply()
257 // purpose  :
258 //=================================================================================
259 bool OperationGUI_PartitionDlg::ClickOnApply()
260 {
261   if ( !onAccept() )
262     return false;
263
264   initName();
265   //  0020854: EDF 1398 GEOM: Ergonomy of Partition GUI window
266   //  ConstructorsClicked( getConstructorId() );
267   return true;
268 }
269
270
271 //=================================================================================
272 // function : SelectionIntoArgument()
273 // purpose  : Called when selection as changed or other case
274 //=================================================================================
275 void OperationGUI_PartitionDlg::SelectionIntoArgument()
276 {
277   myEditCurrentArgument->setText( "" );
278   QString aString = "";
279
280   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
281   SALOME_ListIO aSelList;
282   aSelMgr->selectedObjects(aSelList);
283
284   int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
285
286   if ( getConstructorId() == 1 ) {
287     // for half-selection, only one shape can be selected as an object
288     // and only one plane as a tool
289     if ( nbSel != 1 ) {
290       if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
291         myListShapes.length( 0 );
292         // myListMaterials.length( 0 ); // obsolete
293         return;
294       }
295       else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
296         myListTools.length( 0 );
297         return;
298       }
299     }
300   }
301   else {
302     if ( nbSel < 1 ) {
303       if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
304         myListShapes.length( 0 );
305         //myListMaterials.length( 0 ); // obsolete
306         return;
307       }
308       else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
309         myListTools.length( 0 );
310         return;
311       }
312     }
313   }
314
315   if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
316     GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
317     //myListMaterials.length( 0 ); // obsolete
318
319     GEOM::shape_type type = GEOM::SHAPE;
320     for (int i = 0; i < (int)myListShapes.length(); i++)
321       type = qMin( type, myListShapes[i]->GetMaxShapeType() );
322     int idx = qMax( 0, GroupPoints->ComboBox1->findData( type ) );
323     GroupPoints->ComboBox1->setCurrentIndex( idx );
324
325     if ( !myListShapes.length() )
326       return;
327   }
328   else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
329     GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListTools, true);
330     if ( !myListTools.length() )
331       return;
332     else if ( myListTools.length() == 1 && getConstructorId() == 1 ) {
333       GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations();
334       GEOM::ListOfLong_var   intList;
335       GEOM::ListOfDouble_var dblList;
336       GEOM::GEOM_IKindOfShape::shape_kind kind = mOp->KindOfShape( myListTools[0].in(), intList.out(), dblList.out() );
337       mOp->UnRegister();
338       if ( kind < GEOM::GEOM_IKindOfShape::DISK_CIRCLE || kind > GEOM::GEOM_IKindOfShape::PLANAR ) {
339         myListTools.length( 0 );
340         return;
341       }
342     }
343   }
344
345   myEditCurrentArgument->setText( aString );
346   processPreview();
347 }
348
349
350 //=================================================================================
351 // function : SetEditCurrentArgument()
352 // purpose  :
353 //=================================================================================
354 void OperationGUI_PartitionDlg::SetEditCurrentArgument()
355 {
356   QPushButton* send = (QPushButton*)sender();
357
358   if ( send == GroupPoints->PushButton1 ) {
359     myEditCurrentArgument = GroupPoints->LineEdit1;
360     GroupPoints->PushButton2->setDown(false);
361     GroupPoints->LineEdit1->setEnabled(true);
362     GroupPoints->LineEdit2->setEnabled(false);
363   }
364   else if ( send == GroupPoints->PushButton2 ) {
365     myGeomGUI->getApp()->selectionMgr()->clearSelected(); //clear prewious selection
366     myEditCurrentArgument = GroupPoints->LineEdit2;
367     GroupPoints->PushButton1->setDown(false);
368     GroupPoints->LineEdit1->setEnabled(false);
369     GroupPoints->LineEdit2->setEnabled(true);
370     if ( getConstructorId() == 1 )
371       globalSelection( GEOM_PLANE  );
372   }
373
374   globalSelection( GEOM_ALLSHAPES );
375
376   myEditCurrentArgument->setFocus();
377   SelectionIntoArgument();
378   send->setDown(true);
379   processPreview();
380 }
381
382
383 //=================================================================================
384 // function : LineEditReturnPressed()
385 // purpose  :
386 //=================================================================================
387 void OperationGUI_PartitionDlg::LineEditReturnPressed()
388 {
389   QLineEdit* send = (QLineEdit*)sender();
390
391   if ( send == GroupPoints->LineEdit1 ||
392        send == GroupPoints->LineEdit2 ) {
393       myEditCurrentArgument = send;
394       GEOMBase_Skeleton::LineEditReturnPressed();
395   }
396 }
397
398
399 //=================================================================================
400 // function : ActivateThisDialog()
401 // purpose  :
402 //=================================================================================
403 void OperationGUI_PartitionDlg::ActivateThisDialog()
404 {
405   GEOMBase_Skeleton::ActivateThisDialog();
406   connect( myGeomGUI->getApp()->selectionMgr(),
407            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
408
409   ConstructorsClicked( getConstructorId() );
410   processPreview();
411 }
412
413
414 //=================================================================================
415 // function : enterEvent()
416 // purpose  :
417 //=================================================================================
418 void OperationGUI_PartitionDlg::enterEvent( QEvent* )
419 {
420   if ( !mainFrame()->GroupConstructors->isEnabled() )
421     this->ActivateThisDialog();
422 }
423
424
425 //=================================================================================
426 // function : createOperation
427 // purpose  :
428 //=================================================================================
429 GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation()
430 {
431   return getGeomEngine()->GetIBooleanOperations();
432 }
433
434
435 //=================================================================================
436 // function : isValid
437 // purpose  :
438 //=================================================================================
439 bool OperationGUI_PartitionDlg::isValid (QString& )
440 {
441   return (getConstructorId() == 0 ?
442           myListShapes.length() :
443           myListShapes.length() && myListTools.length());
444 }
445
446
447 //=================================================================================
448 // function : execute
449 // purpose  :
450 //=================================================================================
451 bool OperationGUI_PartitionDlg::execute (ObjectList& objects)
452 {
453   bool res = false;
454   GEOM::GEOM_Object_var anObj;
455
456   GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
457
458   switch ( getConstructorId() ) {
459   case 0:
460     {
461       bool isDetectSelfInte    = mySelfInte->isChecked();
462       int aLimit               = GetLimit();
463       int aKeepNonlimitShapes  = GroupPoints->CheckButton1->isChecked();
464       bool aNoSelfIntersection = GroupPoints->CheckButton2->isChecked();
465
466       anObj = aNoSelfIntersection ?
467         anOper->MakePartitionNonSelfIntersectedShape(myListShapes, myListTools,
468                                                      myListKeepInside, myListRemoveInside,
469                                                      aLimit, false, myListMaterials, aKeepNonlimitShapes,
470                                                      isDetectSelfInte) :
471         anOper->MakePartition(myListShapes, myListTools,
472                               myListKeepInside, myListRemoveInside,
473                               aLimit, false, myListMaterials, aKeepNonlimitShapes);
474       res = true;
475     }
476     break;
477   case 1:
478     {
479       anObj = anOper->MakeHalfPartition(myListShapes[0].in(), myListTools[0].in());
480       res = true;
481     }
482     break;
483   }
484
485   if ( !anObj->_is_nil() ) {
486     TopoDS_Shape aShape;
487     GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE );
488     TopoDS_Iterator It( aShape, Standard_True, Standard_True );
489     int nbSubshapes = 0;
490     for (; It.More(); It.Next())
491       nbSubshapes++;
492
493     if ( nbSubshapes )
494       objects.push_back( anObj._retn() );
495     else
496       SUIT_MessageBox::warning( this,
497                                 QObject::tr( "GEOM_ERROR" ),
498                                 QObject::tr( "GEOM_WRN_PARTITION_RESULT_EMPTY" ) );
499   }
500
501   return res;
502 }
503
504 //=================================================================================
505 // function : restoreSubShapes
506 // purpose  :
507 //=================================================================================
508 void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
509 {
510   if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
511     // empty list of arguments means that all arguments should be restored
512     getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
513                                          /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
514                                          /*theInheritFirstArg=*/myListShapes.length() == 1 && myListTools.length() == 0,
515                                          mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false
516   }
517 }
518
519 //=======================================================================
520 //function : ComboTextChanged
521 //purpose  :
522 //=======================================================================
523 void OperationGUI_PartitionDlg::ComboTextChanged()
524 {
525   //bool IsEnabled = GroupPoints->ComboBox1->currentItem() < 3;
526   //GroupPoints->LineEdit3->setEnabled(IsEnabled);
527   //GroupPoints->LineEdit4->setEnabled(IsEnabled);
528   //GroupPoints->TextLabel4->setEnabled(IsEnabled);
529   //GroupPoints->TextLabel5->setEnabled(IsEnabled);
530   //GroupPoints->PushButton3->setEnabled(IsEnabled);
531   //GroupPoints->PushButton4->setEnabled(IsEnabled);
532   processPreview();
533 }
534
535 //=================================================================================
536 // function : GetLimit()
537 // purpose  :
538 //=================================================================================
539 int OperationGUI_PartitionDlg::GetLimit() const
540 {
541   int aLimit = GroupPoints->ComboBox1->currentIndex();
542
543   switch ( aLimit ) {
544   case 0:  aLimit = GEOM::SOLID ; break;
545   case 1:  aLimit = GEOM::SHELL ; break;
546   case 2:  aLimit = GEOM::FACE  ; break;
547   case 3:  aLimit = GEOM::WIRE  ; break;
548   case 4:  aLimit = GEOM::EDGE  ; break;
549   case 5:  aLimit = GEOM::VERTEX; break;
550   default: aLimit = GEOM::SHAPE ;
551   }
552
553   return aLimit;
554 }
555
556 //=================================================================================
557 // function : getSourceObjects
558 // purpose  : virtual method to get source objects
559 //=================================================================================
560 QList<GEOM::GeomObjPtr> OperationGUI_PartitionDlg::getSourceObjects()
561 {
562   QList<GEOM::GeomObjPtr> res;
563   for (int i = 0; i < (int)myListShapes.length(); i++) {
564     GEOM::GeomObjPtr aGeomObjPtr(myListShapes[i]);
565     res << aGeomObjPtr;
566   }
567   for (int i = 0; i < (int)myListTools.length(); i++) {
568     GEOM::GeomObjPtr aGeomObjPtr(myListTools[i]);
569     res << aGeomObjPtr;
570   }
571   for (int i = 0; i < (int)myListRemoveInside.length(); i++) {
572     GEOM::GeomObjPtr aGeomObjPtr(myListRemoveInside[i]);
573     res << aGeomObjPtr;
574   }
575   for (int i = 0; i < (int)myListKeepInside.length(); i++) {
576     GEOM::GeomObjPtr aGeomObjPtr(myListKeepInside[i]);
577     res << aGeomObjPtr;
578   }
579   return res;
580 }