]> SALOME platform Git repositories - modules/geom.git/blob - src/BasicGUI/BasicGUI_ArcDlg.cxx
Salome HOME
Implementation of the "21187: EDF 1137 GEOM: Performance issue when manipulating...
[modules/geom.git] / src / BasicGUI / BasicGUI_ArcDlg.cxx
1 //  Copyright (C) 2007-2010  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   if ( ClickOnApply() )
208     ClickOnCancel();
209 }
210
211 //=================================================================================
212 // function : ClickOnApply()
213 // purpose  :
214 //=================================================================================
215 bool BasicGUI_ArcDlg::ClickOnApply()
216 {
217   if ( !onAccept() )
218     return false;
219
220   initName();
221   ConstructorsClicked( getConstructorId() );
222
223   return true;
224 }
225
226
227 //=================================================================================
228 // function : SelectionIntoArgument()
229 // purpose  : Called when selection as changed or other case
230 //=================================================================================
231 void BasicGUI_ArcDlg::SelectionIntoArgument()
232 {
233   myEditCurrentArgument->setText( "" );
234
235   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
236   SALOME_ListIO aSelList;
237   aSelMgr->selectedObjects(aSelList);
238
239   if (aSelList.Extent() != 1) {
240     switch (getConstructorId()) {
241     case 0:
242       if      ( myEditCurrentArgument == Group3Pnts->LineEdit1 )   myPoint1.nullify();
243       else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 )   myPoint2.nullify();
244       else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 )   myPoint3.nullify();
245       break;
246     case 1:
247       if      ( myEditCurrentArgument == Group3Pnts2->LineEdit1 )   myPoint1.nullify();
248       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 )   myPoint2.nullify();
249       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 )   myPoint3.nullify();
250       break;
251     case 2:
252       if      ( myEditCurrentArgument == Group3Pnts3->LineEdit1 )   myPoint1.nullify();
253       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit2 )   myPoint2.nullify();
254       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit3 )   myPoint3.nullify();
255       break;
256     default:
257       break;
258     }
259     return;
260   }   
261
262   GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_VERTEX );
263   TopoDS_Shape aShape;
264   if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
265     QString aName = GEOMBase::GetName( aSelectedObject.get() );
266     myEditCurrentArgument->setText(aName);
267     switch ( getConstructorId() ) {
268     case 0:
269       if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) {
270         myPoint1 = aSelectedObject;
271         if ( myPoint1 && !myPoint2 )
272           Group3Pnts->PushButton2->click();
273       }
274       else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) {
275         myPoint2 = aSelectedObject;
276         if ( myPoint2 && !myPoint3 )
277           Group3Pnts->PushButton3->click();
278       }
279       else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) {
280         myPoint3 = aSelectedObject;
281         if ( myPoint3 && !myPoint1 )
282           Group3Pnts->PushButton1->click();
283       }
284       break;
285     case 1:
286       if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) {
287         myPoint1 = aSelectedObject;
288         if ( myPoint1 && !myPoint2 )
289           Group3Pnts2->PushButton2->click();
290       }
291       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) {
292         myPoint2 = aSelectedObject;
293         if ( myPoint2 && !myPoint3 )
294           Group3Pnts2->PushButton3->click();
295       }
296       else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) {
297         myPoint3 = aSelectedObject;
298         if ( myPoint3 && !myPoint1 )
299           Group3Pnts2->PushButton1->click();
300       }
301       break;
302     case 2:
303       if ( myEditCurrentArgument == Group3Pnts3->LineEdit1 ) {
304         myPoint1 = aSelectedObject;
305         if ( myPoint1 && !myPoint2 )
306           Group3Pnts3->PushButton2->click();
307       }
308       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit2 ) {
309         myPoint2 = aSelectedObject;
310         if ( myPoint2 && !myPoint3 )
311           Group3Pnts3->PushButton3->click();
312       }
313       else if ( myEditCurrentArgument == Group3Pnts3->LineEdit3 ) {
314         myPoint3 = aSelectedObject;
315         if ( myPoint3 && !myPoint1 )
316           Group3Pnts3->PushButton1->click();
317       }
318       break;
319     }
320   }
321
322   displayPreview(true);
323 }
324
325
326 //=================================================================================
327 // function : SetEditCurrentArgument()
328 // purpose  :
329 //=================================================================================
330 void BasicGUI_ArcDlg::SetEditCurrentArgument()
331 {
332   globalSelection(); // close local selection to clear it
333   localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
334
335   QPushButton* send = (QPushButton*)sender();
336   switch ( getConstructorId() ) {
337   case 0:
338     if      ( send == Group3Pnts->PushButton1 ) {
339       myEditCurrentArgument = Group3Pnts->LineEdit1;
340       Group3Pnts->PushButton2->setDown(false);
341       Group3Pnts->PushButton3->setDown(false);
342       Group3Pnts->LineEdit1->setEnabled(true);
343       Group3Pnts->LineEdit2->setEnabled(false);
344       Group3Pnts->LineEdit3->setEnabled(false);
345     }
346     else if ( send == Group3Pnts->PushButton2 ) {
347       myEditCurrentArgument = Group3Pnts->LineEdit2;
348       Group3Pnts->PushButton1->setDown(false);
349       Group3Pnts->PushButton3->setDown(false);
350       Group3Pnts->LineEdit1->setEnabled(false);
351       Group3Pnts->LineEdit2->setEnabled(true);
352       Group3Pnts->LineEdit3->setEnabled(false);
353     }
354     else if ( send == Group3Pnts->PushButton3 ) {
355       myEditCurrentArgument = Group3Pnts->LineEdit3;
356       Group3Pnts->PushButton1->setDown(false);
357       Group3Pnts->PushButton2->setDown(false);
358       Group3Pnts->LineEdit1->setEnabled(false);
359       Group3Pnts->LineEdit2->setEnabled(false);
360       Group3Pnts->LineEdit3->setEnabled(true);
361     }
362     break;
363   case 1:
364     if      ( send == Group3Pnts2->PushButton1 ) {
365       myEditCurrentArgument = Group3Pnts2->LineEdit1;
366       Group3Pnts2->PushButton2->setDown(false);
367       Group3Pnts2->PushButton3->setDown(false);
368       Group3Pnts2->LineEdit1->setEnabled(true);
369       Group3Pnts2->LineEdit2->setEnabled(false);
370       Group3Pnts2->LineEdit3->setEnabled(false);
371     }
372     else if ( send == Group3Pnts2->PushButton2 ) {
373       myEditCurrentArgument = Group3Pnts2->LineEdit2;
374       Group3Pnts2->PushButton1->setDown(false);
375       Group3Pnts2->PushButton3->setDown(false);
376       Group3Pnts2->LineEdit1->setEnabled(false);
377       Group3Pnts2->LineEdit2->setEnabled(true);
378       Group3Pnts2->LineEdit3->setEnabled(false);
379     }
380     else if ( send == Group3Pnts2->PushButton3 ) {
381       myEditCurrentArgument = Group3Pnts2->LineEdit3;
382       Group3Pnts2->PushButton1->setDown(false);
383       Group3Pnts2->PushButton2->setDown(false);
384       Group3Pnts2->LineEdit1->setEnabled(false);
385       Group3Pnts2->LineEdit2->setEnabled(false);
386       Group3Pnts2->LineEdit3->setEnabled(true);
387     }
388     break;
389   case 2:
390     if ( send == Group3Pnts3->PushButton1 ) {
391       myEditCurrentArgument = Group3Pnts3->LineEdit1;
392       Group3Pnts3->PushButton2->setDown(false);
393       Group3Pnts3->PushButton3->setDown(false);
394       Group3Pnts3->LineEdit1->setEnabled(true);
395       Group3Pnts3->LineEdit2->setEnabled(false);
396       Group3Pnts3->LineEdit3->setEnabled(false);
397     }
398     else if ( send == Group3Pnts3->PushButton2 ) {
399       myEditCurrentArgument = Group3Pnts3->LineEdit2;
400       Group3Pnts3->PushButton1->setDown(false);
401       Group3Pnts3->PushButton3->setDown(false);
402       Group3Pnts3->LineEdit1->setEnabled(false);
403       Group3Pnts3->LineEdit2->setEnabled(true);
404       Group3Pnts3->LineEdit3->setEnabled(false);
405     }
406     else if ( send == Group3Pnts3->PushButton3 ) {
407       myEditCurrentArgument = Group3Pnts3->LineEdit3;
408       Group3Pnts3->PushButton1->setDown(false);
409       Group3Pnts3->PushButton2->setDown(false);
410       Group3Pnts3->LineEdit1->setEnabled(false);
411       Group3Pnts3->LineEdit2->setEnabled(false);
412       Group3Pnts3->LineEdit3->setEnabled(true);
413     }
414     break;
415   }
416   myEditCurrentArgument->setFocus();
417   //  SelectionIntoArgument();
418   send->setDown(true);
419   displayPreview(true);
420 }
421
422
423 //=================================================================================
424 // function : ActivateThisDialog()
425 // purpose  :
426 //=================================================================================
427 void BasicGUI_ArcDlg::ActivateThisDialog()
428 {
429   GEOMBase_Skeleton::ActivateThisDialog();
430
431   connect( myGeomGUI->getApp()->selectionMgr(),
432            SIGNAL( currentSelectionChanged() ),
433            this,
434            SLOT(SelectionIntoArgument() ) );
435
436   ConstructorsClicked( getConstructorId() );
437 }
438
439 //=================================================================================
440 // function : enterEvent()
441 // purpose  :
442 //=================================================================================
443 void BasicGUI_ArcDlg::enterEvent( QEvent* )
444 {
445   if ( !mainFrame()->GroupConstructors->isEnabled() )
446     ActivateThisDialog();
447 }
448
449 //=================================================================================
450 // function : createOperation
451 // purpose  :
452 //=================================================================================
453 GEOM::GEOM_IOperations_ptr BasicGUI_ArcDlg::createOperation()
454 {
455   return myGeomGUI->GetGeomGen()->GetICurvesOperations( getStudyId() );
456 }
457
458 //=================================================================================
459 // function : isValid
460 // purpose  :
461 //=================================================================================
462 bool BasicGUI_ArcDlg::isValid( QString& msg )
463 {
464   bool ok = myPoint1 && myPoint2 && myPoint3 &&
465     myPoint1 != myPoint2 && myPoint1 != myPoint3 && myPoint2 != myPoint3;
466   return ok;
467 }
468
469 //=================================================================================
470 // function : execute
471 // purpose  :
472 //=================================================================================
473 bool BasicGUI_ArcDlg::execute( ObjectList& objects )
474 {
475   bool res = false;
476   GEOM::GEOM_Object_var anObj;
477
478   GEOM::GEOM_ICurvesOperations_var anOper = GEOM::GEOM_ICurvesOperations::_narrow( getOperation() );
479
480   switch ( getConstructorId() ) {
481   case 0:
482     {
483       if ( myPoint1 && myPoint2 && myPoint3 ) {
484         anObj = anOper->MakeArc( myPoint1.get(), myPoint2.get(), myPoint3.get() );
485         res = true;
486       }
487       break;
488     }
489   case 1:
490     {
491       bool Sense = Group3Pnts2->CheckButton1->isChecked();
492       if ( myPoint1 && myPoint2 && myPoint3 ) {
493         anObj = anOper->MakeArcCenter( myPoint1.get(), myPoint2.get(), myPoint3.get(), Sense );
494         res = true;
495       }
496       break;
497     }
498   case 2:
499     {
500       if ( myPoint1 && myPoint2 && myPoint3 ) {
501         anObj = anOper->MakeArcOfEllipse( myPoint1.get(), myPoint2.get(), myPoint3.get() );
502         res = true;
503       }
504       break;
505     }
506   }
507   if ( !anObj->_is_nil() ) {
508     objects.push_back( anObj._retn() );
509   }
510   return res;
511 }
512
513 //=================================================================================
514 // function : ConstructorsClicked()
515 // purpose  : Radio button management
516 //=================================================================================
517 void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
518 {
519   disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 );
520
521   myPoint1.nullify();
522   myPoint2.nullify();
523   myPoint3.nullify();
524   
525   switch ( constructorId ) {
526   case 0:
527     {
528       Group3Pnts->show();
529       Group3Pnts2->hide();
530       Group3Pnts3->hide();
531       Group3Pnts->PushButton1->setDown(true);
532       Group3Pnts->PushButton2->setDown(false);
533       Group3Pnts->PushButton3->setDown(false);
534       Group3Pnts->LineEdit1->setText( "" );
535       Group3Pnts->LineEdit2->setText( "" );
536       Group3Pnts->LineEdit3->setText( "" );
537       Group3Pnts->LineEdit1->setEnabled(true);
538       Group3Pnts->LineEdit2->setEnabled(false);
539       Group3Pnts->LineEdit3->setEnabled(false);
540
541       myEditCurrentArgument = Group3Pnts->LineEdit1;
542       break;
543     }
544   case 1:
545     {
546       Group3Pnts->hide();
547       Group3Pnts2->show();
548       Group3Pnts3->hide();
549       Group3Pnts2->PushButton1->setDown(true);
550       Group3Pnts2->PushButton2->setDown(false);
551       Group3Pnts2->PushButton3->setDown(false);
552       Group3Pnts2->LineEdit1->setText( "" );
553       Group3Pnts2->LineEdit2->setText( "" );
554       Group3Pnts2->LineEdit3->setText( "" );
555       Group3Pnts2->LineEdit1->setEnabled(true);
556       Group3Pnts2->LineEdit2->setEnabled(false);
557       Group3Pnts2->LineEdit3->setEnabled(false);
558       
559       myEditCurrentArgument = Group3Pnts2->LineEdit1;
560       break;
561     }
562   case 2:
563     {
564       Group3Pnts->hide();
565       Group3Pnts2->hide();
566       Group3Pnts3->show();
567       Group3Pnts3->PushButton1->setDown(true);
568       Group3Pnts3->PushButton2->setDown(false);
569       Group3Pnts3->PushButton3->setDown(false);
570       Group3Pnts3->LineEdit1->setText( "" );
571       Group3Pnts3->LineEdit2->setText( "" );
572       Group3Pnts3->LineEdit3->setText( "" );
573       Group3Pnts3->LineEdit1->setEnabled(true);
574       Group3Pnts3->LineEdit2->setEnabled(false);
575       Group3Pnts3->LineEdit3->setEnabled(false);
576
577       myEditCurrentArgument = Group3Pnts3->LineEdit1;
578       break;
579     }
580   }
581
582   globalSelection(); // close local contexts, if any
583   localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //Select Vertex on All Shapes
584   
585   qApp->processEvents();
586   updateGeometry();
587   resize( minimumSizeHint() );
588
589   myEditCurrentArgument->setFocus();
590   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
591            this, SLOT( SelectionIntoArgument() ) );
592
593   SelectionIntoArgument();
594
595   displayPreview(true);
596 }
597
598 //=================================================================================
599 // function : ReverseSense()
600 // purpose  : Orientation of the arc
601 //=================================================================================
602 void BasicGUI_ArcDlg::ReverseSense()
603 {
604   displayPreview(true);
605 }
606
607 //=================================================================================
608 // function : addSubshapeToStudy
609 // purpose  : virtual method to add new SubObjects if local selection
610 //=================================================================================
611 void BasicGUI_ArcDlg::addSubshapesToStudy()
612 {
613   switch ( getConstructorId() ) {
614   case 0:
615   case 1:
616   case 2:
617     GEOMBase::PublishSubObject( myPoint1.get() );
618     GEOMBase::PublishSubObject( myPoint2.get() );
619     GEOMBase::PublishSubObject( myPoint3.get() );
620     break;
621   default:
622     break;
623   }
624 }