1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : BasicGUI_PointDlg.cxx
23 // Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
26 #include "BasicGUI_PointDlg.h"
28 #include <SUIT_ResourceMgr.h>
29 #include <SUIT_Session.h>
30 #include <SalomeApp_Application.h>
31 #include <LightApp_SelectionMgr.h>
33 #include <GeometryGUI.h>
38 #include <GEOMImpl_Types.hxx>
40 #include <QApplication>
44 #include <TopoDS_Shape.hxx>
45 #include <TopAbs_ShapeEnum.hxx>
47 #include <BRep_Tool.hxx>
49 #include <TColStd_IndexedMapOfInteger.hxx>
50 #include <TopTools_IndexedMapOfShape.hxx>
52 //=================================================================================
53 // class : BasicGUI_PointDlg()
54 // purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
55 // name 'name' and widget flags set to 'f'.
56 // The dialog will by default be modeless, unless you set 'modal' to
57 // TRUE to construct a modal dialog.
58 //=================================================================================
59 BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* parent,
60 bool modal, Qt::WindowFlags fl )
61 : GEOMBase_Skeleton( theGeometryGUI, parent, modal, fl )
63 QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT") ) );
64 QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_EDGE" ) ) );
65 QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
66 QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_REF" ) ) );
67 QPixmap image4( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_POINT_LINES") ) );
69 setWindowTitle( tr( "GEOM_POINT_TITLE" ) );
71 /***************************************************************/
72 mainFrame()->GroupConstructors->setTitle( tr( "GEOM_POINTS" ) );
73 mainFrame()->RadioButton1->setIcon( image0 );
74 mainFrame()->RadioButton2->setIcon( image3 );
75 mainFrame()->RadioButton3->setIcon( image1 );
76 mainFrame()->RadioButton4->show();
77 mainFrame()->RadioButton4->setIcon( image4 );
79 GroupXYZ = new DlgRef_3Spin( centralWidget() );
80 GroupXYZ->GroupBox1->setTitle( tr( "GEOM_COORDINATES" ) );
81 GroupXYZ->TextLabel1->setText( tr( "GEOM_X" ) );
82 GroupXYZ->TextLabel2->setText( tr( "GEOM_Y" ) );
83 GroupXYZ->TextLabel3->setText( tr( "GEOM_Z" ) );
85 GroupOnCurve = new DlgRef_1Sel1Spin( centralWidget() );
86 GroupOnCurve->GroupBox1->setTitle( tr( "GEOM_PARAM_POINT" ) );
87 GroupOnCurve->TextLabel1->setText( tr( "GEOM_EDGE" ) );
88 GroupOnCurve->TextLabel2->setText( tr( "GEOM_PARAMETER" ) );
89 GroupOnCurve->PushButton1->setIcon( image2 );
91 GroupRefPoint = new DlgRef_1Sel3Spin( centralWidget() );
92 GroupRefPoint->GroupBox1->setTitle( tr( "GEOM_REF_POINT" ) );
93 GroupRefPoint->TextLabel1->setText( tr( "GEOM_POINT" ) );
94 GroupRefPoint->PushButton1->setIcon( image2 );
95 GroupRefPoint->TextLabel2->setText( tr( "GEOM_DX" ) );
96 GroupRefPoint->TextLabel3->setText( tr( "GEOM_DY" ) );
97 GroupRefPoint->TextLabel4->setText( tr( "GEOM_DZ" ) );
99 GroupLineIntersection = new DlgRef_2Sel( centralWidget() );
100 GroupLineIntersection->GroupBox1->setTitle( tr( "GEOM_LINE_INTERSECTION" ) );
101 GroupLineIntersection->TextLabel1->setText( tr( "GEOM_LINE1" ) );
102 GroupLineIntersection->TextLabel2->setText( tr( "GEOM_LINE2" ) );
103 GroupLineIntersection->PushButton1->setIcon( image2 );
104 GroupLineIntersection->PushButton2->setIcon( image2 );
106 myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), centralWidget() );
107 QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp );
108 myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), myCoordGrp ), 0, 0 );
109 myX = new QLineEdit( myCoordGrp );
110 myCoordGrpLayout->addWidget( myX, 0, 1 );
111 myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), myCoordGrp ), 1, 0 );
112 myY = new QLineEdit( myCoordGrp );
113 myCoordGrpLayout->addWidget( myY, 1, 1 );
114 myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), myCoordGrp ), 2, 0 );
115 myZ = new QLineEdit( myCoordGrp );
116 myCoordGrpLayout->addWidget( myZ, 2, 1 );
118 QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
119 layout->setMargin( 0 ); layout->setSpacing( 6 );
120 layout->addWidget( GroupXYZ );
121 layout->addWidget( GroupOnCurve );
122 layout->addWidget( GroupRefPoint );
123 layout->addWidget( GroupLineIntersection );
124 layout->addWidget( myCoordGrp );
126 myX->setReadOnly( true );
127 myY->setReadOnly( true );
128 myZ->setReadOnly( true );
130 myX->setEnabled( false );
131 myY->setEnabled( false );
132 myZ->setEnabled( false );
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 );
140 // setHelpFileName( "create_point_page.html" );
141 setHelpFileName( "point.htm" );
147 //=================================================================================
148 // function : ~BasicGUI_PointDlg()
149 // purpose : Destructor
150 //=================================================================================
151 BasicGUI_PointDlg::~BasicGUI_PointDlg()
156 //=================================================================================
159 //=================================================================================
160 void BasicGUI_PointDlg::Init()
162 GroupOnCurve->LineEdit1->setReadOnly( true );
163 GroupRefPoint->LineEdit1->setReadOnly( true );
164 GroupLineIntersection->LineEdit1->setReadOnly( true );
165 GroupLineIntersection->LineEdit2->setReadOnly( true );
167 myEdge = GEOM::GEOM_Object::_nil();
168 myRefPoint = GEOM::GEOM_Object::_nil();
170 myEditCurrentArgument = 0;
172 /* Get setting of step value from file configuration */
173 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
174 double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100 );
176 /* min, max, step and decimals for spin boxes */
177 initSpinBox( GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
178 initSpinBox( GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
179 initSpinBox( GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
180 GroupXYZ->SpinBox_DX->setValue( 0.0 );
181 GroupXYZ->SpinBox_DY->setValue( 0.0 );
182 GroupXYZ->SpinBox_DZ->setValue( 0.0 );
184 initSpinBox( GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
185 initSpinBox( GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
186 initSpinBox( GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX, step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
187 GroupRefPoint->SpinBox_DX->setValue( 0.0 );
188 GroupRefPoint->SpinBox_DY->setValue( 0.0 );
189 GroupRefPoint->SpinBox_DZ->setValue( 0.0 );
193 initSpinBox( GroupOnCurve->SpinBox_DX, 0., 1., step, 3 ); // VSR:TODO : DBL_DIGITS_DISPLAY
194 GroupOnCurve->SpinBox_DX->setValue( 0.5 );
196 /* signals and slots connections */
197 connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
198 connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
200 connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
201 connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
203 connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
205 connect( GroupOnCurve->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
206 connect( GroupOnCurve->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
208 connect( GroupLineIntersection->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
209 connect( GroupLineIntersection->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
210 connect( GroupLineIntersection->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
211 connect( GroupLineIntersection->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
213 connect( GroupOnCurve->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
214 connect( GroupXYZ->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
215 connect( GroupXYZ->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
216 connect( GroupXYZ->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
217 connect( GroupRefPoint->SpinBox_DX, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
218 connect( GroupRefPoint->SpinBox_DY, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
219 connect( GroupRefPoint->SpinBox_DZ, SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox( double ) ) );
221 connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
223 connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
224 this, SLOT(SelectionIntoArgument() ) );
227 initName( tr( "GEOM_VERTEX" ) );
229 ConstructorsClicked( 0 );
232 //=================================================================================
233 // function : SetDoubleSpinBoxStep()
234 // purpose : Double spin box management
235 //=================================================================================
236 void BasicGUI_PointDlg::SetDoubleSpinBoxStep( double step )
238 GroupOnCurve->SpinBox_DX->setSingleStep(step);
239 GroupXYZ->SpinBox_DX->setSingleStep(step);
240 GroupXYZ->SpinBox_DY->setSingleStep(step);
241 GroupXYZ->SpinBox_DZ->setSingleStep(step);
242 GroupRefPoint->SpinBox_DX->setSingleStep(step);
243 GroupRefPoint->SpinBox_DY->setSingleStep(step);
244 GroupRefPoint->SpinBox_DZ->setSingleStep(step);
248 //=================================================================================
249 // function : ConstructorsClicked()
250 // purpose : Radio button management
251 //=================================================================================
252 void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
254 globalSelection(); // close local contexts, if any
256 switch ( constructorId ) {
259 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
261 GroupRefPoint->hide();
262 GroupOnCurve->hide();
263 GroupLineIntersection->hide();
272 myEditCurrentArgument = GroupRefPoint->LineEdit1;
273 myEditCurrentArgument->setText( "" );
274 myRefPoint = GEOM::GEOM_Object::_nil();
276 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
279 GroupOnCurve->hide();
280 GroupLineIntersection->hide();
282 GroupRefPoint->show();
289 myEditCurrentArgument = GroupOnCurve->LineEdit1;
290 myEditCurrentArgument->setText( "" );
291 myEdge = GEOM::GEOM_Object::_nil();
293 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
296 GroupRefPoint->hide();
297 GroupLineIntersection->hide();
299 GroupOnCurve->show();
306 myEditCurrentArgument = GroupLineIntersection->LineEdit1;
307 GroupLineIntersection->LineEdit1->setText( "" );
308 GroupLineIntersection->LineEdit2->setText( "" );
309 myLine1 = GEOM::GEOM_Object::_nil();
310 myLine2 = GEOM::GEOM_Object::_nil();
312 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
315 GroupRefPoint->hide();
316 GroupOnCurve->hide();
320 GroupLineIntersection->show();
329 qApp->processEvents();
331 resize( minimumSize() );
333 SelectionIntoArgument();
337 //=================================================================================
338 // function : ClickOnOk()
340 //=================================================================================
341 void BasicGUI_PointDlg::ClickOnOk()
348 //=================================================================================
349 // function : ClickOnApply()
351 //=================================================================================
352 bool BasicGUI_PointDlg::ClickOnApply()
358 ConstructorsClicked( getConstructorId() );
363 //=================================================================================
364 // function : SelectionIntoArgument()
365 // purpose : Called when selection as changed (for constructors not using local context)
366 //=================================================================================
367 void BasicGUI_PointDlg::SelectionIntoArgument()
369 const int id = getConstructorId();
371 if ( ( id == 1 || id == 2 ) && myEditCurrentArgument != 0 ) {
372 myEditCurrentArgument->setText( "" );
376 myRefPoint = myEdge = GEOM::GEOM_Object::_nil();
379 if ( IObjectCount() == 1 ) {
380 Standard_Boolean aRes = Standard_False;
381 Handle(SALOME_InteractiveObject) anIO = firstIObject();
382 GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
383 if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
384 QString aName = GEOMBase::GetName(aSelectedObject);
387 if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
388 TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
389 if ( id == 2 || id == 3 )
390 aNeedType = TopAbs_EDGE;
392 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
393 TColStd_IndexedMapOfInteger aMap;
394 aSelMgr->GetIndexes(firstIObject(), aMap);
395 if ( aMap.Extent() == 1 ) { // Local Selection
396 int anIndex = aMap( 1 );
397 if ( aNeedType == TopAbs_EDGE )
398 aName += QString( ":edge_%1" ).arg( anIndex );
400 aName += QString( ":vertex_%1" ).arg( anIndex );
402 //Find SubShape Object in Father
403 GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
405 if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
406 GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
407 aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
410 aSelectedObject = aFindedObject; // get Object from study
413 else { // Global Selection
414 if ( aShape.ShapeType() != aNeedType ) {
415 aSelectedObject = GEOM::GEOM_Object::_nil();
417 if ( id == 0 ) return;
423 if ( aShape.IsNull() ) return;
424 gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
425 GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
426 GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );
427 GroupXYZ->SpinBox_DZ->setValue( aPnt.Z() );
429 else if ( id == 1 ) {
430 myRefPoint = aSelectedObject;
431 GroupRefPoint->LineEdit1->setText( aName );
433 else if ( id == 2 ) {
434 myEdge = aSelectedObject;
435 GroupOnCurve->LineEdit1->setText( aName );
437 else if ( id == 3 ) {
438 if ( myEditCurrentArgument == GroupLineIntersection->LineEdit1 ) {
439 myLine1 = aSelectedObject;
440 myEditCurrentArgument->setText( aName );
442 else if ( myEditCurrentArgument == GroupLineIntersection->LineEdit2 ) {
443 myLine2 = aSelectedObject;
444 myEditCurrentArgument->setText( aName );
454 //=================================================================================
455 // function : LineEditReturnPressed()
457 //=================================================================================
458 void BasicGUI_PointDlg::LineEditReturnPressed()
460 QLineEdit* send = (QLineEdit*)sender();
461 if ( send == GroupRefPoint->LineEdit1 ||
462 send == GroupOnCurve->LineEdit1 ||
463 send == GroupLineIntersection->LineEdit1 ||
464 send == GroupLineIntersection->LineEdit2 ) {
465 myEditCurrentArgument = send;
466 GEOMBase_Skeleton::LineEditReturnPressed();
471 //=================================================================================
472 // function : SetEditCurrentArgument()
474 //=================================================================================
475 void BasicGUI_PointDlg::SetEditCurrentArgument()
477 globalSelection(); // close local contexts, if any
479 QPushButton* send = (QPushButton*)sender();
480 globalSelection( GEOM_POINT ); // to break previous local selection
482 if ( send == GroupRefPoint->PushButton1 ) {
483 GroupRefPoint->LineEdit1->setFocus();
484 myEditCurrentArgument = GroupRefPoint->LineEdit1;
486 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
488 else if ( send == GroupOnCurve->PushButton1 ) {
489 GroupOnCurve->LineEdit1->setFocus();
490 myEditCurrentArgument = GroupOnCurve->LineEdit1;
492 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
494 else if ( send == GroupLineIntersection->PushButton1 ) {
495 GroupLineIntersection->LineEdit1->setFocus();
496 myEditCurrentArgument = GroupLineIntersection->LineEdit1;
498 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
500 else if ( send == GroupLineIntersection->PushButton2 ) {
501 GroupLineIntersection->LineEdit2->setFocus();
502 myEditCurrentArgument = GroupLineIntersection->LineEdit2;
504 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
509 //=================================================================================
510 // function : enterEvent()
511 // purpose : to reactivate this dialog box when mouse enter onto the window
512 //=================================================================================
513 void BasicGUI_PointDlg::enterEvent( QEvent* )
515 if ( !mainFrame()->GroupConstructors->isEnabled() )
516 ActivateThisDialog();
520 //=================================================================================
521 // function : ActivateThisDialog()
523 //=================================================================================
524 void BasicGUI_PointDlg::ActivateThisDialog( )
526 GEOMBase_Skeleton::ActivateThisDialog();
527 // myGeomGUI->SetState( 0 );
528 ConstructorsClicked( getConstructorId() );
532 //=================================================================================
533 // function : DeactivateActiveDialog()
534 // purpose : public slot to deactivate if active
535 //=================================================================================
536 void BasicGUI_PointDlg::DeactivateActiveDialog()
538 // myGeomGUI->SetState( -1 );
539 GEOMBase_Skeleton::DeactivateActiveDialog();
543 //=================================================================================
544 // function : ValueChangedInSpinBox()
546 //=================================================================================
547 void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
552 //=================================================================================
553 // funcion : getParameter()
555 //=================================================================================
556 double BasicGUI_PointDlg::getParameter() const
558 return GroupOnCurve->SpinBox_DX->value();
561 //=================================================================================
562 // function : OnPointSelected
564 //=================================================================================
565 void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
567 if ( getConstructorId() == 0 ) {
568 GroupXYZ->SpinBox_DX->setValue( thePnt.X() );
569 GroupXYZ->SpinBox_DY->setValue( thePnt.Y() );
570 GroupXYZ->SpinBox_DZ->setValue( thePnt.Z() );
576 //=================================================================================
577 // function : createOperation
579 //=================================================================================
580 GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
582 return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
585 //=================================================================================
586 // function : isValid
588 //=================================================================================
589 bool BasicGUI_PointDlg::isValid( QString& /*msg*/ )
591 const int id = getConstructorId();
595 return !myRefPoint->_is_nil();
597 return !myEdge->_is_nil();
599 return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
603 //=================================================================================
604 // function : execute
606 //=================================================================================
607 bool BasicGUI_PointDlg::execute( ObjectList& objects )
611 GEOM::GEOM_Object_var anObj;
613 switch ( getConstructorId() ) {
616 double x = GroupXYZ->SpinBox_DX->value();
617 double y = GroupXYZ->SpinBox_DY->value();
618 double z = GroupXYZ->SpinBox_DZ->value();
620 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x, y, z );
626 double dx = GroupRefPoint->SpinBox_DX->value();
627 double dy = GroupRefPoint->SpinBox_DY->value();
628 double dz = GroupRefPoint->SpinBox_DZ->value();
630 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
631 MakePointWithReference( myRefPoint, dx, dy, dz );
636 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
637 MakePointOnCurve( myEdge, getParameter() );
641 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
642 MakePointOnLinesIntersection( myLine1, myLine2 );
647 if ( getConstructorId() == 1 || getConstructorId() == 2 ) {
649 if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) {
650 gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
651 myX->setText( QString( "%1" ).arg( aPnt.X() ) );
652 myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
653 myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
662 if ( !anObj->_is_nil() ) {
663 objects.push_back( anObj._retn() );
669 //=================================================================================
670 // function : addSubshapeToStudy
671 // purpose : virtual method to add new SubObjects if local selection
672 //=================================================================================
673 void BasicGUI_PointDlg::addSubshapesToStudy()
675 QMap<QString, GEOM::GEOM_Object_var> objMap;
677 switch ( getConstructorId() ) {
681 objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
684 objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
687 objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
688 objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
691 addSubshapesToFather( objMap );