Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/geom.git] / src / GenerationGUI / GenerationGUI_PrismDlg.cxx
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  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 //
23 //
24 //  File   : GenerationGUI_PrismDlg.cxx
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #include "GenerationGUI_PrismDlg.h"
30
31 #include "SUIT_Desktop.h"
32 #include "SUIT_Session.h"
33 #include "SalomeApp_Application.h"
34 #include "LightApp_SelectionMgr.h"
35
36 #include <TopoDS_Shape.hxx>
37 #include <TopoDS_Edge.hxx>
38 #include <TopoDS.hxx>
39 #include <TopExp.hxx>
40 #include <TColStd_IndexedMapOfInteger.hxx>
41 #include <TopTools_IndexedMapOfShape.hxx>
42
43 #include <qlabel.h>
44 #include <qcheckbox.h>
45
46 #include "GEOMImpl_Types.hxx"
47
48 #include "utilities.h"
49
50 //=================================================================================
51 // class    : GenerationGUI_PrismDlg()
52 // purpose  : Constructs a GenerationGUI_PrismDlg which is a child of 'parent', with the
53 //            name 'name' and widget flags set to 'f'.
54 //            The dialog will by default be modeless, unless you set 'modal' to
55 //            TRUE to construct a modal dialog.
56 //=================================================================================
57 GenerationGUI_PrismDlg::GenerationGUI_PrismDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
58                                                const char* name, bool modal, WFlags fl)
59   : GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
60                       WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
61 {
62   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
63   QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM")));
64   QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
65   QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PRISM_2P")));
66
67   setCaption(tr("GEOM_EXTRUSION_TITLE"));
68
69   /***************************************************************/
70   GroupConstructors->setTitle(tr("GEOM_EXTRUSION"));
71   RadioButton1->setPixmap(image0);
72   RadioButton2->setPixmap(image2);
73   RadioButton3->close(TRUE);
74
75   RadioButton1->setChecked(true);
76   myBothway = myBothway2 = false;
77
78   GroupPoints = new DlgRef_2Sel1Spin2Check(this, "GroupPoints");
79   GroupPoints->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV"));
80   GroupPoints->TextLabel1->setText(tr("GEOM_BASE"));
81   GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
82   GroupPoints->TextLabel3->setText(tr("GEOM_HEIGHT"));
83   GroupPoints->PushButton1->setPixmap(image1);
84   GroupPoints->PushButton2->setPixmap(image1);
85   GroupPoints->LineEdit1->setReadOnly( true );
86   GroupPoints->LineEdit2->setReadOnly( true );
87   GroupPoints->CheckButton1->setText(tr("GEOM_BOTHWAY"));
88   GroupPoints->CheckButton1->setChecked(myBothway);
89   GroupPoints->CheckButton2->setText(tr("GEOM_REVERSE"));
90
91   GroupPoints2 = new DlgRef_3Sel1Check_QTD(this, "GroupPoints2");
92   GroupPoints2->GroupBox1->setTitle(tr("GEOM_EXTRUSION_BSV_2P"));
93   GroupPoints2->TextLabel1->setText(tr("GEOM_BASE"));
94   GroupPoints2->TextLabel2->setText(tr("GEOM_POINT_I").arg("1"));
95   GroupPoints2->TextLabel3->setText(tr("GEOM_POINT_I").arg("2"));
96   GroupPoints2->PushButton1->setPixmap(image1);
97   GroupPoints2->PushButton2->setPixmap(image1);
98   GroupPoints2->PushButton3->setPixmap(image1);
99   GroupPoints2->CheckButton1->setText(tr("GEOM_BOTHWAY"));
100   GroupPoints2->CheckButton1->setChecked(myBothway2);
101
102   Layout1->addWidget(GroupPoints, 2, 0);
103   Layout1->addWidget(GroupPoints2, 2, 0);
104   /***************************************************************/
105
106   setHelpFileName("create_extrusion_page.html");
107
108   Init();
109 }
110
111
112 //=================================================================================
113 // function : ~GenerationGUI_PrismDlg()
114 // purpose  : Destroys the object and frees any allocated resources
115 //=================================================================================
116 GenerationGUI_PrismDlg::~GenerationGUI_PrismDlg()
117 {
118   // no need to delete child widgets, Qt does it all for us
119 }
120
121
122 //=================================================================================
123 // function : Init()
124 // purpose  :
125 //=================================================================================
126 void GenerationGUI_PrismDlg::Init()
127 {
128   /* init variables */
129   myEditCurrentArgument = GroupPoints->LineEdit1;
130   GroupPoints->LineEdit1->setReadOnly( true );
131   GroupPoints->LineEdit2->setReadOnly( true );
132
133   GroupPoints2->LineEdit1->setReadOnly( true );
134   GroupPoints2->LineEdit2->setReadOnly( true );
135   GroupPoints2->LineEdit3->setReadOnly( true );
136
137   myPoint1 = myPoint2 = myBase = myVec = GEOM::GEOM_Object::_nil();
138   myOkBase = myOkVec = myOkPnt1 = myOkPnt2 = false;
139
140   /* Get setting of step value from file configuration */
141   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
142   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
143
144   /* min, max, step and decimals for spin boxes & initial values */
145   GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
146   GroupPoints->SpinBox_DX->SetValue(100.0);
147
148   /* signals and slots connections */
149   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
150   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
151
152   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
153
154   connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
155   connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
156
157   connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
158   connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
159
160   connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
161   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
162           GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
163
164   connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway()));
165   connect(GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(onReverse()));
166
167   connect(GroupPoints2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
168   connect(GroupPoints2->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
169   connect(GroupPoints2->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
170   connect(GroupPoints2->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(onBothway2()));
171
172   connect(GroupPoints2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
173   connect(GroupPoints2->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
174   connect(GroupPoints2->LineEdit3, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
175
176
177   connect(myGeomGUI->getApp()->selectionMgr(),
178           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
179
180   initName(tr("GEOM_EXTRUSION"));
181   ConstructorsClicked(0);
182 }
183
184
185 //=================================================================================
186 // function : ConstructorsClicked()
187 // purpose  : Radio button management
188 //=================================================================================
189 void GenerationGUI_PrismDlg::ConstructorsClicked(int constructorId)
190 {
191   erasePreview();
192   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
193
194   switch (constructorId)
195   {
196   case 0:
197     {
198       globalSelection( GEOM_ALLSHAPES );
199
200       GroupPoints2->hide();
201       resize(0, 0);
202       GroupPoints->show();
203
204       myEditCurrentArgument = GroupPoints->LineEdit1;
205       GroupPoints->LineEdit1->setText(GroupPoints2->LineEdit1->text()); // keep base
206       GroupPoints->LineEdit2->setText("");
207       myVec = GEOM::GEOM_Object::_nil();
208       myOkVec = false;
209
210       break;
211     }
212   case 1:
213     {
214       globalSelection( GEOM_ALLSHAPES );
215
216       GroupPoints->hide();
217       resize(0, 0);
218       GroupPoints2->show();
219
220       myEditCurrentArgument = GroupPoints2->LineEdit1;
221       GroupPoints2->LineEdit1->setText(GroupPoints->LineEdit1->text()); // keep base
222       GroupPoints2->LineEdit2->setText("");
223       GroupPoints2->LineEdit3->setText("");
224       myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
225       myOkPnt1 = myOkPnt2 = false;
226
227       break;
228     }
229   }
230
231   myEditCurrentArgument->setFocus();
232   connect(myGeomGUI->getApp()->selectionMgr(),
233           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
234
235   if (!myOkBase)
236     SelectionIntoArgument();
237 }
238
239
240 //=================================================================================
241 // function : ClickOnOk()
242 // purpose  :
243 //=================================================================================
244 void GenerationGUI_PrismDlg::ClickOnOk()
245 {
246   if ( ClickOnApply() )
247     ClickOnCancel();
248 }
249
250
251 //=================================================================================
252 // function : ClickOnApply()
253 // purpose  :
254 //=================================================================================
255 bool GenerationGUI_PrismDlg::ClickOnApply()
256 {
257   if ( !onAccept() )
258     return false;
259
260   initName();
261   return true;
262 }
263
264
265 //=================================================================================
266 // function : SelectionIntoArgument()
267 // purpose  : Called when selection has changed
268 //=================================================================================
269 void GenerationGUI_PrismDlg::SelectionIntoArgument()
270 {
271   erasePreview();
272   myEditCurrentArgument->setText("");
273
274   if (getConstructorId() == 0)
275   {
276     if (IObjectCount() != 1) {
277       if (myEditCurrentArgument == GroupPoints->LineEdit1)
278         myOkBase = false;
279       else if (myEditCurrentArgument == GroupPoints->LineEdit2)
280         myOkVec = false;
281       return;
282     }
283
284     // nbSel == 1
285     Standard_Boolean testResult = Standard_False;
286     GEOM::GEOM_Object_var aSelectedObject =
287       GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
288
289     if (!testResult)
290       return;
291
292     bool myOk = true;
293     TopoDS_Shape aShape;
294     QString aName = GEOMBase::GetName( aSelectedObject );    
295     if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
296       {
297         LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
298         TColStd_IndexedMapOfInteger aMap;
299         aSelMgr->GetIndexes( firstIObject(), aMap );
300         if ( aMap.Extent() == 1 )
301           {
302             int anIndex = aMap( 1 );
303             aName.append( ":edge_" + QString::number( anIndex ) );
304
305             //Find SubShape Object in Father
306             GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
307
308             if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
309               GEOM::GEOM_IShapesOperations_var aShapesOp =
310                 getGeomEngine()->GetIShapesOperations( getStudyId() );
311               aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
312             }
313             else
314               aSelectedObject = aFindedObject; // get Object from study       
315           }
316         else {
317           if (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints->LineEdit2) {
318             aSelectedObject = GEOM::GEOM_Object::_nil();
319             aName = "";
320             myOk = false;
321           }
322         }
323       }
324  
325     if (myEditCurrentArgument == GroupPoints->LineEdit1) {
326       myBase = aSelectedObject;
327       myOkBase = true;
328     }
329     else if (myEditCurrentArgument == GroupPoints->LineEdit2 && myOk) {
330       myOkVec = true;      
331       myVec = aSelectedObject;
332     }
333     myEditCurrentArgument->setText( aName );
334   }
335   else // getConstructorId()==1 - extrusion using 2 points
336   {
337     if (IObjectCount() != 1) {
338       if (myEditCurrentArgument == GroupPoints2->LineEdit1)
339         myOkBase = false;
340       else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
341         myPoint1 = GEOM::GEOM_Object::_nil();
342         myOkPnt1 = false;
343       }
344       else if (myEditCurrentArgument == GroupPoints2->LineEdit3) {
345         myPoint2 = GEOM::GEOM_Object::_nil();
346         myOkPnt2 = false;
347       }
348       return;
349     }
350
351     // nbSel == 1
352     Standard_Boolean testResult = Standard_False;
353     GEOM::GEOM_Object_var aSelectedObject =
354       GEOMBase::ConvertIOinGEOMObject(firstIObject(), testResult );
355
356     if (!testResult || CORBA::is_nil( aSelectedObject ))
357       return;
358
359     QString aName = GEOMBase::GetName( aSelectedObject );
360     TopoDS_Shape aShape;
361     bool myOk = true;
362     if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
363     {
364         LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
365         TColStd_IndexedMapOfInteger aMap;
366         aSelMgr->GetIndexes( firstIObject(), aMap );
367         if (aMap.Extent() == 1)
368         {
369           int anIndex = aMap(1);
370           aName.append(":vertex_" + QString::number(anIndex));
371
372           //Find SubShape Object in Father
373           GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName);
374             
375           if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
376             GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
377             aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
378           }
379           else
380             aSelectedObject = aFindedObject;
381         }
382         else
383         {
384           if ((aShape.ShapeType() != TopAbs_VERTEX && myEditCurrentArgument == GroupPoints2->LineEdit2) ||
385               (aShape.ShapeType() != TopAbs_VERTEX && myEditCurrentArgument == GroupPoints2->LineEdit3))
386           {
387             aSelectedObject = GEOM::GEOM_Object::_nil();
388             aName = "";
389             myOk = false;
390           }
391         }
392     }
393
394     myEditCurrentArgument->setText(aName);
395
396     if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
397       myBase = aSelectedObject;
398       myOkBase = true;
399     }
400     else if (myEditCurrentArgument == GroupPoints2->LineEdit2 && myOk) {
401       myOkPnt1 = true;
402       myPoint1 = aSelectedObject;
403     }
404     else if (myEditCurrentArgument == GroupPoints2->LineEdit3 && myOk) {
405       myOkPnt2 = true;
406       myPoint2 = aSelectedObject;
407     }
408   }
409
410   displayPreview();
411 }
412
413 //=================================================================================
414 // function : LineEditReturnPressed()
415 // purpose  :
416 //=================================================================================
417 void GenerationGUI_PrismDlg::LineEditReturnPressed()
418 {
419   QLineEdit* send = (QLineEdit*)sender();
420   if (send == GroupPoints->LineEdit1 ||
421       send == GroupPoints->LineEdit2 ||
422       send == GroupPoints2->LineEdit1 ||
423       send == GroupPoints2->LineEdit2 ||
424       send == GroupPoints2->LineEdit3 )
425   {
426     myEditCurrentArgument = send;
427     GEOMBase_Skeleton::LineEditReturnPressed();
428   }
429 }
430
431
432 //=================================================================================
433 // function : SetEditCurrentArgument()
434 // purpose  :
435 //=================================================================================
436 void GenerationGUI_PrismDlg::SetEditCurrentArgument()
437 {
438   QPushButton* send = (QPushButton*)sender();
439   globalSelection( GEOM_ALLSHAPES );
440
441   if (send == GroupPoints->PushButton1) {
442     GroupPoints->LineEdit1->setFocus();
443     myEditCurrentArgument = GroupPoints->LineEdit1;
444   }
445   else if (send == GroupPoints->PushButton2) {
446     GroupPoints->LineEdit2->setFocus();
447     myEditCurrentArgument = GroupPoints->LineEdit2;
448     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
449   }
450   else if (send == GroupPoints2->PushButton1) {
451     GroupPoints2->LineEdit1->setFocus();
452     myEditCurrentArgument = GroupPoints2->LineEdit1;
453   }
454   else if (send == GroupPoints2->PushButton2) {
455     GroupPoints2->LineEdit2->setFocus();
456     myEditCurrentArgument = GroupPoints2->LineEdit2;
457     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
458   }
459   else if (send == GroupPoints2->PushButton3) {
460     GroupPoints2->LineEdit3->setFocus();
461     myEditCurrentArgument = GroupPoints2->LineEdit3;
462     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
463   }
464
465   myEditCurrentArgument->setFocus();
466   SelectionIntoArgument();
467 }
468
469
470 //=================================================================================
471 // function : ActivateThisDialog()
472 // purpose  :
473 //=================================================================================
474 void GenerationGUI_PrismDlg::ActivateThisDialog()
475 {
476   GEOMBase_Skeleton::ActivateThisDialog();
477
478   connect(myGeomGUI->getApp()->selectionMgr(),
479           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
480
481   ConstructorsClicked( getConstructorId() );
482 }
483
484
485 //=================================================================================
486 // function : enterEvent()
487 // purpose  : when mouse enter onto the QWidget
488 //=================================================================================
489 void GenerationGUI_PrismDlg::enterEvent(QEvent * e)
490 {
491   if (!GroupConstructors->isEnabled())
492     ActivateThisDialog();
493 }
494
495
496 //=================================================================================
497 // function : ValueChangedInSpinBox()
498 // purpose  :
499 //=================================================================================
500 void GenerationGUI_PrismDlg::ValueChangedInSpinBox()
501 {
502   displayPreview();
503 }
504
505
506 //=================================================================================
507 // function : getHeight()
508 // purpose  :
509 //=================================================================================
510 double GenerationGUI_PrismDlg::getHeight() const
511 {
512     return GroupPoints->SpinBox_DX->GetValue();
513 }
514
515 //=================================================================================
516 // function : createOperation
517 // purpose  :
518 //=================================================================================
519 GEOM::GEOM_IOperations_ptr GenerationGUI_PrismDlg::createOperation()
520 {
521   return getGeomEngine()->GetI3DPrimOperations( getStudyId() );
522 }
523
524 //=================================================================================
525 // function : isValid
526 // purpose  :
527 //=================================================================================
528 bool GenerationGUI_PrismDlg::isValid( QString& )
529 {
530   if (getConstructorId() == 0)
531     return (myOkBase && myOkVec);     // by vector and height
532   else
533     return (myOkBase && myOkPnt1 && myOkPnt2);   // by two points
534 }
535
536 //=================================================================================
537 // function : execute
538 // purpose  :
539 //=================================================================================
540 bool GenerationGUI_PrismDlg::execute( ObjectList& objects )
541 {
542   GEOM::GEOM_Object_var anObj;
543
544   switch ( getConstructorId() )
545   {
546   case 0:
547     {
548       if (!myBothway)
549         anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
550           MakePrismVecH(myBase, myVec, getHeight());
551       else
552         anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
553         MakePrismVecH2Ways(myBase, myVec, getHeight() );
554       break;
555     }
556   case 1:
557     {
558       if (!myBothway2)
559         anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
560         MakePrismTwoPnt(myBase, myPoint1, myPoint2);
561       else
562         anObj = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation())->
563         MakePrismTwoPnt2Ways(myBase, myPoint1, myPoint2);
564       break;
565     }
566   }
567   if ( !anObj->_is_nil() )
568     objects.push_back( anObj._retn() );
569
570   return true;
571 }
572
573
574 //=================================================================================
575 // function :  onReverse()
576 // purpose  :
577 //=================================================================================
578 void GenerationGUI_PrismDlg::onReverse()
579 {
580   double anOldValue = GroupPoints->SpinBox_DX->GetValue();
581   GroupPoints->SpinBox_DX->SetValue( -anOldValue );
582 }
583
584 //=================================================================================
585 // function :  onBothway()
586 // purpose  :  
587 //=================================================================================
588 void GenerationGUI_PrismDlg::onBothway()
589 {
590   bool anOldValue = myBothway;
591   myBothway = !anOldValue;
592   GroupPoints->CheckButton2->setEnabled(!myBothway);
593   displayPreview();
594 }
595
596 void GenerationGUI_PrismDlg::onBothway2()
597 {
598   bool anOldValue = myBothway2;
599   myBothway2 = !anOldValue;
600   displayPreview();
601 }
602
603 //=================================================================================
604 // function : addSubshapeToStudy
605 // purpose  : virtual method to add new SubObjects if local selection
606 //=================================================================================
607 void GenerationGUI_PrismDlg::addSubshapesToStudy()
608 {
609   QMap<QString, GEOM::GEOM_Object_var> objMap;
610
611   switch (getConstructorId())
612     {
613     case 0:
614       objMap[GroupPoints->LineEdit2->text()] = myVec;
615       break;
616     case 1:
617       objMap[GroupPoints2->LineEdit2->text()] = myPoint1;
618       objMap[GroupPoints2->LineEdit3->text()] = myPoint2;
619       break;
620     }
621   addSubshapesToFather( objMap );
622 }