]> SALOME platform Git repositories - modules/geom.git/blob - src/BasicGUI/BasicGUI_PointDlg.cxx
Salome HOME
RNC: IMP EDF 1542: Added the functionnality MakeVertexOnCurveByLength that allows...
[modules/geom.git] / src / BasicGUI / BasicGUI_PointDlg.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_PointDlg.cxx
25 //  Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 //
27 #include "BasicGUI_PointDlg.h"
28
29 #include <SUIT_ResourceMgr.h>
30 #include <SUIT_Session.h>
31 #include <SalomeApp_Application.h>
32 #include <LightApp_SelectionMgr.h>
33
34 #include <GeometryGUI.h>
35 #include <GEOMBase.h>
36
37 #include <DlgRef.h>
38
39 #include <GEOMImpl_Types.hxx>
40
41 #include <QApplication>
42 #include <QButtonGroup>
43 #include <QHBoxLayout>
44 #include <QLabel>
45 #include <QRadioButton>
46 #include <QMenu>
47 #include <QTimer>
48
49 #include <gp_Pnt.hxx>
50 #include <TopoDS_Shape.hxx>
51 #include <TopAbs_ShapeEnum.hxx>
52 #include <TopoDS.hxx>
53 #include <BRep_Tool.hxx>
54 #include <TopExp.hxx>
55 #include <TColStd_IndexedMapOfInteger.hxx>
56 #include <TopTools_IndexedMapOfShape.hxx>
57
58 #define PARAM_VALUE 0
59 #define COORD_VALUE 1
60 #define LENGTH_VALUE 2
61
62 #define GEOM_POINT_XYZ    0
63 #define GEOM_POINT_REF    1
64 #define GEOM_POINT_EDGE   2
65 #define GEOM_POINT_INTINT 3
66 #define GEOM_POINT_SURF   4
67
68 #define SPACING 6
69 #define MARGIN  9
70
71 //=================================================================================
72 // class    : BasicGUI_PointDlg()
73 // purpose  : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
74 //            name 'name' and widget flags set to 'f'.
75 //            The dialog will by default be modeless, unless you set 'modal' to
76 //            TRUE to construct a modal dialog.
77 //=================================================================================
78 BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
79                                       bool modal, Qt::WindowFlags fl )
80   : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl ),
81     myBusy ( false )
82 {
83   QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) );
84   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_EDGE" ) ) );
85   QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
86   QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_REF" ) ) );
87   QPixmap image4( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_LINES") ) );
88   QPixmap image5( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_FACE" ) ) );
89   QPixmap image6( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICO_LINE" ) ) );
90   QPixmap image7( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICO_WIRE" ) ) );
91
92   setWindowTitle( tr( "GEOM_POINT_TITLE" ) );
93
94   /***************************************************************/
95   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_POINTS" ) );
96   mainFrame()->RadioButton1->setIcon( image0 );
97   mainFrame()->RadioButton2->setIcon( image3 );
98   mainFrame()->RadioButton3->setIcon( image1 );
99   mainFrame()->RadioButton4->show();
100   mainFrame()->RadioButton4->setIcon( image4 );
101   mainFrame()->RadioButton5->show();
102   mainFrame()->RadioButton5->setIcon( image5 );
103
104   myParamGroup = new QGroupBox( centralWidget() );
105   myParamCoord = new QButtonGroup( myParamGroup );
106   QHBoxLayout* boxLayout = new QHBoxLayout( myParamGroup );
107   boxLayout->setMargin( MARGIN ); boxLayout->setSpacing( SPACING );
108   QRadioButton* btn = new QRadioButton( tr( "GEOM_PARAM_VALUE" ), myParamGroup );
109   myParamCoord->addButton( btn, PARAM_VALUE );
110   boxLayout->addWidget( btn );
111   btn = new QRadioButton( tr( "GEOM_LENGTH_VALUE" ), myParamGroup ); 
112   myParamCoord->addButton( btn, LENGTH_VALUE );
113   boxLayout->addWidget( btn );
114   btn = new QRadioButton( tr( "GEOM_COORD_VALUE" ), myParamGroup );
115   myParamCoord->addButton( btn, COORD_VALUE );
116   boxLayout->addWidget( btn );
117   myParamCoord->setExclusive( true );
118   myParamCoord->button( PARAM_VALUE )->setChecked( true );
119
120   GroupXYZ = new DlgRef_3Spin( centralWidget() );
121   GroupXYZ->GroupBox1->setTitle( tr( "GEOM_COORDINATES" ) );
122   GroupXYZ->TextLabel1->setText( tr( "GEOM_X" ) );
123   GroupXYZ->TextLabel2->setText( tr( "GEOM_Y" ) );
124   GroupXYZ->TextLabel3->setText( tr( "GEOM_Z" ) );
125
126   GroupOnCurve = new DlgRef_1Sel1Spin( centralWidget() );
127   GroupOnCurve->GroupBox1->setTitle( tr( "GEOM_POINT_ON_EDGE" ) );
128   GroupOnCurve->TextLabel1->setText( tr( "GEOM_EDGE" ) );
129   GroupOnCurve->TextLabel2->setText( tr( "GEOM_PARAMETER" ) );
130   GroupOnCurve->PushButton1->setIcon( image2 );
131
132   GroupOnSurface = new DlgRef_1Sel2Spin( centralWidget() );
133   GroupOnSurface->GroupBox1->setTitle( tr( "GEOM_POINT_ON_FACE" ) );
134   GroupOnSurface->TextLabel1->setText( tr( "GEOM_FACE" ) );
135   GroupOnSurface->TextLabel2->setText( tr( "GEOM_UPARAMETER" ) );
136   GroupOnSurface->TextLabel3->setText( tr( "GEOM_VPARAMETER" ) );
137   GroupOnSurface->PushButton1->setIcon( image2 );
138
139   GroupRefPoint = new DlgRef_1Sel3Spin( centralWidget() );
140   GroupRefPoint->GroupBox1->setTitle( tr( "GEOM_REF_POINT" ) );
141   GroupRefPoint->TextLabel1->setText( tr( "GEOM_POINT" ) );
142   GroupRefPoint->PushButton1->setIcon( image2 );
143   GroupRefPoint->TextLabel2->setText( tr( "GEOM_DX" ) );
144   GroupRefPoint->TextLabel3->setText( tr( "GEOM_DY" ) );
145   GroupRefPoint->TextLabel4->setText( tr( "GEOM_DZ" ) );
146
147   /* popup menu for line intersect buttons */
148   myBtnPopup = new QMenu(this);
149   QIcon ico_line = QIcon( image6 );
150   QIcon ico_wire = QIcon( image7 );
151   myActions[myBtnPopup->addAction( ico_line, tr( "GEOM_EDGE" ) )] = 0;
152   myActions[myBtnPopup->addAction( ico_wire, tr( "GEOM_WIRE" ) )] = 1;
153
154   GroupLineIntersection = new DlgRef_2Sel( centralWidget() );
155   GroupLineIntersection->GroupBox1->setTitle( tr( "GEOM_LINE_INTERSECTION" ) );
156   GroupLineIntersection->TextLabel1->setText( tr( "GEOM_LINE1" ) );
157   GroupLineIntersection->TextLabel2->setText( tr( "GEOM_LINE2" ) );
158   GroupLineIntersection->PushButton1->setIcon( image2 );
159   GroupLineIntersection->PushButton1->setMenu( myBtnPopup );
160   GroupLineIntersection->PushButton2->setIcon( image2 );
161   GroupLineIntersection->PushButton2->setMenu( myBtnPopup );
162   GroupLineIntersection->LineEdit2->setEnabled(false);
163
164   myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES_RES" ), centralWidget() );
165   QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp );
166   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), myCoordGrp ), 0, 0 );
167   myX = new QLineEdit( myCoordGrp );
168   myCoordGrpLayout->addWidget( myX, 0, 1 );
169   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), myCoordGrp ), 1, 0 );
170   myY = new QLineEdit( myCoordGrp );
171   myCoordGrpLayout->addWidget( myY, 1, 1 );
172   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), myCoordGrp ), 2, 0 );
173   myZ = new QLineEdit( myCoordGrp );
174   myCoordGrpLayout->addWidget( myZ, 2, 1 );
175
176   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
177   layout->setMargin( 0 ); layout->setSpacing( 6 );
178   layout->addWidget( myParamGroup );
179   layout->addWidget( GroupXYZ );
180   layout->addWidget( GroupOnCurve );
181   layout->addWidget( GroupOnSurface );
182   layout->addWidget( GroupRefPoint );
183   layout->addWidget( GroupLineIntersection );
184   layout->addWidget( myCoordGrp );
185
186   myX->setReadOnly( true );
187   myY->setReadOnly( true );
188   myZ->setReadOnly( true );
189
190   myX->setEnabled( false );
191   myY->setEnabled( false );
192   myZ->setEnabled( false );
193
194   QPalette aPal = myX->palette();
195   aPal.setColor( QPalette::Disabled, QPalette::Text, QColor( 0, 0, 0 ) );
196   myX->setPalette( aPal );
197   myY->setPalette( aPal );
198   myZ->setPalette( aPal );
199
200   setHelpFileName( "create_point_page.html" );
201
202   Init();
203 }
204
205
206 //=================================================================================
207 // function : ~BasicGUI_PointDlg()
208 // purpose  : Destructor
209 //=================================================================================
210 BasicGUI_PointDlg::~BasicGUI_PointDlg()
211 {
212 }
213
214
215 //=================================================================================
216 // function : Init()
217 // purpose  :
218 //=================================================================================
219 void BasicGUI_PointDlg::Init()
220 {
221   GroupOnCurve->LineEdit1->setReadOnly( true );
222   GroupOnSurface->LineEdit1->setReadOnly( true );
223   GroupRefPoint->LineEdit1->setReadOnly( true );
224   GroupLineIntersection->LineEdit1->setReadOnly( true );
225   GroupLineIntersection->LineEdit2->setReadOnly( true );
226   GroupLineIntersection->LineEdit1->setEnabled( true );
227   GroupLineIntersection->LineEdit2->setEnabled( false );
228
229   myEdge = GEOM::GEOM_Object::_nil();
230   myRefPoint = GEOM::GEOM_Object::_nil();
231   myNeedType = TopAbs_VERTEX;
232
233   myEditCurrentArgument = 0;
234
235   /* Get setting of step value from file configuration */
236   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
237   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
238
239   /* min, max, step and decimals for spin boxes */
240   initSpinBox( GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
241   initSpinBox( GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision" );
242   initSpinBox( GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
243   GroupXYZ->SpinBox_DX->setValue( 0.0 );
244   GroupXYZ->SpinBox_DY->setValue( 0.0 );
245   GroupXYZ->SpinBox_DZ->setValue( 0.0 );
246
247   initSpinBox( GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision" );
248   initSpinBox( GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision" );
249   initSpinBox( GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision" );
250   GroupRefPoint->SpinBox_DX->setValue( 0.0 );
251   GroupRefPoint->SpinBox_DY->setValue( 0.0 );
252   GroupRefPoint->SpinBox_DZ->setValue( 0.0 );
253
254   step = 0.1;
255
256   initSpinBox( GroupOnCurve->SpinBox_DX, 0., 1., step, "parametric_precision" );
257   GroupOnCurve->SpinBox_DX->setValue( 0.5 );
258
259   initSpinBox( GroupOnSurface->SpinBox_DX, 0., 1., step, "parametric_precision" );
260   GroupOnSurface->SpinBox_DX->setValue( 0.5 );
261   initSpinBox( GroupOnSurface->SpinBox_DY, 0., 1., step, "parametric_precision" );
262   GroupOnSurface->SpinBox_DY->setValue( 0.5 );
263
264   /* signals and slots connections */
265   connect( myGeomGUI,      SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
266   connect( myGeomGUI,      SIGNAL( SignalCloseAllDialogs() ),        this, SLOT( ClickOnCancel() ) );
267
268   connect( buttonOk(),     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
269   connect( buttonApply(),  SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
270
271   connect( this,           SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
272
273   connect( myParamCoord,   SIGNAL( buttonClicked( int ) ), this, SLOT( ClickParamCoord( int ) ) );
274   connect( GroupOnCurve->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
275   connect( GroupOnCurve->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
276
277   connect( GroupOnSurface->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
278   connect( GroupOnSurface->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
279
280   connect( myBtnPopup, SIGNAL( triggered( QAction* ) ), SLOT( onBtnPopup( QAction* ) ) );
281   connect( GroupLineIntersection->PushButton1, SIGNAL( pressed() ),       this, SLOT( SetEditCurrentArgument() ) );
282   connect( GroupLineIntersection->PushButton2, SIGNAL( pressed() ),       this, SLOT( SetEditCurrentArgument() ) );
283   connect( GroupLineIntersection->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
284   connect( GroupLineIntersection->LineEdit2,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
285
286   connect( GroupOnCurve->SpinBox_DX,   SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
287   connect( GroupOnSurface->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
288   connect( GroupOnSurface->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
289   connect( GroupXYZ->SpinBox_DX,       SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
290   connect( GroupXYZ->SpinBox_DY,       SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
291   connect( GroupXYZ->SpinBox_DZ,       SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
292   connect( GroupRefPoint->SpinBox_DX,  SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
293   connect( GroupRefPoint->SpinBox_DY,  SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
294   connect( GroupRefPoint->SpinBox_DZ,  SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
295
296   connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this,  SLOT( SetDoubleSpinBoxStep( double ) ) );
297
298   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
299            this,  SLOT(SelectionIntoArgument() ) );
300
301   initName( tr( "GEOM_VERTEX" ) );
302
303   ConstructorsClicked( 0 );
304 }
305
306 //=================================================================================
307 // function : SetDoubleSpinBoxStep()
308 // purpose  : Double spin box management
309 //=================================================================================
310 void BasicGUI_PointDlg::SetDoubleSpinBoxStep( double step )
311 {
312   GroupOnCurve->SpinBox_DX->setSingleStep(step);
313   GroupXYZ->SpinBox_DX->setSingleStep(step);
314   GroupXYZ->SpinBox_DY->setSingleStep(step);
315   GroupXYZ->SpinBox_DZ->setSingleStep(step);
316   GroupRefPoint->SpinBox_DX->setSingleStep(step);
317   GroupRefPoint->SpinBox_DY->setSingleStep(step);
318   GroupRefPoint->SpinBox_DZ->setSingleStep(step);
319 }
320
321
322 //=================================================================================
323 // function : ConstructorsClicked()
324 // purpose  : Radio button management
325 //=================================================================================
326 void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
327 {
328   switch ( constructorId ) {
329   case GEOM_POINT_XYZ:
330     {
331       globalSelection(); // close local contexts, if any
332       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
333
334       GroupRefPoint->hide();
335       GroupOnCurve->hide();
336       GroupLineIntersection->hide();
337       GroupOnSurface->hide();
338       myCoordGrp->hide();
339       myParamGroup->hide();
340       GroupXYZ->show();
341       break;
342     }
343   case GEOM_POINT_REF:
344     {
345       globalSelection(); // close local contexts, if any
346       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
347
348       myEditCurrentArgument = GroupRefPoint->LineEdit1;
349       myEditCurrentArgument->setText( "" );
350       myRefPoint = GEOM::GEOM_Object::_nil();
351       GroupRefPoint->PushButton1->setDown(true);
352       myParamGroup->hide();
353       GroupXYZ->hide();
354       GroupOnCurve->hide();
355       GroupLineIntersection->hide();
356       GroupOnSurface->hide();
357       GroupRefPoint->show();
358       myCoordGrp->show();
359       break;
360     }
361   case GEOM_POINT_EDGE:
362     {
363       globalSelection(); // close local contexts, if any
364       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
365
366       myEditCurrentArgument = GroupOnCurve->LineEdit1;
367       myEditCurrentArgument->setText( "" );
368       myEdge = GEOM::GEOM_Object::_nil();
369       GroupOnCurve->PushButton1->setDown(true);
370       GroupRefPoint->hide();
371       GroupLineIntersection->hide();
372       GroupOnSurface->hide();
373       myParamGroup->show();
374       myParamCoord->button( LENGTH_VALUE )->show();
375       myParamCoord->button( PARAM_VALUE )->setChecked( true );
376       GroupOnCurve->show();
377       myCoordGrp->show();
378       updateParamCoord( false );
379       break;
380     }
381   case GEOM_POINT_INTINT:
382     {
383       globalSelection(); // close local contexts, if any
384       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
385       myNeedType = TopAbs_EDGE;
386
387       myEditCurrentArgument = GroupLineIntersection->LineEdit1;
388       GroupLineIntersection->LineEdit1->setText( "" );
389       GroupLineIntersection->LineEdit2->setText( "" );
390       GroupLineIntersection->LineEdit1->setEnabled( true );
391       GroupLineIntersection->LineEdit2->setEnabled( false );
392       myLine1 = GEOM::GEOM_Object::_nil();
393       myLine2 = GEOM::GEOM_Object::_nil();
394       GroupLineIntersection->PushButton1->setDown(true);
395       GroupLineIntersection->PushButton2->setDown(false);
396       myParamGroup->hide();
397       GroupXYZ->hide();
398       GroupRefPoint->hide();
399       GroupOnCurve->hide();
400       GroupOnSurface->hide();
401       myCoordGrp->hide();
402       GroupLineIntersection->show();
403       break;
404     }
405   case GEOM_POINT_SURF:
406     {
407       globalSelection(); // close local contexts, if any
408       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
409
410       myEditCurrentArgument = GroupOnSurface->LineEdit1;
411       myEditCurrentArgument->setText( "" );
412       myFace = GEOM::GEOM_Object::_nil();
413       GroupOnSurface->PushButton1->setDown(true);
414       GroupRefPoint->hide();
415       GroupOnCurve->hide();
416       GroupLineIntersection->hide();
417       myParamGroup->show();
418       myParamCoord->button( LENGTH_VALUE )->hide();
419       myParamCoord->button( PARAM_VALUE )->setChecked(true);
420       GroupOnSurface->show();
421       myCoordGrp->show();
422       updateParamCoord( false );
423       break;
424     }
425   }
426
427   myX->setText( "" );
428   myY->setText( "" );
429   myZ->setText( "" );
430
431   QTimer::singleShot(50, this, SLOT(updateSize()));
432
433   SelectionIntoArgument();
434 }
435
436
437 //=================================================================================
438 // function : ClickOnOk()
439 // purpose  :
440 //=================================================================================
441 void BasicGUI_PointDlg::ClickOnOk()
442 {
443   if ( onAccept() )
444     ClickOnCancel();
445 }
446
447
448 //=================================================================================
449 // function : ClickOnApply()
450 // purpose  :
451 //=================================================================================
452 bool BasicGUI_PointDlg::ClickOnApply()
453 {
454   if ( !onAccept() )
455     return false;
456
457   initName();
458   ConstructorsClicked( getConstructorId() );
459   return true;
460 }
461
462
463 //=================================================================================
464 // function : SelectionIntoArgument()
465 // purpose  : Called when selection as changed (for constructors not using local context)
466 //=================================================================================
467 void BasicGUI_PointDlg::SelectionIntoArgument()
468 {
469   erasePreview();
470   const int id = getConstructorId();
471
472   if ( ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) && myEditCurrentArgument != 0 )
473   {
474     myEditCurrentArgument->setText( "" );
475     myX->setText( "" );
476     myY->setText( "" );
477     myZ->setText( "" );
478     myRefPoint = myEdge = myFace = GEOM::GEOM_Object::_nil();
479   } else if ( id == GEOM_POINT_INTINT ) {
480     myEditCurrentArgument->setText( "" );
481     if ( myEditCurrentArgument == GroupLineIntersection->LineEdit1 )
482       myLine1 = GEOM::GEOM_Object::_nil();
483     else if ( myEditCurrentArgument == GroupLineIntersection->LineEdit2 )
484       myLine2 = GEOM::GEOM_Object::_nil();
485   }
486
487   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
488   SALOME_ListIO aSelList;
489   aSelMgr->selectedObjects(aSelList);
490
491   if (aSelList.Extent() == 1) {
492     Standard_Boolean aRes = Standard_False;
493     Handle(SALOME_InteractiveObject) anIO = aSelList.First();
494     GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
495     if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
496       QString aName = GEOMBase::GetName(aSelectedObject);
497       TopoDS_Shape aShape;
498       if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
499         if ( id == GEOM_POINT_XYZ || id == GEOM_POINT_REF)
500           myNeedType = TopAbs_VERTEX;
501         else if ( id == GEOM_POINT_EDGE )
502           myNeedType = TopAbs_EDGE;
503         else if ( id == GEOM_POINT_SURF )
504           myNeedType = TopAbs_FACE;
505
506         TColStd_IndexedMapOfInteger aMap;
507         aSelMgr->GetIndexes(anIO, aMap);
508         if ( aMap.Extent() == 1 ) { // Local Selection
509           int anIndex = aMap( 1 );
510           if ( myNeedType == TopAbs_FACE )
511             aName += QString( ":face_%1" ).arg( anIndex );
512           else if ( myNeedType == TopAbs_WIRE )
513             aName += QString( ":wire_%1" ).arg( anIndex );
514           else if ( myNeedType == TopAbs_EDGE )
515             aName += QString( ":edge_%1" ).arg( anIndex );
516           else  if ( myNeedType == TopAbs_VERTEX )
517             aName += QString( ":vertex_%1" ).arg( anIndex );
518
519           //Find SubShape Object in Father
520           GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
521           if ( aFindedObject->_is_nil() ) { // Object not found in study
522             GEOM::GEOM_IShapesOperations_var aShapesOp =
523               getGeomEngine()->GetIShapesOperations(getStudyId());
524             aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
525           }
526           else {
527             aSelectedObject = aFindedObject; // get Object from study
528           }
529           GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE );
530         }
531         else { // Global Selection
532           if ( aShape.ShapeType() != myNeedType ) {
533             aSelectedObject = GEOM::GEOM_Object::_nil();
534             aName = "";
535             if ( id == GEOM_POINT_XYZ ) return;
536           }
537         }
538       }
539
540       if ( aShape.IsNull() || aShape.ShapeType() != myNeedType)
541         return;
542
543       myBusy = true;
544
545       if ( id == GEOM_POINT_XYZ ) {
546         gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
547         GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
548         GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );
549         GroupXYZ->SpinBox_DZ->setValue( aPnt.Z() );
550       }
551       else if ( id == GEOM_POINT_REF ) {
552         myRefPoint = aSelectedObject;
553         GroupRefPoint->LineEdit1->setText( aName );
554       }
555       else if ( id == GEOM_POINT_EDGE ) {
556         myEdge = aSelectedObject;
557         GroupOnCurve->LineEdit1->setText( aName );
558       }
559       else if ( id == GEOM_POINT_INTINT ) {
560         myEditCurrentArgument->setText( aName );
561         if ( myEditCurrentArgument == GroupLineIntersection->LineEdit1 ) {
562           myLine1 = aSelectedObject;
563           if ( !myLine1->_is_nil() && myLine2->_is_nil() ) {
564             GroupLineIntersection->PushButton2->setMenu( 0 );
565             GroupLineIntersection->PushButton2->click();
566             GroupLineIntersection->PushButton2->setDown(true);
567             GroupLineIntersection->PushButton2->setMenu( myBtnPopup );
568           }
569         }
570         else if ( myEditCurrentArgument == GroupLineIntersection->LineEdit2 ) {
571           myLine2 = aSelectedObject;
572           if ( !myLine2->_is_nil() && myLine1->_is_nil() ) {
573             GroupLineIntersection->PushButton1->setMenu( 0 );
574             GroupLineIntersection->PushButton1->click();
575             GroupLineIntersection->PushButton1->setDown(true);
576             GroupLineIntersection->PushButton1->setMenu( myBtnPopup );
577           }
578         }
579       }
580       else if ( id == GEOM_POINT_SURF )
581       {
582         myFace = aSelectedObject;
583         GroupOnSurface->LineEdit1->setText( aName );
584       }
585       myBusy = false;
586     }
587   }
588
589   displayPreview();
590 }
591
592
593 //=================================================================================
594 // function : LineEditReturnPressed()
595 // purpose  :
596 //=================================================================================
597 void BasicGUI_PointDlg::LineEditReturnPressed()
598 {
599   QLineEdit* send = (QLineEdit*)sender();
600   if ( send == GroupRefPoint->LineEdit1         ||
601        send == GroupOnCurve->LineEdit1          ||
602        send == GroupLineIntersection->LineEdit1 ||
603        send == GroupLineIntersection->LineEdit2  ) {
604     myEditCurrentArgument = send;
605     GEOMBase_Skeleton::LineEditReturnPressed();
606   }
607 }
608
609
610 //=================================================================================
611 // function : SetEditCurrentArgument()
612 // purpose  :
613 //=================================================================================
614 void BasicGUI_PointDlg::SetEditCurrentArgument()
615 {
616   QPushButton* send = (QPushButton*)sender();
617
618   if ( send == GroupRefPoint->PushButton1 ) {
619     GroupRefPoint->LineEdit1->setFocus();
620     myEditCurrentArgument = GroupRefPoint->LineEdit1;
621     globalSelection(); // close local contexts, if any
622     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
623   }
624   else if ( send == GroupOnCurve->PushButton1 ) {
625     GroupOnCurve->LineEdit1->setFocus();
626     myEditCurrentArgument = GroupOnCurve->LineEdit1;
627     globalSelection(); // close local contexts, if any
628     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
629   }
630   else if ( send == GroupOnSurface->PushButton1 )
631   {
632     GroupOnSurface->LineEdit1->setFocus();
633     myEditCurrentArgument = GroupOnSurface->LineEdit1;
634     globalSelection(); // close local contexts, if any
635     localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
636   }
637   else if ( send == GroupLineIntersection->PushButton1 ) {
638     GroupLineIntersection->LineEdit1->setFocus();
639     myEditCurrentArgument = GroupLineIntersection->LineEdit1;
640     GroupLineIntersection->PushButton2->setDown( false );
641     GroupLineIntersection->LineEdit1->setEnabled(true);
642     GroupLineIntersection->LineEdit2->setEnabled(false);
643   }
644   else if ( send == GroupLineIntersection->PushButton2 ) {
645     GroupLineIntersection->LineEdit2->setFocus();
646     myEditCurrentArgument = GroupLineIntersection->LineEdit2;
647     GroupLineIntersection->PushButton1->setDown( false );
648     GroupLineIntersection->LineEdit1->setEnabled(false);
649     GroupLineIntersection->LineEdit2->setEnabled(true);
650   }
651   send->setDown(true);
652
653   if ( ( send == GroupLineIntersection->PushButton1 ||
654          send == GroupLineIntersection->PushButton2 ) && !myBusy )
655     SelectionIntoArgument();
656 }
657
658
659 //=================================================================================
660 // function : enterEvent()
661 // purpose  : to reactivate this dialog box when mouse enter onto the window
662 //=================================================================================
663 void BasicGUI_PointDlg::enterEvent( QEvent* )
664 {
665   if ( !mainFrame()->GroupConstructors->isEnabled() )
666     ActivateThisDialog();
667 }
668
669
670 //=================================================================================
671 // function : ActivateThisDialog()
672 // purpose  :
673 //=================================================================================
674 void BasicGUI_PointDlg::ActivateThisDialog( )
675 {
676   GEOMBase_Skeleton::ActivateThisDialog();
677
678   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
679            this, SLOT( SelectionIntoArgument() ) );
680
681   ConstructorsClicked( getConstructorId() );
682 }
683
684
685 //=================================================================================
686 // function : DeactivateActiveDialog()
687 // purpose  : public slot to deactivate if active
688 //=================================================================================
689 void BasicGUI_PointDlg::DeactivateActiveDialog()
690 {
691   // myGeomGUI->SetState( -1 );
692   GEOMBase_Skeleton::DeactivateActiveDialog();
693 }
694
695
696 //=================================================================================
697 // function : ValueChangedInSpinBox()
698 // purpose  :
699 //=================================================================================
700 void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
701 {
702   displayPreview();
703 }
704
705 //=================================================================================
706 // funcion  : getParameter()
707 // purpose  :
708 //=================================================================================
709 double BasicGUI_PointDlg::getParameter() const
710 {
711   return GroupOnCurve->SpinBox_DX->value();
712 }
713
714
715 //=================================================================================
716 // funcion  : getUParameter()
717 // purpose  :
718 //=================================================================================
719 double BasicGUI_PointDlg::getUParameter() const
720 {
721   return GroupOnSurface->SpinBox_DX->value();
722 }
723
724
725 //=================================================================================
726 // funcion  : getVParameter()
727 // purpose  :
728 //=================================================================================
729 double BasicGUI_PointDlg::getVParameter() const
730 {
731   return GroupOnSurface->SpinBox_DY->value();
732 }
733
734
735 //=================================================================================
736 // function : OnPointSelected
737 // purpose  :
738 //=================================================================================
739 void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
740 {
741   if ( getConstructorId() == GEOM_POINT_XYZ ) {
742     GroupXYZ->SpinBox_DX->setValue( thePnt.X() );
743     GroupXYZ->SpinBox_DY->setValue( thePnt.Y() );
744     GroupXYZ->SpinBox_DZ->setValue( thePnt.Z() );
745
746     displayPreview();
747   }
748 }
749
750 //=================================================================================
751 // function : createOperation
752 // purpose  :
753 //=================================================================================
754 GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
755 {
756   return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
757 }
758
759 //=================================================================================
760 // function : isValid
761 // purpose  :
762 //=================================================================================
763 bool BasicGUI_PointDlg::isValid( QString& msg )
764 {
765   const int id = getConstructorId();
766   if ( id == GEOM_POINT_XYZ ) {
767     bool ok = true;
768     ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
769     ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
770     ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
771     return ok;
772   }
773   else if ( id == GEOM_POINT_REF ) {
774     bool ok = true;
775     ok = GroupRefPoint->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
776     ok = GroupRefPoint->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
777     ok = GroupRefPoint->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
778
779     return !myRefPoint->_is_nil() && ok;
780   }
781   else if ( id == GEOM_POINT_EDGE ) {
782     bool ok = true;
783     if ( myParamCoord->checkedId() == PARAM_VALUE || myParamCoord->checkedId() == LENGTH_VALUE )
784       ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
785     else {
786       ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
787       ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
788       ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
789     }
790     return !myEdge->_is_nil() && ok;
791   }
792   else if ( id == GEOM_POINT_INTINT )
793     return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
794   else if ( id == GEOM_POINT_SURF ) {
795     bool ok = true;
796     if ( myParamCoord->checkedId() == PARAM_VALUE ) {
797       ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
798       ok = GroupOnSurface->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
799     }
800     else {
801       ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
802       ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
803       ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
804     }
805     return !myFace->_is_nil() && ok;
806   }
807   return false;
808 }
809
810 //=================================================================================
811 // function : execute
812 // purpose  :
813 //=================================================================================
814 bool BasicGUI_PointDlg::execute( ObjectList& objects )
815 {
816   bool res = false;
817
818   GEOM::GEOM_Object_var anObj;
819   QStringList aParameters;
820
821   GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
822
823   switch ( getConstructorId() ) {
824   case GEOM_POINT_XYZ :
825     {
826       double x = GroupXYZ->SpinBox_DX->value();
827       double y = GroupXYZ->SpinBox_DY->value();
828       double z = GroupXYZ->SpinBox_DZ->value();
829
830       aParameters << GroupXYZ->SpinBox_DX->text();
831       aParameters << GroupXYZ->SpinBox_DY->text();
832       aParameters << GroupXYZ->SpinBox_DZ->text();
833
834       anObj = anOper->MakePointXYZ( x, y, z );
835       res = true;
836       break;
837     }
838   case GEOM_POINT_REF :
839     {
840       double dx = GroupRefPoint->SpinBox_DX->value();
841       double dy = GroupRefPoint->SpinBox_DY->value();
842       double dz = GroupRefPoint->SpinBox_DZ->value();
843
844       aParameters << GroupRefPoint->SpinBox_DX->text();
845       aParameters << GroupRefPoint->SpinBox_DY->text();
846       aParameters << GroupRefPoint->SpinBox_DZ->text();
847
848       anObj = anOper->MakePointWithReference( myRefPoint, dx, dy, dz );
849       res = true;
850       break;
851     }
852   case GEOM_POINT_EDGE :
853     {
854       if ( myParamCoord->checkedId() == PARAM_VALUE ) {
855         anObj = anOper->MakePointOnCurve( myEdge, getParameter() );
856         aParameters<<GroupOnCurve->SpinBox_DX->text();
857       } 
858       else if ( myParamCoord->checkedId() == LENGTH_VALUE ) {
859         anObj = anOper->MakePointOnCurveByLength( myEdge, getParameter() ); 
860         aParameters<<GroupOnCurve->SpinBox_DX->text();
861       }
862       else if ( myParamCoord->checkedId() == COORD_VALUE ) {
863         double x = GroupXYZ->SpinBox_DX->value();
864         double y = GroupXYZ->SpinBox_DY->value();
865         double z = GroupXYZ->SpinBox_DZ->value();
866
867         aParameters << GroupXYZ->SpinBox_DX->text();
868         aParameters << GroupXYZ->SpinBox_DY->text();
869         aParameters << GroupXYZ->SpinBox_DZ->text();
870
871         anObj = anOper->MakePointOnCurveByCoord( myEdge, x, y, z );
872       }
873       res = true;
874       break;
875     }
876   case GEOM_POINT_INTINT :
877     anObj = anOper->MakePointOnLinesIntersection( myLine1, myLine2 );
878     if ( !anObj->_is_nil() ) {
879       QString aName = getNewObjectName();
880       if ( anObj->GetShapeType() == GEOM::COMPOUND && aName.startsWith("Vertex") )
881         initName( tr( "GEOM_COMPOUND" ) );
882       else if (  anObj->GetShapeType() == GEOM::VERTEX && aName.startsWith("Compound"))
883         initName( tr( "GEOM_VERTEX" ) );
884     }
885     res = true;
886     break;
887   case GEOM_POINT_SURF :
888     {
889       if ( myParamCoord->checkedId() == PARAM_VALUE ) {
890         anObj = anOper->MakePointOnSurface( myFace, getUParameter(), getVParameter() );
891         aParameters<<GroupOnSurface->SpinBox_DX->text();
892         aParameters<<GroupOnSurface->SpinBox_DY->text();
893       } else {
894         double x = GroupXYZ->SpinBox_DX->value();
895         double y = GroupXYZ->SpinBox_DY->value();
896         double z = GroupXYZ->SpinBox_DZ->value();
897
898         aParameters << GroupXYZ->SpinBox_DX->text();
899         aParameters << GroupXYZ->SpinBox_DY->text();
900         aParameters << GroupXYZ->SpinBox_DZ->text();
901
902         anObj = anOper->MakePointOnSurfaceByCoord( myFace, x, y, z );
903       }
904       res = true;
905       break;
906     }
907   }
908
909   const int id = getConstructorId();
910   if(!anObj->_is_nil() && !IsPreview() && (id == GEOM_POINT_XYZ ||
911                                            id == GEOM_POINT_REF ||
912                                            id == GEOM_POINT_EDGE ||
913                                            id == GEOM_POINT_SURF) ) {
914       anObj->SetParameters(aParameters.join(":").toLatin1().constData());
915   }
916
917   if ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) {
918     TopoDS_Shape aShape;
919     if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() &&
920          aShape.ShapeType() == TopAbs_VERTEX ) {
921       gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
922       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
923       int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
924       myX->setText( DlgRef::PrintDoubleValue( aPnt.X(), aPrecision ) );
925       myY->setText( DlgRef::PrintDoubleValue( aPnt.Y(), aPrecision ) );
926       myZ->setText( DlgRef::PrintDoubleValue( aPnt.Z(), aPrecision ) );
927     }
928     else {
929       myX->setText( "" );
930       myY->setText( "" );
931       myZ->setText( "" );
932     }
933   }
934
935   if ( !anObj->_is_nil() ) {
936     objects.push_back( anObj._retn() );
937   }
938
939   return res;
940 }
941
942 //=================================================================================
943 // function : addSubshapeToStudy
944 // purpose  : virtual method to add new SubObjects if local selection
945 //=================================================================================
946 void BasicGUI_PointDlg::addSubshapesToStudy()
947 {
948   QMap<QString, GEOM::GEOM_Object_var> objMap;
949
950   switch ( getConstructorId() ) {
951   case GEOM_POINT_XYZ:
952     break;
953   case GEOM_POINT_REF:
954     objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
955     break;
956   case GEOM_POINT_EDGE:
957     objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
958     break;
959   case GEOM_POINT_INTINT:
960     objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
961     objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
962     break;
963   case GEOM_POINT_SURF:
964     objMap[GroupOnSurface->LineEdit1->text()] = myFace;
965     break;
966   }
967   addSubshapesToFather( objMap );
968 }
969
970 //=================================================================================
971 // function : ClickParamCoord()
972 // purpose  :
973 //=================================================================================
974 void BasicGUI_PointDlg::ClickParamCoord( int id )
975 {
976   updateParamCoord( true );
977   displayPreview();
978 }
979
980 //=================================================================================
981 // function : updateParamCoord
982 // purpose  :
983 //=================================================================================
984 void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
985 {
986   bool isParam = myParamCoord->checkedId() == PARAM_VALUE;
987   bool isLength = myParamCoord->checkedId() == LENGTH_VALUE;
988
989   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
990   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
991
992   const int id = getConstructorId();
993   if ( id == GEOM_POINT_EDGE ) {
994     GroupOnCurve->TextLabel2->setShown( isParam || isLength ); 
995     GroupOnCurve->SpinBox_DX->setShown( isParam || isLength );
996     if ( isParam ){
997       initSpinBox( GroupOnCurve->SpinBox_DX, 0., 1., 0.1, "parametric_precision" );
998       GroupOnCurve->SpinBox_DX->setValue( 0.5 );
999       GroupOnCurve->TextLabel2->setText(tr( "GEOM_PARAMETER" ));
1000     }
1001     else if ( isLength ){
1002       initSpinBox( GroupOnCurve->SpinBox_DX, 0.0, COORD_MAX, 0.1 * step, "length_precision" );
1003       GroupOnCurve->SpinBox_DX->setValue( 0.0 );
1004       GroupOnCurve->TextLabel2->setText(tr( "GEOM_LENGTH" ));
1005     }
1006   }  
1007   else if ( id == GEOM_POINT_SURF ) {
1008     GroupOnSurface->TextLabel2->setShown( isParam );
1009     GroupOnSurface->TextLabel3->setShown( isParam );
1010     GroupOnSurface->SpinBox_DX->setShown( isParam );
1011     GroupOnSurface->SpinBox_DY->setShown( isParam );
1012   }
1013     
1014   GroupXYZ->setShown( !isParam && !isLength );
1015
1016   if ( theIsUpdate )
1017     QTimer::singleShot(50, this, SLOT(updateSize()));
1018 }
1019
1020 //=================================================================================
1021 // function : onBtnPopup()
1022 // purpose  :
1023 //=================================================================================
1024 void BasicGUI_PointDlg::onBtnPopup( QAction* a )
1025 {
1026   int index = myActions[a];
1027   globalSelection(); // close local contexts, if any
1028   QString type;
1029   if ( index == 0 )
1030     myNeedType = TopAbs_EDGE;
1031   else 
1032     myNeedType = TopAbs_WIRE;
1033   
1034   localSelection( GEOM::GEOM_Object::_nil(), myNeedType );
1035 }
1036
1037 //=================================================================================
1038 // function : updateSize
1039 // purpose  : adjust dialog size to minimum
1040 //=================================================================================
1041 void BasicGUI_PointDlg::updateSize() 
1042 {
1043   qApp->processEvents();
1044   updateGeometry();
1045   resize( minimumSizeHint() );
1046 }