Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/geom.git] / src / BasicGUI / BasicGUI_ArcDlg.cxx
1 // Copyright (C) 2007-2012  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
23 // GEOM GEOMGUI : GUI for Geometry component
24 // File   : BasicGUI_ArcDlg.cxx
25 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 //
27 #include "BasicGUI_ArcDlg.h"
28
29 #include <DlgRef.h>
30 #include <GeometryGUI.h>
31 #include <GEOMBase.h>
32
33 #include <SUIT_ResourceMgr.h>
34 #include <SUIT_Session.h>
35 #include <SalomeApp_Application.h>
36 #include <LightApp_SelectionMgr.h>
37
38 #include <TColStd_IndexedMapOfInteger.hxx>
39 #include <TopTools_IndexedMapOfShape.hxx>
40 #include <TopoDS_Shape.hxx>
41 #include <TopoDS_Edge.hxx>
42 #include <TopoDS.hxx>
43 #include <TopExp.hxx>
44
45 #include <GEOMImpl_Types.hxx>
46
47 //=================================================================================
48 // class    : BasicGUI_ArcDlg()
49 // purpose  : Constructs a BasicGUI_ArcDlg which is a child of 'parent', with the
50 //            name 'name' and widget flags set to 'f'.
51 //            The dialog will by default be modeless, unless you set 'modal' to
52 //            TRUE to construct a modal dialog.
53 //=================================================================================
54 BasicGUI_ArcDlg::BasicGUI_ArcDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
55                                   bool modal, Qt::WindowFlags fl )
56   : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
57 {
58   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
59   QPixmap image0( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_ARC" ) ) );
60   QPixmap image1( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_ARC_CENTER" ) ) );
61   QPixmap image2( aResMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
62   QPixmap image3( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_ARC_OF_ELLIPSE" ) ) );
63
64   setWindowTitle( tr( "GEOM_ARC_TITLE" ) );
65
66   /***************************************************************/
67   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_ARC" ) );
68   mainFrame()->RadioButton1->setIcon( image0 );
69   mainFrame()->RadioButton2->setIcon( image1 );
70   mainFrame()->RadioButton3->setIcon( image3 );
71
72   Group3Pnts = new DlgRef_3Sel( centralWidget() );
73
74   Group3Pnts->GroupBox1->setTitle( tr( "GEOM_POINTS" ) );
75   Group3Pnts->TextLabel1->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
76   Group3Pnts->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
77   Group3Pnts->TextLabel3->setText( tr( "GEOM_POINT_I" ).arg( 3 ) );
78
79   Group3Pnts->LineEdit1->setReadOnly( true );
80   Group3Pnts->LineEdit2->setReadOnly( true );
81   Group3Pnts->LineEdit3->setReadOnly( true );
82
83   Group3Pnts->LineEdit1->setEnabled(true);
84   Group3Pnts->LineEdit2->setEnabled(false);
85   Group3Pnts->LineEdit3->setEnabled(false);
86
87   Group3Pnts->PushButton1->setIcon(image2);
88   Group3Pnts->PushButton2->setIcon(image2);
89   Group3Pnts->PushButton3->setIcon(image2);
90
91
92   Group3Pnts2 = new DlgRef_3Sel1Check( centralWidget() );
93
94   Group3Pnts2->GroupBox1->setTitle( tr( "GEOM_POINTS" ) );
95   Group3Pnts2->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
96   Group3Pnts2->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( "Start" ) );
97   Group3Pnts2->TextLabel3->setText( tr( "GEOM_POINT_I" ).arg( "End" ) );
98
99   Group3Pnts2->LineEdit1->setReadOnly( true );
100   Group3Pnts2->LineEdit2->setReadOnly( true );
101   Group3Pnts2->LineEdit3->setReadOnly( true );
102
103   Group3Pnts2->LineEdit1->setEnabled(true);
104   Group3Pnts2->LineEdit2->setEnabled(false);
105   Group3Pnts2->LineEdit3->setEnabled(false);
106
107   Group3Pnts2->PushButton1->setIcon( image2 );
108   Group3Pnts2->PushButton2->setIcon( image2 );
109   Group3Pnts2->PushButton3->setIcon( image2 );
110   
111   Group3Pnts2->CheckButton1->setText( tr( "GEOM_REVERSE" ) );
112
113   Group3Pnts3 = new DlgRef_3Sel( centralWidget() );
114
115   Group3Pnts3->GroupBox1->setTitle( tr( "GEOM_POINTS" ) );
116   Group3Pnts3->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) );
117   Group3Pnts3->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 1 ) );
118   Group3Pnts3->TextLabel3->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
119
120   Group3Pnts3->LineEdit1->setReadOnly( true );
121   Group3Pnts3->LineEdit2->setReadOnly( true );
122   Group3Pnts3->LineEdit3->setReadOnly( true );
123
124   Group3Pnts3->LineEdit1->setEnabled(true);
125   Group3Pnts3->LineEdit2->setEnabled(false);
126   Group3Pnts3->LineEdit3->setEnabled(false);
127
128   Group3Pnts3->PushButton1->setIcon(image2);
129   Group3Pnts3->PushButton2->setIcon(image2);
130   Group3Pnts3->PushButton3->setIcon(image2);
131
132   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
133   layout->setMargin( 0 ); layout->setSpacing( 6 );
134   layout->addWidget( Group3Pnts );
135   layout->addWidget( Group3Pnts2 );
136   layout->addWidget( Group3Pnts3 );
137
138   setHelpFileName( "create_arc_page.html" );
139
140   Init();
141 }
142
143
144 //=================================================================================
145 // function : ~BasicGUI_ArcDlg()
146 // purpose  : Destroys the object and frees any allocated resources
147 //=================================================================================
148 BasicGUI_ArcDlg::~BasicGUI_ArcDlg()
149 {
150 }
151
152
153 //=================================================================================
154 // function : Init()
155 // purpose  :
156 //=================================================================================
157 void BasicGUI_ArcDlg::Init()
158 {
159   /* init variables */
160   myEditCurrentArgument = Group3Pnts->LineEdit1;
161
162   myPoint1.nullify();
163   myPoint2.nullify();
164   myPoint3.nullify();
165   Group3Pnts2->CheckButton1->setChecked( false );
166   Group3Pnts->PushButton1->setDown(true);
167
168   /* signals and slots connections */
169   connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
170   connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( ClickOnCancel() ) );
171  
172   connect( this,           SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
173  
174   connect( buttonOk(),     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
175   connect( buttonApply(),  SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
176
177   connect( Group3Pnts->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
178   connect( Group3Pnts->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
179   connect( Group3Pnts->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
180
181   connect( Group3Pnts2->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
182   connect( Group3Pnts2->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
183   connect( Group3Pnts2->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
184
185   connect( Group3Pnts2->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( ReverseSense() ) );
186
187   connect( Group3Pnts3->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
188   connect( Group3Pnts3->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
189   connect( Group3Pnts3->PushButton3, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
190
191   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
192            this, SLOT( SelectionIntoArgument() ) );
193
194   initName( tr( "GEOM_ARC" ) ); 
195   
196
197   ConstructorsClicked( 0 );
198 }
199
200
201 //=================================================================================
202 // function : ClickOnOk()
203 // purpose  :
204 //=================================================================================
205 void BasicGUI_ArcDlg::ClickOnOk()
206 {
207   setIsApplyAndClose( true );
208   if ( ClickOnApply() )
209     ClickOnCancel();
210 }
211
212 //=================================================================================
213 // function : ClickOnApply()
214 // purpose  :
215 //=================================================================================
216 bool BasicGUI_ArcDlg::ClickOnApply()
217 {
218   if ( !onAccept() )
219     return false;
220
221   initName();
222   ConstructorsClicked( getConstructorId() );
223
224   return true;
225 }
226
227
228 //=================================================================================
229 // function : SelectionIntoArgument()
230 // purpose  : Called when selection as changed or other case
231 //=================================================================================
232 void BasicGUI_ArcDlg::SelectionIntoArgument()
233 {
234   myEditCurrentArgument->setText( "" );
235
236   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
237   SALOME_ListIO aSelList;
238   aSelMgr->selectedObjects(aSelList);
239
240   if (aSelList.Extent() != 1) {
241     switch (getConstructorId()) {
242     case 0:
243       if      ( myEditCurrentArgument == Group3Pnts->LineEdit1 )   myPoint1.nullify();
244       else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 )   myPoint2.nullify();
245       else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 )   myPoint3.nullify();
246       break;
247     case 1:
248       if      ( myEditCurrentArgument == Group3Pnts2->LineEdit1 )   myPoint1.nullify();
249       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 )   myPoint2.nullify();
250       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 )   myPoint3.nullify();
251       break;
252     case 2:
253       if      ( myEditCurrentArgument == Group3Pnts3->LineEdit1 )   myPoint1.nullify();
254       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit2 )   myPoint2.nullify();
255       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit3 )   myPoint3.nullify();
256       break;
257     default:
258       break;
259     }
260     return;
261   }   
262
263   GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_VERTEX );
264   TopoDS_Shape aShape;
265   if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
266     QString aName = GEOMBase::GetName( aSelectedObject.get() );
267     myEditCurrentArgument->setText(aName);
268     switch ( getConstructorId() ) {
269     case 0:
270       if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) {
271         myPoint1 = aSelectedObject;
272         if ( myPoint1 && !myPoint2 )
273           Group3Pnts->PushButton2->click();
274       }
275       else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) {
276         myPoint2 = aSelectedObject;
277         if ( myPoint2 && !myPoint3 )
278           Group3Pnts->PushButton3->click();
279       }
280       else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) {
281         myPoint3 = aSelectedObject;
282         if ( myPoint3 && !myPoint1 )
283           Group3Pnts->PushButton1->click();
284       }
285       break;
286     case 1:
287       if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) {
288         myPoint1 = aSelectedObject;
289         if ( myPoint1 && !myPoint2 )
290           Group3Pnts2->PushButton2->click();
291       }
292       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) {
293         myPoint2 = aSelectedObject;
294         if ( myPoint2 && !myPoint3 )
295           Group3Pnts2->PushButton3->click();
296       }
297       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) {
298         myPoint3 = aSelectedObject;
299         if ( myPoint3 && !myPoint1 )
300           Group3Pnts2->PushButton1->click();
301       }
302       break;
303     case 2:
304       if ( myEditCurrentArgument == Group3Pnts3->LineEdit1 ) {
305         myPoint1 = aSelectedObject;
306         if ( myPoint1 && !myPoint2 )
307           Group3Pnts3->PushButton2->click();
308       }
309       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit2 ) {
310         myPoint2 = aSelectedObject;
311         if ( myPoint2 && !myPoint3 )
312           Group3Pnts3->PushButton3->click();
313       }
314       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit3 ) {
315         myPoint3 = aSelectedObject;
316         if ( myPoint3 && !myPoint1 )
317           Group3Pnts3->PushButton1->click();
318       }
319       break;
320     }
321   }
322
323   displayPreview(true);
324 }
325
326
327 //=================================================================================
328 // function : SetEditCurrentArgument()
329 // purpose  :
330 //=================================================================================
331 void BasicGUI_ArcDlg::SetEditCurrentArgument()
332 {
333   globalSelection(); // close local selection to clear it
334   localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
335
336   QPushButton* send = (QPushButton*)sender();
337   switch ( getConstructorId() ) {
338   case 0:
339     if      ( send == Group3Pnts->PushButton1 ) {
340       myEditCurrentArgument = Group3Pnts->LineEdit1;
341       Group3Pnts->PushButton2->setDown(false);
342       Group3Pnts->PushButton3->setDown(false);
343       Group3Pnts->LineEdit1->setEnabled(true);
344       Group3Pnts->LineEdit2->setEnabled(false);
345       Group3Pnts->LineEdit3->setEnabled(false);
346     }
347     else if ( send == Group3Pnts->PushButton2 ) {
348       myEditCurrentArgument = Group3Pnts->LineEdit2;
349       Group3Pnts->PushButton1->setDown(false);
350       Group3Pnts->PushButton3->setDown(false);
351       Group3Pnts->LineEdit1->setEnabled(false);
352       Group3Pnts->LineEdit2->setEnabled(true);
353       Group3Pnts->LineEdit3->setEnabled(false);
354     }
355     else if ( send == Group3Pnts->PushButton3 ) {
356       myEditCurrentArgument = Group3Pnts->LineEdit3;
357       Group3Pnts->PushButton1->setDown(false);
358       Group3Pnts->PushButton2->setDown(false);
359       Group3Pnts->LineEdit1->setEnabled(false);
360       Group3Pnts->LineEdit2->setEnabled(false);
361       Group3Pnts->LineEdit3->setEnabled(true);
362     }
363     break;
364   case 1:
365     if      ( send == Group3Pnts2->PushButton1 ) {
366       myEditCurrentArgument = Group3Pnts2->LineEdit1;
367       Group3Pnts2->PushButton2->setDown(false);
368       Group3Pnts2->PushButton3->setDown(false);
369       Group3Pnts2->LineEdit1->setEnabled(true);
370       Group3Pnts2->LineEdit2->setEnabled(false);
371       Group3Pnts2->LineEdit3->setEnabled(false);
372     }
373     else if ( send == Group3Pnts2->PushButton2 ) {
374       myEditCurrentArgument = Group3Pnts2->LineEdit2;
375       Group3Pnts2->PushButton1->setDown(false);
376       Group3Pnts2->PushButton3->setDown(false);
377       Group3Pnts2->LineEdit1->setEnabled(false);
378       Group3Pnts2->LineEdit2->setEnabled(true);
379       Group3Pnts2->LineEdit3->setEnabled(false);
380     }
381     else if ( send == Group3Pnts2->PushButton3 ) {
382       myEditCurrentArgument = Group3Pnts2->LineEdit3;
383       Group3Pnts2->PushButton1->setDown(false);
384       Group3Pnts2->PushButton2->setDown(false);
385       Group3Pnts2->LineEdit1->setEnabled(false);
386       Group3Pnts2->LineEdit2->setEnabled(false);
387       Group3Pnts2->LineEdit3->setEnabled(true);
388     }
389     break;
390   case 2:
391     if ( send == Group3Pnts3->PushButton1 ) {
392       myEditCurrentArgument = Group3Pnts3->LineEdit1;
393       Group3Pnts3->PushButton2->setDown(false);
394       Group3Pnts3->PushButton3->setDown(false);
395       Group3Pnts3->LineEdit1->setEnabled(true);
396       Group3Pnts3->LineEdit2->setEnabled(false);
397       Group3Pnts3->LineEdit3->setEnabled(false);
398     }
399     else if ( send == Group3Pnts3->PushButton2 ) {
400       myEditCurrentArgument = Group3Pnts3->LineEdit2;
401       Group3Pnts3->PushButton1->setDown(false);
402       Group3Pnts3->PushButton3->setDown(false);
403       Group3Pnts3->LineEdit1->setEnabled(false);
404       Group3Pnts3->LineEdit2->setEnabled(true);
405       Group3Pnts3->LineEdit3->setEnabled(false);
406     }
407     else if ( send == Group3Pnts3->PushButton3 ) {
408       myEditCurrentArgument = Group3Pnts3->LineEdit3;
409       Group3Pnts3->PushButton1->setDown(false);
410       Group3Pnts3->PushButton2->setDown(false);
411       Group3Pnts3->LineEdit1->setEnabled(false);
412       Group3Pnts3->LineEdit2->setEnabled(false);
413       Group3Pnts3->LineEdit3->setEnabled(true);
414     }
415     break;
416   }
417   myEditCurrentArgument->setFocus();
418   //  SelectionIntoArgument();
419   send->setDown(true);
420   displayPreview(true);
421 }
422
423
424 //=================================================================================
425 // function : ActivateThisDialog()
426 // purpose  :
427 //=================================================================================
428 void BasicGUI_ArcDlg::ActivateThisDialog()
429 {
430   GEOMBase_Skeleton::ActivateThisDialog();
431
432   connect( myGeomGUI->getApp()->selectionMgr(),
433            SIGNAL( currentSelectionChanged() ),
434            this,
435            SLOT(SelectionIntoArgument() ) );
436
437   ConstructorsClicked( getConstructorId() );
438 }
439
440 //=================================================================================
441 // function : enterEvent()
442 // purpose  :
443 //=================================================================================
444 void BasicGUI_ArcDlg::enterEvent( QEvent* )
445 {
446   if ( !mainFrame()->GroupConstructors->isEnabled() )
447     ActivateThisDialog();
448 }
449
450 //=================================================================================
451 // function : createOperation
452 // purpose  :
453 //=================================================================================
454 GEOM::GEOM_IOperations_ptr BasicGUI_ArcDlg::createOperation()
455 {
456   return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
457 }
458
459 //=================================================================================
460 // function : isValid
461 // purpose  :
462 //=================================================================================
463 bool BasicGUI_ArcDlg::isValid( QString& msg )
464 {
465   bool ok = myPoint1 && myPoint2 && myPoint3 &&
466     myPoint1 != myPoint2 && myPoint1 != myPoint3 && myPoint2 != myPoint3;
467   return ok;
468 }
469
470 //=================================================================================
471 // function : execute
472 // purpose  :
473 //=================================================================================
474 bool BasicGUI_ArcDlg::execute( ObjectList& objects )
475 {
476   bool res = false;
477   GEOM::GEOM_Object_var anObj;
478
479   GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
480
481   switch ( getConstructorId() ) {
482   case 0:
483     {
484       if ( myPoint1 && myPoint2 && myPoint3 ) {
485         anObj = anOper->MakeArc( myPoint1.get(), myPoint2.get(), myPoint3.get() );
486         res = true;
487       }
488       break;
489     }
490   case 1:
491     {
492       bool Sense = Group3Pnts2->CheckButton1->isChecked();
493       if ( myPoint1 && myPoint2 && myPoint3 ) {
494         anObj = anOper->MakeArcCenter( myPoint1.get(), myPoint2.get(), myPoint3.get(), Sense );
495         res = true;
496       }
497       break;
498     }
499   case 2:
500     {
501       if ( myPoint1 && myPoint2 && myPoint3 ) {
502         anObj = anOper->MakeArcOfEllipse( myPoint1.get(), myPoint2.get(), myPoint3.get() );
503         res = true;
504       }
505       break;
506     }
507   }
508   if ( !anObj->_is_nil() ) {
509     objects.push_back( anObj._retn() );
510   }
511   return res;
512 }
513
514 //=================================================================================
515 // function : ConstructorsClicked()
516 // purpose  : Radio button management
517 //=================================================================================
518 void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
519 {
520   disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
521
522   myPoint1.nullify();
523   myPoint2.nullify();
524   myPoint3.nullify();
525   
526   switch ( constructorId ) {
527   case 0:
528     {
529       Group3Pnts->show();
530       Group3Pnts2->hide();
531       Group3Pnts3->hide();
532       Group3Pnts->PushButton1->setDown(true);
533       Group3Pnts->PushButton2->setDown(false);
534       Group3Pnts->PushButton3->setDown(false);
535       Group3Pnts->LineEdit1->setText( "" );
536       Group3Pnts->LineEdit2->setText( "" );
537       Group3Pnts->LineEdit3->setText( "" );
538       Group3Pnts->LineEdit1->setEnabled(true);
539       Group3Pnts->LineEdit2->setEnabled(false);
540       Group3Pnts->LineEdit3->setEnabled(false);
541
542       myEditCurrentArgument = Group3Pnts->LineEdit1;
543       break;
544     }
545   case 1:
546     {
547       Group3Pnts->hide();
548       Group3Pnts2->show();
549       Group3Pnts3->hide();
550       Group3Pnts2->PushButton1->setDown(true);
551       Group3Pnts2->PushButton2->setDown(false);
552       Group3Pnts2->PushButton3->setDown(false);
553       Group3Pnts2->LineEdit1->setText( "" );
554       Group3Pnts2->LineEdit2->setText( "" );
555       Group3Pnts2->LineEdit3->setText( "" );
556       Group3Pnts2->LineEdit1->setEnabled(true);
557       Group3Pnts2->LineEdit2->setEnabled(false);
558       Group3Pnts2->LineEdit3->setEnabled(false);
559       
560       myEditCurrentArgument = Group3Pnts2->LineEdit1;
561       break;
562     }
563   case 2:
564     {
565       Group3Pnts->hide();
566       Group3Pnts2->hide();
567       Group3Pnts3->show();
568       Group3Pnts3->PushButton1->setDown(true);
569       Group3Pnts3->PushButton2->setDown(false);
570       Group3Pnts3->PushButton3->setDown(false);
571       Group3Pnts3->LineEdit1->setText( "" );
572       Group3Pnts3->LineEdit2->setText( "" );
573       Group3Pnts3->LineEdit3->setText( "" );
574       Group3Pnts3->LineEdit1->setEnabled(true);
575       Group3Pnts3->LineEdit2->setEnabled(false);
576       Group3Pnts3->LineEdit3->setEnabled(false);
577
578       myEditCurrentArgument = Group3Pnts3->LineEdit1;
579       break;
580     }
581   }
582
583   globalSelection(); // close local contexts, if any
584   localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //Select Vertex on All Shapes
585   
586   qApp->processEvents();
587   updateGeometry();
588   resize( minimumSizeHint() );
589
590   myEditCurrentArgument->setFocus();
591   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
592            this, SLOT( SelectionIntoArgument() ) );
593
594   SelectionIntoArgument();
595
596   displayPreview(true);
597 }
598
599 //=================================================================================
600 // function : ReverseSense()
601 // purpose  : Orientation of the arc
602 //=================================================================================
603 void BasicGUI_ArcDlg::ReverseSense()
604 {
605   displayPreview(true);
606 }
607
608 //=================================================================================
609 // function : addSubshapeToStudy
610 // purpose  : virtual method to add new SubObjects if local selection
611 //=================================================================================
612 void BasicGUI_ArcDlg::addSubshapesToStudy()
613 {
614   switch ( getConstructorId() ) {
615   case 0:
616   case 1:
617   case 2:
618     GEOMBase::PublishSubObject( myPoint1.get() );
619     GEOMBase::PublishSubObject( myPoint2.get() );
620     GEOMBase::PublishSubObject( myPoint3.get() );
621     break;
622   default:
623     break;
624   }
625 }