]> SALOME platform Git repositories - modules/geom.git/blob - src/OperationGUI/OperationGUI_ChamferDlg.cxx
Salome HOME
SALOME PAL V1_4_1
[modules/geom.git] / src / OperationGUI / OperationGUI_ChamferDlg.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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : OperationGUI_ChamferDlg.cxx
25 //  Author : Damien COQUERET
26 //  Module : GEOM
27 //  $Header$
28
29 using namespace std;
30 #include "OperationGUI_ChamferDlg.h"
31
32 #include "DisplayGUI.h"
33 #include "QAD_MessageBox.h"
34
35 #include <AIS_InteractiveContext.hxx>
36 #include <BRepFilletAPI_MakeChamfer.hxx>
37 #include <BRepTools.hxx>
38 #include <BRep_Tool.hxx>
39 #include <TopExp.hxx>
40 #include <Precision.hxx>
41
42 #include <Standard_ErrorHandler.hxx> 
43 #include <Standard_Failure.hxx>
44
45 //=================================================================================
46 // class    : OperationGUI_ChamferDlg()
47 // purpose  : Constructs a OperationGUI_ChamferDlg which is a child of 'parent', with the 
48 //            name 'name' and widget flags set to 'f'.
49 //            The dialog will by default be modeless, unless you set 'modal' to
50 //            TRUE to construct a modal dialog.
51 //=================================================================================
52 OperationGUI_ChamferDlg::OperationGUI_ChamferDlg(QWidget* parent, const char* name, OperationGUI* theOperationGUI, SALOME_Selection* Sel, Handle(AIS_InteractiveContext) ic, bool modal, WFlags fl)
53   :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
54 {
55   QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_ALL")));
56   QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_EDGE")));
57   QPixmap image2(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_CHAMFER_FACE")));
58   QPixmap image3(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
59
60     setCaption(tr("GEOM_CHAMFER_TITLE"));
61
62   /***************************************************************/
63   GroupConstructors->setTitle(tr("GEOM_CHAMFER"));
64   RadioButton1->setPixmap(image0);
65   RadioButton2->setPixmap(image1);
66   RadioButton3->setPixmap(image2);
67
68   Group1 = new DlgRef_1Sel2Spin(this, "Group1");
69   Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_ALL"));
70   Group1->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
71   Group1->TextLabel2->setText(tr("GEOM_D1"));
72   Group1->TextLabel3->setText(tr("GEOM_D2"));
73   Group1->PushButton1->setPixmap(image3);
74
75   Group2 = new DlgRef_1Sel2Spin(this, "Group2");
76   Group2->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
77   Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
78   Group2->TextLabel2->setText(tr("GEOM_D1"));
79   Group2->TextLabel3->setText(tr("GEOM_D2"));
80   Group2->PushButton1->setPixmap(image3);
81
82   Group3 = new DlgRef_1Sel2Spin(this, "Group3");
83   Group3->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
84   Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
85   Group3->TextLabel2->setText(tr("GEOM_D1"));
86   Group3->TextLabel3->setText(tr("GEOM_D2"));
87   Group3->PushButton1->setPixmap(image3);
88
89   Layout1->addWidget(Group1, 1, 0);
90   Layout1->addWidget(Group2, 1, 0);
91   Layout1->addWidget(Group3, 1, 0);
92   /***************************************************************/
93
94   /* Initialisations */
95   myOperationGUI = theOperationGUI;
96   Init(ic);
97 }
98
99
100 //=================================================================================
101 // function : ~OperationGUI_ChamferDlg()
102 // purpose  : Destroys the object and frees any allocated resources
103 //=================================================================================
104 OperationGUI_ChamferDlg::~OperationGUI_ChamferDlg()
105 {  
106   /* no need to delete child widgets, Qt does it all for us */
107 }
108
109
110 //=================================================================================
111 // function : Init()
112 // purpose  :
113 //=================================================================================
114 void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
115 {
116   /* init variables */
117   myConstructorId = 0;
118   myEditCurrentArgument = Group1->LineEdit1;
119
120   myD1 = 5.0;
121   myD2 = 5.0;
122   myOkShape = false;
123   myIC = ic;
124   myLocalContextId = -1;
125   myUseLocalContext = false;
126
127   double SpecificStep = 10.0;
128   /* min, max, step and decimals for spin boxes */
129   Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
130   Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
131   Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
132   Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
133   Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
134   Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
135
136   Group1->SpinBox_DX->SetValue(myD1);
137   Group2->SpinBox_DX->SetValue(myD1);
138   Group3->SpinBox_DX->SetValue(myD1);
139   Group1->SpinBox_DY->SetValue(myD2);
140   Group2->SpinBox_DY->SetValue(myD2);
141   Group3->SpinBox_DY->SetValue(myD2);
142
143   /* signals and slots connections */
144   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
145   connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
146   connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
147
148   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
149   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
150   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
151
152   connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
153   connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
154   connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
155
156   connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
157   connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
158   connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
159
160   connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
161   connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
162   connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
163   connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
164   connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
165   connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
166   
167   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
168   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
169   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
170   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
171   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DY, SLOT(SetStep(double)));
172   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DY, SLOT(SetStep(double)));
173
174   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
175
176   /* displays Dialog */
177   Group2->hide();
178   Group3->hide();
179   Group1->show();
180   this->show();
181
182   return;
183 }
184
185
186 //=================================================================================
187 // function : ConstructorsClicked()
188 // purpose  : Radio button management
189 //=================================================================================
190 void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
191 {
192   myConstructorId = constructorId;
193   myGeomBase->EraseSimulationShape();
194   mySimulationTopoDs.Nullify();
195   disconnect(mySelection, 0, this, 0);
196   myOkShape = false;
197   myD1 = 5.0;
198   myD2 = 5.0;
199
200   if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
201     myIC->CloseLocalContext(myLocalContextId);
202     DisplayGUI* myDisplayGUI = new DisplayGUI();
203     myDisplayGUI->OnDisplayAll(true);
204     myUseLocalContext = false;
205   }
206
207   if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_OCC) {
208     myConstructorId = constructorId = 0; //No subshape selection if viewer is not OCC
209     RadioButton1->setChecked(TRUE);
210   }
211
212   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
213   switch (constructorId)
214     {
215     case 0: /* Chamfer All */
216       {
217         Group2->hide();
218         Group3->hide();
219         resize(0, 0);
220         Group1->show();
221
222         myEditCurrentArgument = Group1->LineEdit1;
223         Group1->LineEdit1->setText("");
224         myShapeType = -1;
225
226         Group1->SpinBox_DX->SetValue(myD1);
227         Group1->SpinBox_DY->SetValue(myD2);
228         break;
229       }
230     case 1: /* Chamfer edges */
231       {
232         Group1->hide();
233         Group3->hide();
234         resize(0, 0);
235         Group2->show();
236
237         myEditCurrentArgument = Group2->LineEdit1;
238         Group2->LineEdit1->setText("");
239         myShapeType = 6;
240
241         Group2->SpinBox_DX->SetValue(myD1);
242         Group2->SpinBox_DY->SetValue(myD2);
243         break;
244       }
245     case 2: /* Chamfer Faces */
246       {
247         Group1->hide();
248         Group2->hide();
249         resize(0, 0);
250         Group3->show();
251
252         myEditCurrentArgument = Group3->LineEdit1;
253         Group3->LineEdit1->setText("");
254         myShapeType = 4;
255
256         Group3->SpinBox_DX->SetValue(myD1);
257         Group3->SpinBox_DY->SetValue(myD2);
258         break;
259       }
260     }
261  return;
262 }
263
264
265 //=================================================================================
266 // function : ClickOnOk()
267 // purpose  :
268 //=================================================================================
269 void OperationGUI_ChamferDlg::ClickOnOk()
270 {
271   this->ClickOnApply();
272   this->ClickOnCancel();
273   return;
274 }
275
276
277 //=================================================================================
278 // function : ClickOnApply()
279 // purpose  :
280 //=================================================================================
281 void OperationGUI_ChamferDlg::ClickOnApply()
282 {
283   buttonApply->setFocus();
284   QApplication::setOverrideCursor(Qt::waitCursor);
285   QAD_Application::getDesktop()->putInfo(tr(""));
286   myGeomBase->EraseSimulationShape();
287   mySimulationTopoDs.Nullify();
288
289   bool testResult = false;
290   switch(myConstructorId)
291     { 
292     case 0 : /* Chamfer All */
293       { 
294         if(myOkShape)
295           testResult = myOperationGUI->OnChamferGetAll(myShape, myD1, myD2, myShapeType, myShapeIOR);
296         break;
297       }
298     case 1 : /* Chamfer Edge */
299       { 
300         if(myOkShape)
301           testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType, 
302                                                             myLocalContextId, myUseLocalContext);
303         break;
304       }
305     case 2 :  /* Chamfer Face */
306       {
307         if(myOkShape)
308           testResult = myOperationGUI->OnChamferGetSelected(myShape, myShapeIOR, myD1, myD2, myShapeType, 
309                                                             myLocalContextId, myUseLocalContext);
310         break;
311       }
312     }
313
314   if(!testResult) 
315     QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_ABORT"));
316   else
317     QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_DONE"));
318   /* Reset all arguments and local context to allow user a new selection ...*/
319   this->ResetStateOfDialog();
320   QApplication::restoreOverrideCursor();
321   return;
322 }
323
324
325 //=================================================================================
326 // function : ClickOnCancel()
327 // purpose  :
328 //=================================================================================
329 void OperationGUI_ChamferDlg::ClickOnCancel()
330 {
331   this->ResetStateOfDialog();
332   GEOMBase_Skeleton::ClickOnCancel();
333   return;
334 }
335
336
337 //=================================================================================
338 // function : SelectionIntoArgument()
339 // purpose  : Called when selection has changed
340 //=================================================================================
341 void OperationGUI_ChamferDlg::SelectionIntoArgument()
342 {
343   myGeomBase->EraseSimulationShape();
344   mySimulationTopoDs.Nullify();
345   myEditCurrentArgument->setText("");
346   this->ResetStateOfDialog();
347   QString aString = ""; /* name of selection */
348
349   int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString);
350   if (nbSel == 1) {
351     TopoDS_Shape S;
352     Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject();
353     if(!myGeomBase->GetTopoFromSelection(mySelection, S))
354       return;
355     if(!IO->hasEntry()) {
356       QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
357       return;
358     }
359
360     if(!S.IsNull() &&  S.ShapeType() <= 2) {
361       if(IO->IsInstance(STANDARD_TYPE(GEOM_InteractiveObject))) {
362         Handle(GEOM_InteractiveObject) GIObject = Handle(GEOM_InteractiveObject)::DownCast(IO);
363         myShapeIOR = GIObject->getIOR(); /* the Geom IOR string of selection */
364         myEditCurrentArgument->setText(aString);
365         myShape = S;
366         myOkShape = true;
367       }
368         
369       if(IO->hasEntry()) {
370         SALOMEDS::Study_var aStudy = QAD_Application::getDesktop()->getActiveStudy()->getStudyDocument();
371         SALOMEDS::SObject_var obj = aStudy->FindObjectID(IO->getEntry());
372         SALOMEDS::GenericAttribute_var anAttr;
373         SALOMEDS::AttributeIOR_var anIOR;
374         if(!obj->_is_nil()) {
375           if(obj->FindAttribute(anAttr, "AttributeIOR")) {
376             anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
377             myShapeIOR = anIOR->Value();
378             myOkShape = true;
379             myShape = S;
380             myEditCurrentArgument->setText(aString);
381           }
382         }
383       }
384     }
385     if(myConstructorId == 0)
386       this->MakePreview();
387
388   }
389   else 
390     return;
391   
392   if(myOkShape && myShapeType!=-1 && myConstructorId != 0) {
393     /* local context is defined into the method */
394     DisplayGUI* myDisplayGUI = new DisplayGUI();
395     myDisplayGUI->PrepareSubShapeSelection(myShapeType, myLocalContextId);  
396     myUseLocalContext = true;
397   }
398 }
399
400
401 //=================================================================================
402 // function : LineEditReturnPressed()
403 // purpose  :
404 //=================================================================================
405 void OperationGUI_ChamferDlg::LineEditReturnPressed()
406 {
407   QLineEdit* send = (QLineEdit*)sender();
408   if(send == Group1->LineEdit1)
409     myEditCurrentArgument = Group1->LineEdit1;
410   else if (send == Group2->LineEdit1)
411     myEditCurrentArgument = Group2->LineEdit1;
412   else if (send == Group3->LineEdit1)
413     myEditCurrentArgument = Group3->LineEdit1;
414   else
415     return;
416
417   GEOMBase_Skeleton::LineEditReturnPressed();
418   return;
419 }
420
421
422 //=================================================================================
423 // function : SetEditCurrentArgument()
424 // purpose  :
425 //=================================================================================
426 void OperationGUI_ChamferDlg::SetEditCurrentArgument()
427 {
428   QPushButton* send = (QPushButton*)sender();  
429
430   if(send == Group1->PushButton1) {
431     Group1->LineEdit1->setFocus();
432     myEditCurrentArgument = Group1->LineEdit1;
433   }
434   else if(send == Group2->PushButton1) {
435     Group2->LineEdit1->setFocus();
436     myEditCurrentArgument = Group2->LineEdit1;
437   }
438   else if(send == Group3->PushButton1) {
439     Group3->LineEdit1->setFocus();
440     myEditCurrentArgument = Group3->LineEdit1;
441   }
442   this->SelectionIntoArgument();
443   return;
444 }
445
446
447 //=================================================================================
448 // function : DeactivateActiveDialog()
449 // purpose  :
450 //=================================================================================
451 void OperationGUI_ChamferDlg::DeactivateActiveDialog()
452 {
453   this->ResetStateOfDialog();
454   GEOMBase_Skeleton::DeactivateActiveDialog();
455   return;
456 }
457
458
459 //=================================================================================
460 // function : ActivateThisDialog()
461 // purpose  :
462 //=================================================================================
463 void OperationGUI_ChamferDlg::ActivateThisDialog()
464 {
465   GEOMBase_Skeleton::ActivateThisDialog();
466   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
467   if(!mySimulationTopoDs.IsNull())
468     myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
469   return;
470 }
471
472
473 //=================================================================================
474 // function : enterEvent()
475 // purpose  :
476 //=================================================================================
477 void OperationGUI_ChamferDlg::enterEvent(QEvent* e)
478 {
479   if(GroupConstructors->isEnabled())
480     return;
481   this->ActivateThisDialog();
482   return;
483 }
484
485
486 //=================================================================================
487 // function : closeEvent()
488 // purpose  :
489 //=================================================================================
490 void OperationGUI_ChamferDlg::closeEvent(QCloseEvent* e)
491
492   /* same than click on cancel button */
493   this->ClickOnCancel();
494   return;
495 }
496
497
498 //=================================================================================
499 // function : ValueChangedInSpinBox()
500 // purpose  :
501 //=================================================================================
502 void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue )
503 {
504   myGeomBase->EraseSimulationShape(); 
505   mySimulationTopoDs.Nullify();
506
507   QObject* send = (QObject*)sender();
508   if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
509     myD1 = newValue;
510     if(myConstructorId == 0)
511       this->MakePreview();
512     return ;
513   } 
514   else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
515     myD2 = newValue;
516     if(myConstructorId == 0)
517       this->MakePreview();
518     return;
519   }
520   return;
521 }
522
523
524 //=================================================================================
525 // function : ResetStateOfDialog()
526 // purpose  :
527 //=================================================================================
528 void OperationGUI_ChamferDlg::ResetStateOfDialog()
529 {
530   myOkShape = false;
531   myEditCurrentArgument->setText("");
532   QApplication::restoreOverrideCursor();
533
534   /* Close its local contact if opened */
535   if(QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myUseLocalContext) {
536     myIC->CloseLocalContext(myLocalContextId);
537     myUseLocalContext = false;
538     DisplayGUI* myDisplayGUI = new DisplayGUI();
539     myDisplayGUI->OnDisplayAll(true);
540   }
541   return;
542 }
543
544
545 //=================================================================================
546 // function : MakePreview()
547 // purpose  :
548 //=================================================================================
549 void OperationGUI_ChamferDlg::MakePreview()
550 {
551   QApplication::setOverrideCursor( Qt::waitCursor );
552   TopoDS_Shape tds ;
553   try
554   {
555   BRepFilletAPI_MakeChamfer MC(myShape);
556   switch (myConstructorId)
557     {
558     case 0: /* Chamfer All */
559       {
560         TopTools_IndexedDataMapOfShapeListOfShape M;
561         TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,M);
562         for (int i = 1;i<=M.Extent();i++) 
563           {
564             TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));
565             TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First());
566             if (!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E))
567               MC.Add(myD1, myD2,E,F);
568           }
569         tds = MC.Shape();
570         break;
571       }
572 //    case 1: /* Chamfer edges */
573 //    case 2: /* Chamfer Faces */
574     }
575    if (!tds.IsNull()) 
576     {
577       mySimulationTopoDs = tds;
578       myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ; 
579     }
580
581   }  
582   catch(Standard_Failure)
583     {
584       QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK"));
585       Group1->SpinBox_DX->SetValue(5.0);
586       Group1->SpinBox_DY->SetValue(5.0);
587       myGeomBase->EraseSimulationShape() ; 
588       mySimulationTopoDs.Nullify() ;
589       QApplication::restoreOverrideCursor();
590     }
591   QApplication::restoreOverrideCursor();
592 }