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