]> SALOME platform Git repositories - modules/geom.git/blob - src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
Salome HOME
9e5e91a97b83ad142dc1b246f531ec9fc583e7fa
[modules/geom.git] / src / BlocksGUI / BlocksGUI_TrsfDlg.cxx
1 //  Copyright (C) 2007-2008  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.
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 // GEOM GEOMGUI : GUI for Geometry component
23 // File   : BlocksGUI_TrsfDlg.cxx
24 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
25 //
26 #include "BlocksGUI_TrsfDlg.h"
27
28 #include <DlgRef.h>
29 #include <GeometryGUI.h>
30 #include <GEOMBase.h>
31
32 #include <SUIT_Session.h>
33 #include <SUIT_Desktop.h>
34 #include <SUIT_ResourceMgr.h>
35 #include <SUIT_ViewWindow.h>
36 #include <SUIT_ViewManager.h>
37 #include <SalomeApp_Application.h>
38 #include <LightApp_SelectionMgr.h>
39 #include <OCCViewer_ViewModel.h>
40
41 // OCCT Includes
42 #include <TColStd_IndexedMapOfInteger.hxx>
43
44 //=================================================================================
45 // class    : BlocksGUI_TrsfDlg()
46 // purpose  : Constructs a BlocksGUI_TrsfDlg which is a child of 'parent'.
47 //=================================================================================
48 BlocksGUI_TrsfDlg::BlocksGUI_TrsfDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
49   : GEOMBase_Skeleton(theGeometryGUI, parent),
50     myInitial(true)
51 {
52   SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
53   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_MULTITRSF_SIMPLE")));
54   QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_MULTITRSF_DOUBLE")));
55   QPixmap imageS (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
56
57   setWindowTitle(tr("GEOM_BLOCK_MULTITRSF_TITLE"));
58
59   /***************************************************************/
60   mainFrame()->GroupConstructors->setTitle(tr("GEOM_BLOCK_MULTITRSF"));
61
62   mainFrame()->RadioButton1->setIcon(image1);
63   mainFrame()->RadioButton2->setIcon(image2);
64   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
65   mainFrame()->RadioButton3->close();
66
67   // Create first group
68   myGrp1 = new QGroupBox(tr("GEOM_BLOCK_MULTITRSF_SIMPLE"), centralWidget());
69
70   createSelWg(tr("GEOM_MAIN_OBJECT"), imageS, myGrp1, MainObj1);
71   createSelWg(tr("FACE_1"),           imageS, myGrp1, Face1);
72   createSelWg(tr("FACE_2"),           imageS, myGrp1, Face2);
73   createSpinWg(tr("GEOM_NB_TIMES"),           myGrp1, SpinBox1);
74
75   // Create second group
76   myGrp2 = new QGroupBox(tr("GEOM_BLOCK_MULTITRSF_DOUBLE"), centralWidget());
77
78   createSelWg(tr("GEOM_MAIN_OBJECT"), imageS, myGrp2, MainObj2);
79   createSelWg(tr("FACE_1U"),          imageS, myGrp2, Face1U);
80   createSelWg(tr("FACE_2U"),          imageS, myGrp2, Face2U);
81   createSpinWg(tr("GEOM_NB_TIMES_U"),         myGrp2, SpinBox2U);
82   createSelWg(tr("FACE_1V"),          imageS, myGrp2, Face1V);
83   createSelWg(tr("FACE_2V"),          imageS, myGrp2, Face2V);
84   createSpinWg(tr("GEOM_NB_TIMES_V"),         myGrp2, SpinBox2V);
85
86   // Add groups to layout
87   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
88   layout->setMargin(0); layout->setSpacing(6);
89   layout->addWidget(myGrp1);
90   layout->addWidget(myGrp2);
91   /***************************************************************/
92
93   setHelpFileName("multi_transformation_operation_page.html");
94
95   Init();
96 }
97
98 //=================================================================================
99 // function : ~BlocksGUI_TrsfDlg()
100 // purpose  : Destroys the object and frees any allocated resources
101 //=================================================================================
102 BlocksGUI_TrsfDlg::~BlocksGUI_TrsfDlg()
103 {
104   // no need to delete child widgets, Qt does it all for us
105 }
106
107 //=================================================================================
108 // function : Init()
109 // purpose  :
110 //=================================================================================
111 void BlocksGUI_TrsfDlg::Init()
112 {
113   // Set range of spinboxes
114   double SpecificStep = 1.0;
115   QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIter;
116   for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) {
117     //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3);
118     initSpinBox(anIter.value(), 1.0, 999, SpecificStep, 3);
119   }
120
121   // signals and slots connections
122   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
123   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
124
125   connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
126
127   QMap<int, QPushButton*>::iterator anIterBtn;
128   for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn)
129     connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
130
131   QMap<int, SalomeApp_DoubleSpinBox*>::iterator anIterSpin;
132   for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin)
133     connect(anIterSpin.value(), SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
134
135   // init controls and fields
136   initName(tr("GEOM_BLOCK_MULTITRSF"));
137
138   myConstructorId = -1;
139   ConstructorsClicked(0);
140 }
141
142 //=================================================================================
143 // function : ConstructorsClicked()
144 // purpose  : Radio button management
145 //=================================================================================
146 void BlocksGUI_TrsfDlg::ConstructorsClicked (int constructorId)
147 {
148   if (myConstructorId == constructorId)
149     return;
150
151   myConstructorId = constructorId;
152
153   // init fields
154   myShape = GEOM::GEOM_Object::_nil();
155   myFaces[Face1] = myFaces[Face2] = -1;
156   myFaces[Face1U] = myFaces[Face2U] = -1;
157   myFaces[Face1V] = myFaces[Face2V] = -1;
158
159   // clear line edits
160   QMap<int, QLineEdit*>::iterator anIterLE;
161   for (anIterLE = mySelName.begin(); anIterLE != mySelName.end(); ++anIterLE)
162     anIterLE.value()->setText("");
163
164   switch (constructorId) {
165   case 0:
166     myGrp2->hide();
167     myGrp1->show();
168     mySpinBox[SpinBox1]->setValue(2);
169     mySpinBox[SpinBox1]->setDecimals(0);
170     mySelBtn[MainObj1]->click();
171     break;
172   case 1:
173     myGrp1->hide();
174     myGrp2->show();
175     mySpinBox[SpinBox2U]->setValue(2);
176     mySpinBox[SpinBox2U]->setDecimals(0);
177     mySpinBox[SpinBox2V]->setValue(2);
178     mySpinBox[SpinBox2V]->setDecimals(0);
179     mySelBtn[MainObj2]->click();
180     break;
181   default:
182     break;
183   }
184
185   qApp->processEvents();
186   updateGeometry();
187   resize(minimumSizeHint());
188
189   // on dialog initialization we init the first field with a selected object (if any)
190   SelectionIntoArgument();
191 }
192
193 //=================================================================================
194 // function : ClickOnOk()
195 // purpose  :
196 //=================================================================================
197 void BlocksGUI_TrsfDlg::ClickOnOk()
198 {
199   if (ClickOnApply())
200     ClickOnCancel();
201 }
202
203 //=================================================================================
204 // function : ClickOnApply()
205 // purpose  :
206 //=================================================================================
207 bool BlocksGUI_TrsfDlg::ClickOnApply()
208 {
209   if (!onAccept())
210     return false;
211
212   initName();
213   return true;
214 }
215
216 //=================================================================================
217 // function : SelectionIntoArgument()
218 // purpose  : Called when selection is changed or on dialog initialization or activation
219 //=================================================================================
220 void BlocksGUI_TrsfDlg::SelectionIntoArgument()
221 {
222   erasePreview();
223   myEditCurrentArgument->setText("");
224
225   // Get index of current selection focus
226   int aCurrFocus = -1;
227   QMap<int, QLineEdit*>::iterator anIter;
228   for (anIter = mySelName.begin(); anIter != mySelName.end(); ++anIter) {
229     if (myEditCurrentArgument == anIter.value()) {
230       aCurrFocus = anIter.key();
231       break;
232     }
233   }
234
235   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
236   SALOME_ListIO aSelList;
237   aSelMgr->selectedObjects(aSelList);
238
239   QString aName;
240   GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_nil();
241
242   if (aCurrFocus == MainObj1 || aCurrFocus == MainObj2)
243   {
244     // If selection of main object is activated
245     if (aSelList.Extent() == 1) {
246       Standard_Boolean aResult = Standard_False;
247       anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
248
249       if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
250         aName = GEOMBase::GetName(anObj);
251       }
252     }
253     myEditCurrentArgument->setText(aName);
254     myShape = anObj;
255     enableWidgets();
256   }
257   else if (aCurrFocus == Face1  || aCurrFocus == Face2  ||
258            aCurrFocus == Face1U || aCurrFocus == Face2U ||
259            aCurrFocus == Face1V || aCurrFocus == Face2V) {
260     // If face selection is activated
261     int anIndex = -1;
262     if (aSelList.Extent() == 1) {
263       Standard_Boolean aResult = Standard_False;
264       anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
265       if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
266         aName = GEOMBase::GetName(anObj);
267         TColStd_IndexedMapOfInteger anIndexes;
268         aSelMgr->GetIndexes(aSelList.First(), anIndexes);
269
270         if (anIndexes.Extent() == 1) {
271           anIndex = anIndexes(1);
272           aName += QString(":face_%1").arg(anIndex);
273         }
274       }
275     }
276     myEditCurrentArgument->setText(aName);
277     myFaces[aCurrFocus] = anIndex;
278     displayPreview();
279   }
280
281   switch (aCurrFocus) {
282     // 1D
283   case MainObj1:
284     if (!myShape->_is_nil() && myFaces[Face1] == -1)
285       mySelBtn[Face1]->click();
286     break;
287   case Face1:
288     if (myFaces[Face1] != -1 && myFaces[Face2] == -1)
289       mySelBtn[Face2]->click();
290     break;
291   case Face2:
292     if (myFaces[Face2] != -1 && myShape->_is_nil())
293       mySelBtn[MainObj1]->click();
294     break;
295
296     // 2D
297   case MainObj2:
298     if (!myShape->_is_nil() && myFaces[Face1U] == -1)
299       mySelBtn[Face1U]->click();
300     break;
301   case Face1U:
302     if (myFaces[Face1U] != -1 && myFaces[Face2U] == -1)
303       mySelBtn[Face2U]->click();
304     break;
305   case Face2U:
306     if (myFaces[Face2U] != -1 && myFaces[Face1V] == -1)
307       mySelBtn[Face1V]->click();
308     break;
309   case Face1V:
310     if (myFaces[Face1V] != -1 && myFaces[Face2V] == -1)
311       mySelBtn[Face2V]->click();
312     break;
313   case Face2V:
314     if (myFaces[Face2V] != -1 && myShape->_is_nil())
315       mySelBtn[MainObj1]->click();
316     break;
317
318   default:
319     break;
320   }
321 }
322
323 //=================================================================================
324 // function : SetEditCurrentArgument()
325 // purpose  :
326 //=================================================================================
327 void BlocksGUI_TrsfDlg::SetEditCurrentArgument()
328 {
329   QPushButton* aSender = (QPushButton*)sender();
330
331   // clear selection
332   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
333   if (myInitial)
334     myInitial = false;
335   else
336     myGeomGUI->getApp()->selectionMgr()->clearSelected();
337
338   // disable all
339   switch (myConstructorId) {
340   case 0:
341     mySelBtn[MainObj1]->setDown(false);
342     mySelBtn[Face1]->setDown(false);
343     mySelBtn[Face2]->setDown(false);
344
345     mySelName[MainObj1]->setEnabled(false);
346     mySelName[Face1]->setEnabled(false);
347     mySelName[Face2]->setEnabled(false);
348     break;
349   case 1:
350     mySelBtn[MainObj2]->setDown(false);
351     mySelBtn[Face1U]->setDown(false);
352     mySelBtn[Face2U]->setDown(false);
353     mySelBtn[Face1V]->setDown(false);
354     mySelBtn[Face2V]->setDown(false);
355
356     mySelName[MainObj2]->setEnabled(false);
357     mySelName[Face1U]->setEnabled(false);
358     mySelName[Face2U]->setEnabled(false);
359     mySelName[Face1V]->setEnabled(false);
360     mySelName[Face2V]->setEnabled(false);
361     break;
362   default:
363     break;
364   }
365
366   // set line edit as current argument
367   QMap<int, QPushButton*>::iterator anIter;
368   for (anIter = mySelBtn.begin(); anIter != mySelBtn.end(); ++anIter) {
369     if (anIter.value() == aSender) {
370       myEditCurrentArgument = mySelName[anIter.key()];
371       break;
372     }
373   }
374
375   // enable line edit
376   myEditCurrentArgument->setEnabled(true);
377   myEditCurrentArgument->setFocus();
378
379   // enable push button
380   // after setFocus(), because it will be setDown(false) when loses focus
381   aSender->setDown(true);
382
383   activateSelection();
384 }
385
386 //=================================================================================
387 // function : ActivateThisDialog()
388 // purpose  :
389 //=================================================================================
390 void BlocksGUI_TrsfDlg::ActivateThisDialog()
391 {
392   GEOMBase_Skeleton::ActivateThisDialog();
393   activateSelection();
394
395   // ??
396   displayPreview();
397 }
398
399 //=================================================================================
400 // function : enterEvent()
401 // purpose  :
402 //=================================================================================
403 void BlocksGUI_TrsfDlg::enterEvent (QEvent*)
404 {
405   if (!mainFrame()->GroupConstructors->isEnabled())
406     ActivateThisDialog();
407 }
408
409 //=================================================================================
410 // function : ValueChangedInSpinBox()
411 // purpose  :
412 //=================================================================================
413 void BlocksGUI_TrsfDlg::ValueChangedInSpinBox(int)
414 {
415   displayPreview();
416 }
417
418 //=================================================================================
419 // function : createSelWg()
420 // purpose  :
421 //=================================================================================
422 void BlocksGUI_TrsfDlg::createSelWg (const QString& theLbl,
423                                      QPixmap&       thePix,
424                                      QWidget*       theParent,
425                                      const int      theId)
426 {
427   QLabel* lab = new QLabel(theLbl, theParent);
428   mySelBtn[theId] = new QPushButton(theParent);
429   mySelBtn[theId]->setIcon(thePix);
430   mySelBtn[theId]->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
431   mySelName[theId] = new QLineEdit(theParent);
432   mySelName[theId]->setReadOnly(true);
433   QGridLayout* l = 0;
434   if (!theParent->layout()) {
435     l = new QGridLayout(theParent);
436     l->setMargin(9); l->setSpacing(6);
437   }
438   else {
439     l = qobject_cast<QGridLayout*>(theParent->layout());
440   }
441   int row = l->rowCount();
442   l->addWidget(lab,              row, 0);
443   l->addWidget(mySelBtn[theId],  row, 1);
444   l->addWidget(mySelName[theId], row, 2);
445 }
446
447 //=================================================================================
448 // function : createSpinWg()
449 // purpose  :
450 //=================================================================================
451 void BlocksGUI_TrsfDlg::createSpinWg (const QString& theLbl,
452                                       QWidget*       theParent,
453                                       const int      theId)
454 {
455   QLabel* lab = new QLabel(theLbl, theParent);
456   mySpinBox[theId] = new SalomeApp_DoubleSpinBox(theParent);
457   QGridLayout* l = 0;
458   if (!theParent->layout()) {
459     l = new QGridLayout(theParent);
460     l->setMargin(9); l->setSpacing(6);
461   }
462   else {
463     l = qobject_cast<QGridLayout*>(theParent->layout());
464   }
465   int row = l->rowCount();
466   l->addWidget(lab,              row, 0);
467   l->addWidget(mySpinBox[theId], row, 2);
468 }
469
470 //=================================================================================
471 // function : activateSelection
472 // purpose  : Activate selection in accordance with myEditCurrentArgument
473 //=================================================================================
474 void BlocksGUI_TrsfDlg::activateSelection()
475 {
476   globalSelection(GEOM_ALLSHAPES);
477   if (!myShape->_is_nil() &&
478       (myEditCurrentArgument == mySelName[Face1 ] ||
479        myEditCurrentArgument == mySelName[Face2 ] ||
480        myEditCurrentArgument == mySelName[Face1U] ||
481        myEditCurrentArgument == mySelName[Face2U] ||
482        myEditCurrentArgument == mySelName[Face1V] ||
483        myEditCurrentArgument == mySelName[Face2V]))
484   {
485     // Local selection is available only in the OCC Viewer
486     if (getDesktop()->activeWindow()->getViewManager()->getType() == OCCViewer_Viewer::Type()) {
487       localSelection(myShape, TopAbs_FACE);
488     }
489   }
490   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
491           this, SLOT(SelectionIntoArgument()));
492 }
493
494 //=================================================================================
495 // function : enableWidgets
496 // purpose  : Enable widgets of faces in accordance with value of main object
497 //=================================================================================
498 void BlocksGUI_TrsfDlg::enableWidgets()
499 {
500   int anId = getConstructorId();
501
502   bool toEnable = !myShape->_is_nil();
503
504   if (anId == 0) {
505     //mySelName[Face1]->setEnabled(toEnable);
506     //mySelName[Face2]->setEnabled(toEnable);
507     //mySelBtn[Face1]->setEnabled(toEnable);
508     //mySelBtn[Face2]->setEnabled(toEnable);
509
510     if (!toEnable)  {
511       mySelName[Face1]->setText("");
512       mySelName[Face2]->setText("");
513       myFaces[Face1] = -1;
514       myFaces[Face2] = -1;
515     }
516   }
517   else if (anId == 1) {
518     //mySelName[Face1U]->setEnabled(toEnable);
519     //mySelName[Face2U]->setEnabled(toEnable);
520     //mySelName[Face1V]->setEnabled(toEnable);
521     //mySelName[Face2V]->setEnabled(toEnable);
522     //mySelBtn[Face1U]->setEnabled(toEnable);
523     //mySelBtn[Face2U]->setEnabled(toEnable);
524     //mySelBtn[Face1V]->setEnabled(toEnable);
525     //mySelBtn[Face2V]->setEnabled(toEnable);
526
527     if (!toEnable) {
528       mySelName[Face1U]->setText("");
529       mySelName[Face2U]->setText("");
530       mySelName[Face1V]->setText("");
531       mySelName[Face2V]->setText("");
532       myFaces[Face1U] = -1;
533       myFaces[Face2U] = -1;
534       myFaces[Face1V] = -1;
535       myFaces[Face2V] = -1;
536     }
537   }
538 }
539
540 //=================================================================================
541 // function : createOperation
542 // purpose  :
543 //=================================================================================
544 GEOM::GEOM_IOperations_ptr BlocksGUI_TrsfDlg::createOperation()
545 {
546   return getGeomEngine()->GetIBlocksOperations(getStudyId());
547 }
548
549 //=================================================================================
550 // function : isValid
551 // purpose  : Verify validity of input data
552 //=================================================================================
553 bool BlocksGUI_TrsfDlg::isValid (QString& msg)
554 {
555   bool ok = false, okSP = true;
556   switch (getConstructorId()) {
557   case 0:
558     ok = !myShape->_is_nil() && myFaces[Face1] > 0;
559     okSP = mySpinBox[SpinBox1]->isValid( msg, !IsPreview() );
560     break;
561   case 1:
562     ok = !myShape->_is_nil() && myFaces[Face1U] > 0 && myFaces[Face1V] > 0;
563     okSP = mySpinBox[SpinBox2U]->isValid( msg, !IsPreview() ) && okSP;
564     okSP = mySpinBox[SpinBox2V]->isValid( msg, !IsPreview() ) && okSP;
565     break;
566   default:
567     break;
568   }
569   return ok && okSP;
570 }
571
572 //=================================================================================
573 // function : execute
574 // purpose  :
575 //=================================================================================
576 bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
577 {
578   bool res = false;
579
580   GEOM::GEOM_Object_var anObj;
581
582   switch (getConstructorId()) {
583   case 0:
584     anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
585       MakeMultiTransformation1D(myShape,
586                                 myFaces[Face1], myFaces[Face2],
587                                 mySpinBox[SpinBox1]->value());
588     if (!anObj->_is_nil() && !IsPreview())
589     {
590       QStringList aParameters;
591       aParameters << "" << "";
592       aParameters << mySpinBox[SpinBox1]->text();
593       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
594     }
595     res = true;
596     break;
597   case 1:
598     anObj = GEOM::GEOM_IBlocksOperations::_narrow(getOperation())->
599       MakeMultiTransformation2D (myShape,
600                                  myFaces[Face1U], myFaces[Face2U],
601                                  mySpinBox[SpinBox2U]->value(),
602                                  myFaces[Face1V], myFaces[Face2V],
603                                  mySpinBox[SpinBox2V]->value());
604     if (!anObj->_is_nil() && !IsPreview())
605     {
606       QStringList aParameters;
607       aParameters << "" << "";
608       aParameters << mySpinBox[SpinBox2U]->text();
609       aParameters << "" << "";
610       aParameters << mySpinBox[SpinBox2V]->text();
611       anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
612     }
613     res = true;
614     break;
615   default:
616     break;
617   }
618
619   if (!anObj->_is_nil())
620     objects.push_back(anObj._retn());
621
622   return res;
623 }