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
24 // File : BasicGUI_PointDlg.cxx
25 // Author : Lucien PIGNOLONI
29 #include "BasicGUI_PointDlg.h"
31 #include "SUIT_Session.h"
32 #include "SalomeApp_Application.h"
33 #include "LightApp_SelectionMgr.h"
35 #include "GEOMImpl_Types.hxx"
39 #include "utilities.h"
42 #include <TopoDS_Shape.hxx>
43 #include <TopoDS_Vertex.hxx>
44 #include <TopAbs_ShapeEnum.hxx>
46 #include <BRep_Tool.hxx>
48 #include <TColStd_IndexedMapOfInteger.hxx>
49 #include <TopTools_IndexedMapOfShape.hxx>
51 #include <qapplication.h>
55 //=================================================================================
56 // class : BasicGUI_PointDlg()
57 // purpose : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
58 // name 'name' and widget flags set to 'f'.
59 // The dialog will by default be modeless, unless you set 'modal' to
60 // TRUE to construct a modal dialog.
61 //=================================================================================
62 BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
63 const char* name, bool modal, WFlags fl)
64 :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, fl )
66 QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT")));
67 QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_EDGE")));
68 QPixmap image2(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
69 QPixmap image3(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_REF")));
70 QPixmap image4(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_POINT_LINES")));
72 setCaption(tr("GEOM_POINT_TITLE"));
74 QGroupBox* aFrame = new QGroupBox( 1, Qt::Horizontal, this );
75 aFrame->setInsideMargin( 0 );
76 aFrame->setFrameStyle( QFrame::NoFrame );
78 /***************************************************************/
79 GroupConstructors->setTitle(tr("GEOM_POINTS"));
80 RadioButton1->setPixmap(image0);
81 RadioButton2->setPixmap(image3);
82 RadioButton3->setPixmap(image1);
84 RadioButton4->setPixmap(image4);
86 GroupXYZ = new DlgRef_3Spin( aFrame, "GroupXYZ" );
87 GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES"));
88 GroupXYZ->TextLabel1->setText(tr("GEOM_X"));
89 GroupXYZ->TextLabel2->setText(tr("GEOM_Y"));
90 GroupXYZ->TextLabel3->setText(tr("GEOM_Z"));
92 GroupOnCurve = new DlgRef_1Sel1Spin( aFrame, "GroupOnCurve" );
93 GroupOnCurve->GroupBox1->setTitle(tr("GEOM_PARAM_POINT"));
94 GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE"));
95 GroupOnCurve->TextLabel2->setText(tr("GEOM_PARAMETER"));
96 GroupOnCurve->PushButton1->setPixmap(image2);
98 GroupRefPoint = new DlgRef_1Sel3Spin( aFrame, "GoupRefPoint" );
99 GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT"));
100 GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT"));
101 GroupRefPoint->PushButton1->setPixmap(image2);
102 GroupRefPoint->TextLabel2->setText(tr("GEOM_DX"));
103 GroupRefPoint->TextLabel3->setText(tr("GEOM_DY"));
104 GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
106 GroupLineIntersection = new DlgRef_2Sel_QTD (aFrame, "GroupLineIntersection");
107 GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION"));
108 GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1"));
109 GroupLineIntersection->PushButton1->setPixmap(image2);
110 GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2"));
111 GroupLineIntersection->PushButton2->setPixmap(image2);
113 Layout1->addWidget( aFrame, 2, 0 );
114 /***************************************************************/
116 myCoordGrp = new QGroupBox( 2, Qt::Horizontal, tr( "GEOM_COORDINATES" ), aFrame );
117 new QLabel( tr( "GEOM_X" ), myCoordGrp );
118 myX = new QLineEdit( myCoordGrp );
119 new QLabel( tr( "GEOM_Y" ), myCoordGrp );
120 myY = new QLineEdit( myCoordGrp );
121 new QLabel( tr( "GEOM_Z" ), myCoordGrp );
122 myZ = new QLineEdit( myCoordGrp );
124 myX->setReadOnly( true );
125 myY->setReadOnly( true );
126 myZ->setReadOnly( true );
128 myX->setEnabled( false );
129 myY->setEnabled( false );
130 myZ->setEnabled( false );
132 QPalette aPal = myX->palette();
133 aPal.setColor( QPalette::Disabled, QColorGroup::Text, QColor( 0, 0, 0 ) ) ;
134 myX->setPalette( aPal );
135 myY->setPalette( aPal );
136 myZ->setPalette( aPal );
138 // setHelpFileName("create_point_page.html");
139 setHelpFileName("point.htm");
144 //=================================================================================
145 // function : ~BasicGUI_PointDlg()
146 // purpose : Destructor
147 //=================================================================================
148 BasicGUI_PointDlg::~BasicGUI_PointDlg()
152 //=================================================================================
155 //=================================================================================
156 void BasicGUI_PointDlg::Init()
158 GroupOnCurve->LineEdit1->setReadOnly( true );
159 GroupRefPoint->LineEdit1->setReadOnly( true );
160 GroupLineIntersection->LineEdit1->setReadOnly( true );
161 GroupLineIntersection->LineEdit2->setReadOnly( true );
163 myEdge = GEOM::GEOM_Object::_nil();
164 myRefPoint = GEOM::GEOM_Object::_nil();
166 myEditCurrentArgument = 0;
168 /* Get setting of step value from file configuration */
169 SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
170 double step = resMgr->doubleValue( "Geometry", "SettingsGeomStep", 100);
172 /* min, max, step and decimals for spin boxes */
173 GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
174 GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
175 GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
176 GroupXYZ->SpinBox_DX->SetValue(0.0);
177 GroupXYZ->SpinBox_DY->SetValue(0.0);
178 GroupXYZ->SpinBox_DZ->SetValue(0.0);
180 GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
181 GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
182 GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
183 GroupRefPoint->SpinBox_DX->SetValue(0.0);
184 GroupRefPoint->SpinBox_DY->SetValue(0.0);
185 GroupRefPoint->SpinBox_DZ->SetValue(0.0);
188 GroupOnCurve->SpinBox_DX->RangeStepAndValidator(0., 1., step, DBL_DIGITS_DISPLAY);
189 GroupOnCurve->SpinBox_DX->SetValue( 0.5 );
191 /* signals and slots connections */
192 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
193 connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
194 connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
196 connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
197 connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
198 connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
200 connect(GroupOnCurve->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
201 connect(GroupOnCurve->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
202 connect(GroupLineIntersection->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
203 connect(GroupLineIntersection->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
204 connect(GroupLineIntersection->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
205 connect(GroupLineIntersection->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
207 connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
208 connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
209 connect(GroupXYZ->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
210 connect(GroupXYZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
211 connect(GroupRefPoint->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
212 connect(GroupRefPoint->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
213 connect(GroupRefPoint->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
215 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
216 GroupOnCurve->SpinBox_DX, SLOT(SetStep(double)));
217 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
218 GroupXYZ->SpinBox_DX, SLOT(SetStep(double)));
219 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
220 GroupXYZ->SpinBox_DY, SLOT(SetStep(double)));
221 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
222 GroupXYZ->SpinBox_DZ, SLOT(SetStep(double)));
223 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
224 GroupRefPoint->SpinBox_DX, SLOT(SetStep(double)));
225 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
226 GroupRefPoint->SpinBox_DY, SLOT(SetStep(double)));
227 connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
228 GroupRefPoint->SpinBox_DZ, SLOT(SetStep(double)));
230 connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
231 this, SLOT(SelectionIntoArgument()));
233 initName( tr("GEOM_VERTEX") );
235 ConstructorsClicked( 0 );
238 //=================================================================================
239 // function : ConstructorsClicked()
240 // purpose : Radio button management
241 //=================================================================================
242 void BasicGUI_PointDlg::ConstructorsClicked (int constructorId)
244 globalSelection(); // close local contexts, if any
246 switch (constructorId)
250 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
252 GroupRefPoint->hide();
253 GroupOnCurve->hide();
254 GroupLineIntersection->hide();
261 myEditCurrentArgument = GroupRefPoint->LineEdit1;
262 myEditCurrentArgument->setText("");
263 myRefPoint = GEOM::GEOM_Object::_nil();
265 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
268 GroupOnCurve->hide();
269 GroupRefPoint->show();
270 GroupLineIntersection->hide();
276 myEditCurrentArgument = GroupOnCurve->LineEdit1;
277 myEditCurrentArgument->setText("");
278 myEdge = GEOM::GEOM_Object::_nil();
280 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
283 GroupRefPoint->hide();
284 GroupOnCurve->show();
285 GroupLineIntersection->hide();
291 myEditCurrentArgument = GroupLineIntersection->LineEdit1;
292 GroupLineIntersection->LineEdit1->setText("");
293 GroupLineIntersection->LineEdit2->setText("");
294 myLine1 = GEOM::GEOM_Object::_nil();
295 myLine2 = GEOM::GEOM_Object::_nil();
297 localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
300 GroupRefPoint->hide();
301 GroupOnCurve->hide();
302 GroupLineIntersection->show();
312 qApp->processEvents();
314 resize( minimumSize() );
316 SelectionIntoArgument();
319 //=================================================================================
320 // function : ClickOnOk()
322 //=================================================================================
323 void BasicGUI_PointDlg::ClickOnOk()
329 //=================================================================================
330 // function : ClickOnApply()
332 //=================================================================================
333 bool BasicGUI_PointDlg::ClickOnApply()
339 ConstructorsClicked(getConstructorId());
343 //=================================================================================
344 // function : ClickOnCancel()
346 //=================================================================================
347 void BasicGUI_PointDlg::ClickOnCancel()
349 GEOMBase_Skeleton::ClickOnCancel();
352 //=================================================================================
353 // function : SelectionIntoArgument()
354 // purpose : Called when selection as changed (for constructors not using local context)
355 //=================================================================================
356 void BasicGUI_PointDlg::SelectionIntoArgument()
358 const int id = getConstructorId();
360 if ((id == 1 || id == 2) && myEditCurrentArgument != 0)
362 myEditCurrentArgument->setText("");
366 myRefPoint = myEdge = GEOM::GEOM_Object::_nil();
369 if (IObjectCount() == 1)
371 Standard_Boolean aRes = Standard_False;
372 Handle(SALOME_InteractiveObject) anIO = firstIObject();
373 GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
374 if (!CORBA::is_nil(aSelectedObject) && aRes)
376 QString aName = GEOMBase::GetName(aSelectedObject);
379 if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
381 TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
382 if (id == 2 || id == 3)
383 aNeedType = TopAbs_EDGE;
385 LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
386 TColStd_IndexedMapOfInteger aMap;
387 aSelMgr->GetIndexes(firstIObject(), aMap);
388 if (aMap.Extent() == 1) // Local Selection
390 int anIndex = aMap(1);
391 if (aNeedType == TopAbs_EDGE)
392 aName += QString(":edge_%1").arg(anIndex);
394 aName += QString(":vertex_%1").arg(anIndex);
396 //Find SubShape Object in Father
397 GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
399 if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
400 GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
401 aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
404 aSelectedObject = aFindedObject; // get Object from study
406 else // Global Selection
408 if (aShape.ShapeType() != aNeedType) {
409 aSelectedObject = GEOM::GEOM_Object::_nil();
418 if (aShape.IsNull()) return;
419 gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
420 GroupXYZ->SpinBox_DX->SetValue( aPnt.X() );
421 GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() );
422 GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() );
426 myRefPoint = aSelectedObject;
427 GroupRefPoint->LineEdit1->setText(aName);
431 myEdge = aSelectedObject;
432 GroupOnCurve->LineEdit1->setText(aName);
436 if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
437 myLine1 = aSelectedObject;
438 myEditCurrentArgument->setText(aName);
440 else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
441 myLine2 = aSelectedObject;
442 myEditCurrentArgument->setText(aName);
451 //=================================================================================
452 // function : LineEditReturnPressed()
454 //=================================================================================
455 void BasicGUI_PointDlg::LineEditReturnPressed()
457 QLineEdit* send = (QLineEdit*)sender();
458 if ( send == GroupRefPoint->LineEdit1 || send == GroupOnCurve->LineEdit1 ||
459 send == GroupLineIntersection->LineEdit1 || send == GroupLineIntersection->LineEdit2 )
461 myEditCurrentArgument = send;
462 GEOMBase_Skeleton::LineEditReturnPressed();
466 //=================================================================================
467 // function : SetEditCurrentArgument()
469 //=================================================================================
470 void BasicGUI_PointDlg::SetEditCurrentArgument()
472 globalSelection(); // close local contexts, if any
474 QPushButton* send = (QPushButton*)sender();
475 globalSelection( GEOM_POINT); // to break previous local selection
477 if ( send == GroupRefPoint->PushButton1 )
479 GroupRefPoint->LineEdit1->setFocus();
480 myEditCurrentArgument = GroupRefPoint->LineEdit1;
482 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
484 else if ( send == GroupOnCurve->PushButton1 )
486 GroupOnCurve->LineEdit1->setFocus();
487 myEditCurrentArgument = GroupOnCurve->LineEdit1;
489 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
491 else if ( send == GroupLineIntersection->PushButton1 )
493 GroupLineIntersection->LineEdit1->setFocus();
494 myEditCurrentArgument = GroupLineIntersection->LineEdit1;
496 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
498 else if ( send == GroupLineIntersection->PushButton2 )
500 GroupLineIntersection->LineEdit2->setFocus();
501 myEditCurrentArgument = GroupLineIntersection->LineEdit2;
503 localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
507 //=================================================================================
508 // function : enterEvent()
509 // purpose : to reactivate this dialog box when mouse enter onto the window
510 //=================================================================================
511 void BasicGUI_PointDlg::enterEvent(QEvent* e)
513 if ( !GroupConstructors->isEnabled() )
514 ActivateThisDialog();
517 //=================================================================================
518 // function : ActivateThisDialog()
520 //=================================================================================
521 void BasicGUI_PointDlg::ActivateThisDialog( )
523 GEOMBase_Skeleton::ActivateThisDialog();
524 // myGeomGUI->SetState( 0 );
525 ConstructorsClicked( getConstructorId() );
528 //=================================================================================
529 // function : DeactivateActiveDialog()
530 // purpose : public slot to deactivate if active
531 //=================================================================================
532 void BasicGUI_PointDlg::DeactivateActiveDialog()
534 // myGeomGUI->SetState( -1 );
535 GEOMBase_Skeleton::DeactivateActiveDialog();
538 //=================================================================================
539 // function : ValueChangedInSpinBox()
541 //=================================================================================
542 void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
547 //=================================================================================
548 // funcion : getParameter()
550 //=================================================================================
551 double BasicGUI_PointDlg::getParameter() const
553 return GroupOnCurve->SpinBox_DX->GetValue();
556 //=================================================================================
557 // function : OnPointSelected
559 //=================================================================================
560 void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
562 if ( getConstructorId() == 0 )
564 GroupXYZ->SpinBox_DX->SetValue( thePnt.X() );
565 GroupXYZ->SpinBox_DY->SetValue( thePnt.Y() );
566 GroupXYZ->SpinBox_DZ->SetValue( thePnt.Z() );
572 //=================================================================================
573 // function : createOperation
575 //=================================================================================
576 GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
578 return myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() );
581 //=================================================================================
582 // function : isValid
584 //=================================================================================
585 bool BasicGUI_PointDlg::isValid( QString& msg )
587 const int id = getConstructorId();
591 return !myRefPoint->_is_nil();
593 return !myEdge->_is_nil();
595 return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
599 //=================================================================================
600 // function : execute
602 //=================================================================================
603 bool BasicGUI_PointDlg::execute( ObjectList& objects )
607 GEOM::GEOM_Object_var anObj;
609 switch ( getConstructorId() )
613 double x = GroupXYZ->SpinBox_DX->GetValue();
614 double y = GroupXYZ->SpinBox_DY->GetValue();
615 double z = GroupXYZ->SpinBox_DZ->GetValue();
617 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x,y,z );
623 double dx = GroupRefPoint->SpinBox_DX->GetValue();
624 double dy = GroupRefPoint->SpinBox_DY->GetValue();
625 double dz = GroupRefPoint->SpinBox_DZ->GetValue();
627 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
628 MakePointWithReference( myRefPoint, dx, dy, dz );
633 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
634 MakePointOnCurve( myEdge, getParameter() );
638 anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
639 MakePointOnLinesIntersection( myLine1, myLine2 );
644 if ( getConstructorId() == 1 || getConstructorId() == 2 )
647 if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX )
649 gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
650 myX->setText( QString( "%1" ).arg( aPnt.X() ) );
651 myY->setText( QString( "%1" ).arg( aPnt.Y() ) );
652 myZ->setText( QString( "%1" ).arg( aPnt.Z() ) );
662 if ( !anObj->_is_nil() )
664 //printf( "--> a valid point is created\n" );
665 objects.push_back( anObj._retn() );
671 //=================================================================================
672 // function : closeEvent
674 //=================================================================================
675 void BasicGUI_PointDlg::closeEvent( QCloseEvent* e )
677 GEOMBase_Skeleton::closeEvent( e );
680 //=================================================================================
681 // function : addSubshapeToStudy
682 // purpose : virtual method to add new SubObjects if local selection
683 //=================================================================================
684 void BasicGUI_PointDlg::addSubshapesToStudy()
686 QMap<QString, GEOM::GEOM_Object_var> objMap;
688 switch (getConstructorId())
693 objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
696 objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
699 objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
700 objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
703 addSubshapesToFather( objMap );