2 // File : GeometryGUI_BoxDlg.cxx
4 // Author : Lucien PIGNOLONI
6 // Module : GeometryGUI
7 // Copyright : OPEN CASCADE
11 #include "GeometryGUI_BoxDlg.h"
12 #include "GeometryGUI_SpinBox.h"
14 #include "GeometryGUI.h"
15 #include "QAD_Application.h"
16 #include "QAD_Desktop.h"
17 #include "QAD_Config.h"
18 #include "utilities.h"
20 #include <qbuttongroup.h>
22 #include <qgroupbox.h>
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25 #include <qradiobutton.h>
29 #include <qwhatsthis.h>
33 #include <qvalidator.h>
35 #include <qmessagebox.h>
39 //=================================================================================
40 // class : GeometryGUI_BoxDlg()
41 // purpose : Constructs a GeometryGUI_BoxDlg which is a child of 'parent', with the
42 // name 'name' and widget flags set to 'f'.
43 // The dialog will by default be modeless, unless you set 'modal' to
44 // TRUE to construct a modal dialog.
45 //=================================================================================
46 GeometryGUI_BoxDlg::GeometryGUI_BoxDlg( QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl )
47 : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
49 QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BOX_2P")));
50 QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_SELECT")));
51 QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap( "GEOM",tr("ICON_DLG_BOX_DXYZ")));
54 setName( "GeometryGUI_BoxDlg" );
56 setCaption( tr( "GEOM_BOX_TITLE" ) );
57 setSizeGripEnabled( TRUE );
58 GeometryGUI_BoxDlgLayout = new QGridLayout( this );
59 GeometryGUI_BoxDlgLayout->setSpacing( 6 );
60 GeometryGUI_BoxDlgLayout->setMargin( 11 );
62 /***************************************************************/
63 GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
64 GroupConstructors->setTitle( tr( "GEOM_BOX" ) );
65 GroupConstructors->setExclusive( TRUE );
66 GroupConstructors->setColumnLayout(0, Qt::Vertical );
67 GroupConstructors->layout()->setSpacing( 0 );
68 GroupConstructors->layout()->setMargin( 0 );
69 GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
70 GroupConstructorsLayout->setAlignment( Qt::AlignTop );
71 GroupConstructorsLayout->setSpacing( 6 );
72 GroupConstructorsLayout->setMargin( 11 );
73 QSpacerItem* spacer_1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
74 GroupConstructorsLayout->addItem( spacer_1, 0, 3 );
75 Constructor1 = new QRadioButton( GroupConstructors, "Constructor1" );
76 Constructor1->setText( tr( "" ) );
77 Constructor1->setPixmap( image0 );
78 Constructor1->setChecked( TRUE );
79 Constructor1->setMinimumSize( QSize( 50, 0 ) );
80 GroupConstructorsLayout->addWidget( Constructor1, 0, 0 );
81 Constructor2 = new QRadioButton( GroupConstructors, "Constructor2" );
82 Constructor2->setText( tr( "" ) );
83 Constructor2->setPixmap( image2 );
84 Constructor2->setMinimumSize( QSize( 50, 0 ) );
85 GroupConstructorsLayout->addWidget( Constructor2, 0, 2 );
86 QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
87 GroupConstructorsLayout->addItem( spacer_2, 0, 1 );
88 GeometryGUI_BoxDlgLayout->addWidget( GroupConstructors, 0, 0 );
90 /***************************************************************/
91 GroupButtons = new QGroupBox( this, "GroupButtons" );
92 GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
93 GroupButtons->setTitle( tr( "" ) );
94 GroupButtons->setColumnLayout(0, Qt::Vertical );
95 GroupButtons->layout()->setSpacing( 0 );
96 GroupButtons->layout()->setMargin( 0 );
97 GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
98 GroupButtonsLayout->setAlignment( Qt::AlignTop );
99 GroupButtonsLayout->setSpacing( 6 );
100 GroupButtonsLayout->setMargin( 11 );
101 buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
102 buttonCancel->setText( tr( "GEOM_BUT_CLOSE" ) );
103 buttonCancel->setAutoDefault( TRUE );
104 GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
105 buttonApply = new QPushButton( GroupButtons, "buttonApply" );
106 buttonApply->setText( tr( "GEOM_BUT_APPLY" ) );
107 buttonApply->setAutoDefault( TRUE );
108 GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
109 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
110 GroupButtonsLayout->addItem( spacer, 0, 2 );
111 buttonOk = new QPushButton( GroupButtons, "buttonOk" );
112 buttonOk->setText( tr( "GEOM_BUT_OK" ) );
113 buttonOk->setAutoDefault( TRUE );
114 buttonOk->setDefault( TRUE );
115 GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
116 GeometryGUI_BoxDlgLayout->addWidget( GroupButtons, 2, 0 );
118 /***************************************************************/
119 GroupPoints = new QGroupBox( this, "GroupPoints" );
120 GroupPoints->setGeometry( QRect( 10, 10, 280, 90 ) );
121 GroupPoints->setTitle( tr( "GEOM_DIAGONAL_POINTS" ) );
122 GroupPoints->setFrameShape( QGroupBox::Box );
123 GroupPoints->setFrameShadow( QGroupBox::Sunken );
124 GroupPoints->setColumnLayout(0, Qt::Vertical );
125 GroupPoints->layout()->setSpacing( 0 );
126 GroupPoints->layout()->setMargin( 0 );
127 GroupPointsLayout = new QGridLayout( GroupPoints->layout() );
128 GroupPointsLayout->setAlignment( Qt::AlignTop );
129 GroupPointsLayout->setSpacing( 6 );
130 GroupPointsLayout->setMargin( 11 );
131 SelectButtonPt2 = new QPushButton( GroupPoints, "SelectButtonPt2" );
132 SelectButtonPt2->setText( tr( "" ) );
133 SelectButtonPt2->setPixmap( image1 );
134 GroupPointsLayout->addWidget( SelectButtonPt2, 1, 1 );
135 LineEditPt1 = new QLineEdit( GroupPoints, "LineEditPt1" );
136 GroupPointsLayout->addWidget( LineEditPt1, 0, 2 );
137 LineEditPt2 = new QLineEdit( GroupPoints, "LineEditPt2" );
138 GroupPointsLayout->addWidget( LineEditPt2, 1, 2 );
139 SelectButtonPt1 = new QPushButton( GroupPoints, "SelectButtonPt1" );
140 SelectButtonPt1->setText( tr( "" ) );
141 SelectButtonPt1->setPixmap( image1 );
142 SelectButtonPt1->setToggleButton( FALSE );
143 GroupPointsLayout->addWidget( SelectButtonPt1, 0, 1 );
144 TextLabelPt1 = new QLabel( GroupPoints, "TextLabelPt1" );
145 TextLabelPt1->setText( tr( "GEOM_POINT_I" ).arg("1") );
146 TextLabelPt1->setMinimumSize( QSize( 50, 0 ) );
147 TextLabelPt1->setFrameShape( QLabel::NoFrame );
148 TextLabelPt1->setFrameShadow( QLabel::Plain );
149 GroupPointsLayout->addWidget( TextLabelPt1, 0, 0 );
150 TextLabelPt2 = new QLabel( GroupPoints, "TextLabelPt2" );
151 TextLabelPt2->setText( tr( "GEOM_POINT_I" ).arg("2") );
152 TextLabelPt2->setMinimumSize( QSize( 50, 0 ) );
153 GroupPointsLayout->addWidget( TextLabelPt2, 1, 0 );
154 GeometryGUI_BoxDlgLayout->addWidget( GroupPoints, 1, 0 );
156 /***************************************************************/
157 GroupDimensions = new QGroupBox( this, "GroupDimensions" );
158 GroupDimensions->setGeometry( QRect( 11, 75, 310, 80 ) );
159 GroupDimensions->setTitle( tr( "GEOM_BOX_OBJ" ) );
160 GroupDimensions->setColumnLayout(0, Qt::Vertical );
161 GroupDimensions->setMinimumSize( QSize( 0, 90 ) );
162 GroupDimensions->layout()->setSpacing( 0 );
163 GroupDimensions->layout()->setMargin( 0 );
164 GroupDimensionsLayout = new QGridLayout( GroupDimensions->layout() );
165 GroupDimensionsLayout->setAlignment( Qt::AlignTop );
166 GroupDimensionsLayout->setSpacing( 6 );
167 GroupDimensionsLayout->setMargin( 11 );
169 TextLabel_DZ = new QLabel( GroupDimensions, "TextLabel_DZ" );
170 TextLabel_DZ->setText( tr( "GEOM_DZ" ) );
171 GroupDimensionsLayout->addWidget( TextLabel_DZ, 0, 4 );
172 TextLabel_DY = new QLabel( GroupDimensions, "TextLabel_DY" );
173 TextLabel_DY->setText( tr( "GEOM_DY" ) );
174 GroupDimensionsLayout->addWidget( TextLabel_DY, 0, 2 );
175 TextLabel_DX = new QLabel( GroupDimensions, "TextLabel_DX" );
176 TextLabel_DX->setText( tr( "GEOM_DX" ) );
177 GroupDimensionsLayout->addWidget( TextLabel_DX, 0, 0 );
179 /* Spin boxes construction */
180 SpinBox_DX = new GeometryGUI_SpinBox( GroupDimensions, "GeomSpinBox_DX" ) ;
181 GroupDimensionsLayout->addWidget( SpinBox_DX, 0, 1 );
182 SpinBox_DY = new GeometryGUI_SpinBox( GroupDimensions, "GeomSpinBox_DY" ) ;
183 GroupDimensionsLayout->addWidget( SpinBox_DY, 0, 3 );
184 SpinBox_DZ = new GeometryGUI_SpinBox( GroupDimensions, "GeomSpinBox_DZ" ) ;
185 GroupDimensionsLayout->addWidget( SpinBox_DZ, 0, 5 );
187 QSpacerItem* spacer1 = new QSpacerItem( 20, 24, QSizePolicy::Minimum, QSizePolicy::Fixed );
188 GroupDimensionsLayout->addItem( spacer1, 1, 3 );
190 GeometryGUI_BoxDlgLayout->addWidget( GroupDimensions, 1, 0 );
192 /* Initialisations */
197 //=================================================================================
198 // function : ~DialogBox_Box()
199 // purpose : Destroys the object and frees any allocated resources
200 //=================================================================================
201 GeometryGUI_BoxDlg::~GeometryGUI_BoxDlg()
203 // no need to delete child widgets, Qt does it all for us
204 this->destroy(TRUE, TRUE) ;
208 //=================================================================================
211 //=================================================================================
212 void GeometryGUI_BoxDlg::Init(SALOME_Selection *Sel)
216 /* Get setting of step value from file configuration */
218 QString St = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ) ;
219 step = St.toDouble() ;
221 /* min, max, step and decimals for spin boxes */
222 SpinBox_DX->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
223 SpinBox_DX->SetValue( 200.0 ) ;
224 SpinBox_DY->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
225 SpinBox_DY->SetValue( 200.0 ) ;
226 SpinBox_DZ->RangeStepAndValidator( -999.999, 999.999, step, 3 ) ;
227 SpinBox_DZ->SetValue( 200.0 ) ;
230 GroupDimensions->hide() ;
231 myConstructorId = 0 ;
232 Constructor1->setChecked( TRUE );
233 myEditCurrentArgument = LineEditPt1 ;
235 myGeomGUI = GeometryGUI::GetGeometryGUI() ;
236 myPoint1.SetCoord( 0.0, 0.0, 0.0 );
237 myPoint2.SetCoord( 0.0, 0.0, 0.0 );
238 myOkPoint1 = myOkPoint2 = false ;
239 mySimulationTopoDs.Nullify() ;
241 myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
243 // TODO previous selection into argument ?
245 /* Vertices Filter for all arguments */
246 Engines::Component_var comp = QAD_Application::getDesktop()->getEngine("FactoryServer", "GEOM");
247 myGeom = GEOM::GEOM_Gen::_narrow(comp);
248 myVertexFilter = new GEOM_ShapeTypeFilter( TopAbs_VERTEX, myGeom );
249 mySelection->AddFilter( myVertexFilter ); /* filter for next selection */
251 /* signals and slots connections */
252 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ) ;
253 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ) ;
254 connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ) ;
255 connect( GroupConstructors, SIGNAL(clicked(int) ), this, SLOT( ConstructorsClicked(int) ) ) ;
256 connect( SelectButtonPt1, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
257 connect( SelectButtonPt2, SIGNAL (clicked() ), this, SLOT( SetEditCurrentArgument() ) ) ;
259 connect( SpinBox_DX, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
260 connect( SpinBox_DY, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
261 connect( SpinBox_DZ, SIGNAL ( valueChanged( double) ), this, SLOT( ValueChangedInSpinBox( double) ) ) ;
263 connect( LineEditPt1, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
264 connect( LineEditPt2, SIGNAL ( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ) ;
266 connect( myGeomGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
267 connect( mySelection, SIGNAL ( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ) ;
268 /* To close dialog if study change */
269 connect( myGeomGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
271 /* Move widget on the botton right corner of main widget */
273 myGeomGUI->DefineDlgPosition( this, x, y ) ;
276 this->show() ; /* displays Dialog */
281 //=================================================================================
282 // function : ConstructorsClicked()
283 // purpose : Radio button management
284 //=================================================================================
285 void GeometryGUI_BoxDlg::ConstructorsClicked(int constructorId)
288 mySelection->ClearFilters() ;
289 myGeomGUI->EraseSimulationShape() ;
291 switch (constructorId)
296 GroupDimensions->hide() ;
297 myConstructorId = constructorId ;
298 myEditCurrentArgument = LineEditPt1 ;
299 Constructor1->setChecked( TRUE );
300 LineEditPt1->setText("") ;
301 LineEditPt2->setText("") ;
302 myOkPoint1 = myOkPoint2 = false ;
304 /* filter for next selection */
305 mySelection->AddFilter( myVertexFilter );
306 connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
312 GroupDimensions->show();
313 myConstructorId = constructorId ;
314 myOkPoint1 = myOkPoint2 = false ;
316 disconnect( mySelection, 0, this, 0 );
318 double initValue = 200.0 ;
319 SpinBox_DX->SetValue( initValue ) ;
320 SpinBox_DY->SetValue( initValue ) ;
321 SpinBox_DZ->SetValue( initValue ) ;
323 myPoint1.SetCoord( 0.0, 0.0, 0.0 ) ;
324 myPoint2.SetCoord( initValue, initValue,initValue ) ;
326 mySimulationTopoDs = BRepPrimAPI_MakeBox( myPoint1, myPoint2 ).Shape();
327 myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
334 //=================================================================================
335 // function : ClickOnOk()
337 //=================================================================================
338 void GeometryGUI_BoxDlg::ClickOnOk()
340 this->ClickOnApply() ;
341 this->ClickOnCancel() ;
345 //=================================================================================
346 // function : ClickOnApply()
348 //=================================================================================
349 void GeometryGUI_BoxDlg::ClickOnApply()
351 //NRI+ : 02/12/2202 - BugID 1065
352 // if (mySimulationTopoDs.IsNull())
354 myGeomGUI->EraseSimulationShape() ;
355 mySimulationTopoDs.Nullify() ;
356 myGeomGUI->GetDesktop()->putInfo( tr("") ) ;
358 switch(myConstructorId)
362 //NRI+ : 02/12/2202 - BugID 1065 mySelection->ClearFilters() ;
363 if(myOkPoint1 && myOkPoint2)
364 myGeomGUI->MakeBoxAndDisplay( myPoint1, myPoint2 ) ;
369 /* Recup args and call method */
370 double vx = SpinBox_DX->GetValue() ;
371 double vy = SpinBox_DY->GetValue() ;
372 double vz = SpinBox_DZ->GetValue() ;
373 myPoint1.SetCoord(0.0, 0.0, 0.0) ;
374 myPoint2.SetCoord(vx, vy, vz) ;
375 myGeomGUI->MakeBoxAndDisplay( myPoint1, myPoint2 ) ;
383 //=================================================================================
384 // function : ClickOnCancel()
386 //=================================================================================
387 void GeometryGUI_BoxDlg::ClickOnCancel()
389 mySelection->ClearFilters() ;
390 myGeomGUI->EraseSimulationShape() ;
391 mySimulationTopoDs.Nullify() ;
392 disconnect( mySelection, 0, this, 0 );
393 myGeomGUI->ResetState() ;
399 //=================================================================================
400 // function : SelectionIntoArgument()
401 // purpose : Called when selection as changed
402 //=================================================================================
403 void GeometryGUI_BoxDlg::SelectionIntoArgument()
405 myEditCurrentArgument->setText("") ;
406 myGeomGUI->EraseSimulationShape() ;
407 mySimulationTopoDs.Nullify() ;
409 QString aString = "" ; /* name of selection */
411 int nbSel = myGeomGUI->GetNameOfSelectedIObjects(mySelection, aString) ;
413 if ( myEditCurrentArgument == LineEditPt1 ) {
416 else if ( myEditCurrentArgument == LineEditPt2 ) {
424 if( !myGeomGUI->GetTopoFromSelection(mySelection, S) )
427 if ( myEditCurrentArgument == LineEditPt1 && myGeomGUI->VertexToPoint(S, myPoint1) ) {
428 myEditCurrentArgument->setText( aString ) ;
431 else if ( myEditCurrentArgument == LineEditPt2 && myGeomGUI->VertexToPoint(S, myPoint2) ) {
432 myEditCurrentArgument->setText( aString ) ;
436 if( myOkPoint1 && myOkPoint2 && TestBoxDimensions( myPoint1, myPoint2 ) ) {
437 mySimulationTopoDs = BRepPrimAPI_MakeBox( myPoint1, myPoint2 ).Shape();
438 myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
444 //=================================================================================
445 // function : SetEditCurrentArgument()
447 //=================================================================================
448 void GeometryGUI_BoxDlg::SetEditCurrentArgument()
450 QPushButton* send = (QPushButton*)sender();
451 switch (myConstructorId)
453 case 0: // default constructor
455 if(send == SelectButtonPt1) {
456 LineEditPt1->setFocus() ;
457 myEditCurrentArgument = LineEditPt1;
459 else if(send == SelectButtonPt2) {
460 LineEditPt2->setFocus() ;
461 myEditCurrentArgument = LineEditPt2;
463 mySelection->AddFilter(myVertexFilter) ;
464 SelectionIntoArgument() ;
469 /* nothing to do here */
476 //=================================================================================
477 // function : ValueChangedInSpinBox()
479 //=================================================================================
480 void GeometryGUI_BoxDlg::ValueChangedInSpinBox( double newValue )
482 if(myConstructorId != 1)
485 myGeomGUI->EraseSimulationShape() ;
486 mySimulationTopoDs.Nullify() ;
488 QObject* send = (QObject*)sender() ;
491 if( send == SpinBox_DX ) {
493 vy = SpinBox_DY->GetValue() ;
494 vz = SpinBox_DZ->GetValue() ;
495 } else if ( send == SpinBox_DY ) {
496 vx = SpinBox_DX->GetValue() ;
498 vz = SpinBox_DZ->GetValue() ;
499 } else if (send == SpinBox_DZ ) {
500 vx = SpinBox_DX->GetValue() ;
501 vy = SpinBox_DY->GetValue() ;
505 myPoint1.SetCoord(0.0, 0.0, 0.0) ;
506 myPoint2.SetCoord(vx, vy, vz) ;
508 if ( TestBoxDimensions( myPoint1, myPoint2 ) ) {
509 mySimulationTopoDs = BRepPrimAPI_MakeBox( myPoint1, myPoint2 ).Shape();
510 myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
516 //=================================================================================
517 // function : LineEditReturnPressed()
519 //=================================================================================
520 void GeometryGUI_BoxDlg::LineEditReturnPressed()
522 QLineEdit* send = (QLineEdit*)sender();
523 if( send == LineEditPt1 )
524 myEditCurrentArgument = LineEditPt1 ;
525 else if ( send == LineEditPt2 )
526 myEditCurrentArgument = LineEditPt2 ;
530 /* User name of object input management */
531 /* If successfull the selection is changed and signal emitted... */
532 /* so SelectionIntoArgument() is automatically called. */
533 const QString objectUserName = myEditCurrentArgument->text() ;
534 QWidget* thisWidget = (QWidget*)this ;
535 if( myGeomGUI->SelectionByNameInDialogs( thisWidget, objectUserName, mySelection ) ) {
536 myEditCurrentArgument->setText( objectUserName ) ;
542 //=================================================================================
543 // function : DeactivateActiveDialog()
545 //=================================================================================
546 void GeometryGUI_BoxDlg::DeactivateActiveDialog()
548 if ( GroupConstructors->isEnabled() ) {
550 GroupConstructors->setEnabled(false) ;
551 GroupDimensions->setEnabled(false) ;
552 GroupButtons->setEnabled(false) ;
553 GroupPoints->setEnabled(false) ;
555 mySelection->ClearFilters() ;
556 disconnect( mySelection, 0, this, 0 );
557 myGeomGUI->SetActiveDialogBox(0) ;
558 myGeomGUI->EraseSimulationShape() ;
564 //=================================================================================
565 // function : ActivateThisDialog()
567 //=================================================================================
568 void GeometryGUI_BoxDlg::ActivateThisDialog()
571 /* Emit a signal to deactivate the active dialog */
572 myGeomGUI->EmitSignalDeactivateDialog() ;
574 GroupConstructors->setEnabled(true) ;
575 GroupDimensions->setEnabled(true) ;
576 GroupButtons->setEnabled(true) ;
577 GroupPoints->setEnabled(true) ;
579 connect ( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
580 myGeomGUI->SetActiveDialogBox( (QDialog*)this ) ;
581 if( !mySimulationTopoDs.IsNull() )
582 myGeomGUI->DisplaySimulationShape( mySimulationTopoDs ) ;
587 //=================================================================================
588 // function : enterEvent [REDEFINED]
590 //=================================================================================
591 void GeometryGUI_BoxDlg::enterEvent(QEvent* e)
593 if ( GroupConstructors->isEnabled() )
595 ActivateThisDialog() ;
599 //=================================================================================
600 // function : closeEvent()
602 //=================================================================================
603 void GeometryGUI_BoxDlg::closeEvent( QCloseEvent* e )
605 this->ClickOnCancel() ; /* same than click on cancel button */
609 //=================================================================================
610 // function : TestBoxDimensions()
612 //=================================================================================
613 bool GeometryGUI_BoxDlg::TestBoxDimensions(gp_Pnt P1, gp_Pnt P2)
615 if ( ( fabs( P1.X() - P2.X() ) > Precision::Confusion() ) &&
616 ( fabs( P1.Y() - P2.Y() ) > Precision::Confusion() ) &&
617 ( fabs( P1.Z() - P2.Z() ) > Precision::Confusion() ) )