Salome HOME
Porting to Qt4.
[modules/geom.git] / src / BasicGUI / BasicGUI_PointDlg.cxx
1 //  GEOM GEOMGUI : GUI for Geometry component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : BasicGUI_PointDlg.cxx
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #include "BasicGUI_PointDlg.h"
30
31 #include "SUIT_ResourceMgr.h"
32 #include "SUIT_Session.h"
33 #include "SalomeApp_Application.h"
34 #include "LightApp_SelectionMgr.h"
35
36 #include "GeometryGUI.h"
37 #include "GEOMBase.h"
38
39 #include "DlgRef_SpinBox.h"
40 #include "DlgRef_1Sel1Spin.h"
41 #include "DlgRef_3Spin.h"
42 #include "DlgRef_1Sel3Spin.h"
43
44 #include "GEOMImpl_Types.hxx"
45
46 #include <QApplication>
47 #include <QLabel>
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 using namespace std;
59 //=================================================================================
60 // class    : BasicGUI_PointDlg()
61 // purpose  : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the 
62 //            name 'name' and widget flags set to 'f'.
63 //            The dialog will by default be modeless, unless you set 'modal' to
64 //            TRUE to construct a modal dialog.
65 //=================================================================================
66 BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
67                                      const char* name, bool modal, Qt::WindowFlags fl)
68   :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl )
69 {
70   QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT")));
71   QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_EDGE")));
72   QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
73   QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_REF")));
74
75   setWindowTitle(tr("GEOM_POINT_TITLE"));
76
77   QFrame* aFrame = new QFrame( this );
78   aFrame->setContentsMargins( 0, 0, 0, 0 );
79   aFrame->setFrameStyle( QFrame::NoFrame );
80   QHBoxLayout* aFrameLayout = new QHBoxLayout( aFrame );
81   
82   /***************************************************************/
83   GroupConstructors->setTitle(tr("GEOM_POINTS"));
84   RadioButton1->setIcon(image0);
85   RadioButton2->setIcon(image3);
86   RadioButton3->setIcon(image1);
87
88   GroupXYZ = new DlgRef_3Spin( aFrame, "GroupXYZ" );
89   GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
90   GroupXYZ->TextLabel1->setText(tr("GEOM_X"));
91   GroupXYZ->TextLabel2->setText(tr("GEOM_Y"));
92   GroupXYZ->TextLabel3->setText(tr("GEOM_Z"));
93   aFrameLayout->addWidget(GroupXYZ);
94
95   GroupOnCurve = new DlgRef_1Sel1Spin( aFrame, "GroupOnCurve" );
96   GroupOnCurve->GroupBox1->setTitle(tr("GEOM_PARAM_POINT"));
97   GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE"));
98   GroupOnCurve->TextLabel2->setText(tr("GEOM_PARAMETER"));
99   GroupOnCurve->PushButton1->setIcon(image2);
100   aFrameLayout->addWidget(GroupOnCurve);
101
102   GroupRefPoint = new DlgRef_1Sel3Spin( aFrame, "GoupRefPoint" );
103   GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT"));
104   GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT"));
105   GroupRefPoint->PushButton1->setIcon(image2);
106   GroupRefPoint->TextLabel2->setText(tr("GEOM_DX"));
107   GroupRefPoint->TextLabel3->setText(tr("GEOM_DY"));
108   GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
109   aFrameLayout->addWidget(GroupRefPoint);
110
111   gridLayout1->addWidget( aFrame, 2, 0 );
112   /***************************************************************/
113
114   myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), aFrame );
115   QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp );
116   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), myCoordGrp ), 0, 0 );
117   myX = new QLineEdit( myCoordGrp );
118   myCoordGrpLayout->addWidget( myX, 0, 1 );
119   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), myCoordGrp ), 1, 0 );
120   myY = new QLineEdit( myCoordGrp );
121   myCoordGrpLayout->addWidget( myY, 1, 1 );
122   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), myCoordGrp ), 2, 0 );
123   myZ = new QLineEdit( myCoordGrp );
124   myCoordGrpLayout->addWidget( myZ, 2, 1 );
125
126   myX->setReadOnly( true );
127   myY->setReadOnly( true );
128   myZ->setReadOnly( true );
129
130   myX->setEnabled( false );
131   myY->setEnabled( false );
132   myZ->setEnabled( false );
133
134   QPalette aPal = myX->palette();
135   aPal.setColor( QPalette::Disabled, QPalette::Text, QColor( 0, 0, 0 ) ) ;
136   myX->setPalette( aPal );
137   myY->setPalette( aPal );
138   myZ->setPalette( aPal );
139
140   setHelpFileName("point.htm");
141  
142   Init();
143 }
144
145
146 //=================================================================================
147 // function : ~BasicGUI_PointDlg()
148 // purpose  : Destructor
149 //=================================================================================
150 BasicGUI_PointDlg::~BasicGUI_PointDlg()
151 {
152 }
153
154
155 //=================================================================================
156 // function : Init()
157 // purpose  :
158 //=================================================================================
159 void BasicGUI_PointDlg::Init()
160 {
161   GroupOnCurve->LineEdit1->setReadOnly( true );
162   GroupRefPoint->LineEdit1->setReadOnly( true );
163
164   myEdge = GEOM::GEOM_Object::_nil();
165   myRefPoint = GEOM::GEOM_Object::_nil();
166
167   myEditCurrentArgument = 0;
168
169   /* Get setting of step value from file configuration */
170   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
171   double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
172   
173   /* min, max, step and decimals for spin boxes */
174   GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
175   GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
176   GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
177   GroupXYZ->SpinBox_DX->SetValue(0.0);
178   GroupXYZ->SpinBox_DY->SetValue(0.0);
179   GroupXYZ->SpinBox_DZ->SetValue(0.0);
180
181   GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
182   GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
183   GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3);
184   GroupRefPoint->SpinBox_DX->SetValue(0.0);
185   GroupRefPoint->SpinBox_DY->SetValue(0.0);
186   GroupRefPoint->SpinBox_DZ->SetValue(0.0);
187
188   step = 0.1;
189   GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, 3);
190   GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
191
192   /* signals and slots connections */
193   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
194   connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
195   connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
196
197   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
198   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
199   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
200
201   connect(GroupOnCurve->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
202   connect(GroupOnCurve->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
203
204   connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
205   connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
206   connect(GroupXYZ->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
207   connect(GroupXYZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
208   connect(GroupRefPoint->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
209   connect(GroupRefPoint->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
210   connect(GroupRefPoint->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
211
212   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupOnCurve->SpinBox_DX, SLOT(SetStep(double)));
213   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DX, SLOT(SetStep(double)));
214   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DY, SLOT(SetStep(double)));
215   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupXYZ->SpinBox_DZ, SLOT(SetStep(double)));
216   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DX, SLOT(SetStep(double)));
217   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DY, SLOT(SetStep(double)));
218   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupRefPoint->SpinBox_DZ, SLOT(SetStep(double)));
219
220   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
221           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));  
222   
223   initName( tr("GEOM_VERTEX").toStdString().c_str() );
224   
225   ConstructorsClicked( 0 );
226 }
227
228
229 //=================================================================================
230 // function : ConstructorsClicked()
231 // purpose  : Radio button management
232 //=================================================================================
233 void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
234 {  
235   switch ( constructorId )
236   {
237   case 0:
238     {
239       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
240
241       GroupRefPoint->hide();
242       GroupOnCurve->hide();
243
244       GroupXYZ->show();
245
246       myCoordGrp->hide();
247       break;
248     }
249   case 1:
250     {
251       myEditCurrentArgument = GroupRefPoint->LineEdit1;
252       myEditCurrentArgument->setText("");
253       myRefPoint = GEOM::GEOM_Object::_nil();
254
255       globalSelection( GEOM_POINT );
256
257       GroupXYZ->hide();
258       GroupOnCurve->hide();
259
260       GroupRefPoint->show();
261       
262       myCoordGrp->show();
263       break;
264     }
265   case 2:
266     {
267       myEditCurrentArgument = GroupOnCurve->LineEdit1;
268       myEditCurrentArgument->setText("");
269       myEdge = GEOM::GEOM_Object::_nil();
270
271       globalSelection( GEOM_EDGE );
272
273       GroupXYZ->hide();
274       GroupRefPoint->hide();
275
276       GroupOnCurve->show();
277       
278       myCoordGrp->show();
279       break;
280     }
281   }
282
283   myX->setText( "" );
284   myY->setText( "" );
285   myZ->setText( "" );
286
287   qApp->processEvents();
288   updateGeometry();
289   resize( minimumSize() );
290
291   SelectionIntoArgument();
292 }
293
294
295 //=================================================================================
296 // function : ClickOnOk()
297 // purpose  :
298 //=================================================================================
299 void BasicGUI_PointDlg::ClickOnOk()
300 {
301   if ( onAccept() )
302     ClickOnCancel();
303 }
304
305
306 //=================================================================================
307 // function : ClickOnApply()
308 // purpose  :
309 //=================================================================================
310 bool BasicGUI_PointDlg::ClickOnApply()
311 {
312   if ( !onAccept() )
313     return false;
314   
315   initName();
316   ConstructorsClicked( getConstructorId() );
317   return true;
318 }
319
320
321 //=================================================================================
322 // function : ClickOnCancel()
323 // purpose  :
324 //=================================================================================
325 void BasicGUI_PointDlg::ClickOnCancel()
326 {
327   GEOMBase_Skeleton::ClickOnCancel();
328 }
329
330
331 //=================================================================================
332 // function : SelectionIntoArgument()
333 // purpose  : Called when selection as changed (for constructors not using local context)
334 //=================================================================================
335 void BasicGUI_PointDlg::SelectionIntoArgument()
336 {
337   const int id = getConstructorId();
338
339   if ( ( id == 1 || id == 2 ) && myEditCurrentArgument != 0 )
340   {
341     myEditCurrentArgument->setText("");
342     myX->setText( "" );
343     myY->setText( "" );
344     myZ->setText( "" );
345     myRefPoint = myEdge = GEOM::GEOM_Object::_nil();
346   }
347
348   if ( IObjectCount() == 1 )
349   {
350     Standard_Boolean aRes = Standard_False;
351     Handle(SALOME_InteractiveObject) anIO = firstIObject();
352     GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
353     if ( !CORBA::is_nil( aSelectedObject ) && aRes )
354     {
355       if ( id == 0 )
356       {
357         // get CORBA reference to data object
358         TopoDS_Shape aShape = myGeomGUI->GetShapeReader().GetShape
359           ( myGeomGUI->GetGeomGen(), aSelectedObject );
360         if ( aShape.IsNull() )
361           return;
362
363         if ( aShape.ShapeType() != TopAbs_VERTEX )
364         {
365           TColStd_IndexedMapOfInteger aMap;
366           LightApp_Application* anApp =
367             (LightApp_Application*)(SUIT_Session::session()->activeApplication());
368           anApp->selectionMgr()->GetIndexes( anIO, aMap );
369
370           if ( aMap.Extent() == 1 )
371           {
372             int anIndex = aMap( 1 );
373             TopTools_IndexedMapOfShape aShapes;
374             TopExp::MapShapes( aShape, aShapes );
375             aShape = aShapes.FindKey( anIndex );
376
377             if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX )
378               return;
379           }
380           else
381             return;
382         }
383
384         gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
385         GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
386         GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() );
387         GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() );
388       }
389       else if ( id == 1 )
390       {
391         myRefPoint = aSelectedObject;
392         GroupRefPoint->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
393       }
394       else if ( id == 2 )
395       {
396         myEdge = aSelectedObject;
397         GroupOnCurve->LineEdit1->setText( GEOMBase::GetName( aSelectedObject ) );
398       }
399     }
400   }
401
402   displayPreview();
403 }
404
405
406 //=================================================================================
407 // function : LineEditReturnPressed()
408 // purpose  :
409 //=================================================================================
410 void BasicGUI_PointDlg::LineEditReturnPressed()
411 {
412   QLineEdit* send = (QLineEdit*)sender();
413   if ( send == GroupRefPoint->LineEdit1 || send == GroupOnCurve->LineEdit1 )
414     {
415       myEditCurrentArgument = send;
416       GEOMBase_Skeleton::LineEditReturnPressed();
417     }
418 }
419
420
421 //=================================================================================
422 // function : SetEditCurrentArgument()
423 // purpose  :
424 //=================================================================================
425 void BasicGUI_PointDlg::SetEditCurrentArgument()
426 {
427   QPushButton* send = (QPushButton*)sender();
428
429   if ( send == GroupRefPoint->PushButton1 )
430   {
431     GroupRefPoint->LineEdit1->setFocus();
432     myEditCurrentArgument = GroupRefPoint->LineEdit1;
433     
434     globalSelection( GEOM_POINT );
435   }
436   else if ( send == GroupOnCurve->PushButton1 )
437   {
438     GroupOnCurve->LineEdit1->setFocus();
439     myEditCurrentArgument = GroupOnCurve->LineEdit1;
440     
441     globalSelection( GEOM_EDGE );
442   }
443 }
444
445
446 //=================================================================================
447 // function : enterEvent()
448 // purpose  : to reactivate this dialog box when mouse enter onto the window
449 //=================================================================================
450 void BasicGUI_PointDlg::enterEvent(QEvent* e)
451 {
452   if ( !GroupConstructors->isEnabled() )
453     ActivateThisDialog();
454 }
455
456
457 //=================================================================================
458 // function : ActivateThisDialog()
459 // purpose  :
460 //=================================================================================
461 void BasicGUI_PointDlg::ActivateThisDialog( )
462 {
463   GEOMBase_Skeleton::ActivateThisDialog();
464   // myGeomGUI->SetState( 0 );
465   ConstructorsClicked( getConstructorId() );
466 }
467
468
469 //=================================================================================
470 // function : DeactivateActiveDialog()
471 // purpose  : public slot to deactivate if active
472 //=================================================================================
473 void BasicGUI_PointDlg::DeactivateActiveDialog()
474 {
475   // myGeomGUI->SetState( -1 );
476   GEOMBase_Skeleton::DeactivateActiveDialog();
477 }
478
479
480 //=================================================================================
481 // function : ValueChangedInSpinBox()
482 // purpose  :
483 //=================================================================================
484 void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
485 {
486   displayPreview();
487 }
488
489 //=================================================================================
490 // funcion  : getParameter()
491 // purpose  :
492 //=================================================================================
493 double BasicGUI_PointDlg::getParameter() const
494 {
495   return GroupOnCurve->SpinBox_DX->GetValue();
496 }
497
498 //=================================================================================
499 // function : OnPointSelected
500 // purpose  :
501 //=================================================================================
502 void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
503 {
504   if ( getConstructorId() == 0 )
505   {
506     GroupXYZ->SpinBox_DX->SetValue( thePnt.X() );
507     GroupXYZ->SpinBox_DY->SetValue( thePnt.Y() );
508     GroupXYZ->SpinBox_DZ->SetValue( thePnt.Z() );
509
510     displayPreview();
511   }
512 }
513
514 //=================================================================================
515 // function : createOperation
516 // purpose  :
517 //=================================================================================
518 GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
519 {
520   return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
521 }
522
523 //=================================================================================
524 // function : isValid
525 // purpose  :
526 //=================================================================================
527 bool BasicGUI_PointDlg::isValid( QString& msg )
528 {
529   const int id = getConstructorId();
530   if ( id == 0 )
531     return true;
532   else if ( id == 1 )
533     return !myRefPoint->_is_nil();
534   else if ( id == 2 )
535     return !myEdge->_is_nil();
536   return false;
537 }
538
539 //=================================================================================
540 // function : execute
541 // purpose  :
542 //=================================================================================
543 bool BasicGUI_PointDlg::execute( ObjectList& objects )
544 {
545   bool res = false;
546
547   GEOM::GEOM_Object_var anObj;
548
549   switch ( getConstructorId() )
550   {
551   case 0 :
552   {
553     double x = GroupXYZ->SpinBox_DX->GetValue();
554     double y = GroupXYZ->SpinBox_DY->GetValue();
555     double z = GroupXYZ->SpinBox_DZ->GetValue();
556       
557     anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x,y,z );
558     res = true;
559     break;
560   }
561   case 1 :
562   {
563     double dx = GroupRefPoint->SpinBox_DX->GetValue();
564     double dy = GroupRefPoint->SpinBox_DY->GetValue();
565     double dz = GroupRefPoint->SpinBox_DZ->GetValue();
566   
567     anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
568       MakePointWithReference( myRefPoint, dx, dy, dz );
569     res = true;
570     break;
571   }
572   case 2 :
573     anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
574       MakePointOnCurve( myEdge, getParameter() );
575     res = true;
576     break;
577   }
578
579   if ( getConstructorId() == 1 || getConstructorId() == 2 )
580   {
581     TopoDS_Shape aShape;
582     if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
583     {
584       gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
585       myX->setText( QString( "%1" ).arg( aPnt.X() ) );
586       myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
587       myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
588     }
589     else
590     {
591       myX->setText( "" );
592       myY->setText( "" );
593       myZ->setText( "" );
594     }
595   }
596   
597   if ( !anObj->_is_nil() )
598   {
599     //printf( "--> a valid point is created\n" );
600     objects.push_back( anObj._retn() );
601   }
602
603   return res;
604 }
605
606 //=================================================================================
607 // function : closeEvent
608 // purpose  :
609 //=================================================================================
610 void BasicGUI_PointDlg::closeEvent( QCloseEvent* e )
611 {
612   GEOMBase_Skeleton::closeEvent( e );
613 }