]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
DCQ : Debug selection Base_Ecole_Ete
authordcq <dcq@opencascade.com>
Thu, 8 Apr 2004 08:15:42 +0000 (08:15 +0000)
committerdcq <dcq@opencascade.com>
Thu, 8 Apr 2004 08:15:42 +0000 (08:15 +0000)
src/OperationGUI/OperationGUI_ChamferDlg.cxx
src/OperationGUI/OperationGUI_ChamferDlg.h
src/OperationGUI/OperationGUI_FilletDlg.cxx
src/OperationGUI/OperationGUI_FilletDlg.h

index ca7c5d0cda0a3b086f637d158cfb10868d492168..3698d3ffadc71b41aad21813cfd69b1cbc042e0f 100644 (file)
@@ -72,23 +72,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg(QWidget* parent, const char* na
   Group1->TextLabel3->setText(tr("GEOM_D2"));
   Group1->PushButton1->setPixmap(image3);
 
-  Group2 = new DlgRef_1Sel2Spin(this, "Group2");
-  Group2->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
-  Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
-  Group2->TextLabel2->setText(tr("GEOM_D1"));
-  Group2->TextLabel3->setText(tr("GEOM_D2"));
-  Group2->PushButton1->setPixmap(image3);
-
-  Group3 = new DlgRef_1Sel2Spin(this, "Group3");
-  Group3->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
-  Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
-  Group3->TextLabel2->setText(tr("GEOM_D1"));
-  Group3->TextLabel3->setText(tr("GEOM_D2"));
-  Group3->PushButton1->setPixmap(image3);
-
   Layout1->addWidget(Group1, 1, 0);
-  Layout1->addWidget(Group2, 1, 0);
-  Layout1->addWidget(Group3, 1, 0);
   /***************************************************************/
 
   /* Initialisations */
@@ -127,18 +111,10 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
   double SpecificStep = 10.0;
   /* min, max, step and decimals for spin boxes */
   Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-  Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-  Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
   Group1->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-  Group2->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-  Group3->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
 
   Group1->SpinBox_DX->SetValue(myD1);
-  Group2->SpinBox_DX->SetValue(myD1);
-  Group3->SpinBox_DX->SetValue(myD1);
   Group1->SpinBox_DY->SetValue(myD2);
-  Group2->SpinBox_DY->SetValue(myD2);
-  Group3->SpinBox_DY->SetValue(myD2);
 
   /* signals and slots connections */
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
@@ -150,32 +126,16 @@ void OperationGUI_ChamferDlg::Init(Handle (AIS_InteractiveContext) ic)
   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
 
   connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
   connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
 
   connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
   connect(Group1->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(Group2->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(Group3->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DY, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DY, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DY, SLOT(SetStep(double)));
 
   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   /* displays Dialog */
-  Group2->hide();
-  Group3->hide();
   Group1->show();
   this->show();
 
@@ -210,51 +170,27 @@ void OperationGUI_ChamferDlg::ConstructorsClicked(int constructorId)
   }
 
   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  Group1->LineEdit1->setText("");
+  Group1->SpinBox_DX->SetValue(myD1);
+  Group1->SpinBox_DY->SetValue(myD2);
   switch (constructorId)
     {
     case 0: /* Chamfer All */
       {
-       Group2->hide();
-       Group3->hide();
-       resize(0, 0);
-       Group1->show();
-
-       myEditCurrentArgument = Group1->LineEdit1;
-       Group1->LineEdit1->setText("");
+       Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_ALL"));
        myShapeType = -1;
-
-       Group1->SpinBox_DX->SetValue(myD1);
-       Group1->SpinBox_DY->SetValue(myD2);
        break;
       }
     case 1: /* Chamfer edges */
       {
-       Group1->hide();
-       Group3->hide();
-       resize(0, 0);
-       Group2->show();
-
-       myEditCurrentArgument = Group2->LineEdit1;
-       Group2->LineEdit1->setText("");
+       Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_EDGES"));
        myShapeType = 6;
-
-       Group2->SpinBox_DX->SetValue(myD1);
-       Group2->SpinBox_DY->SetValue(myD2);
        break;
       }
     case 2: /* Chamfer Faces */
       {
-       Group1->hide();
-       Group2->hide();
-       resize(0, 0);
-       Group3->show();
-
-       myEditCurrentArgument = Group3->LineEdit1;
-       Group3->LineEdit1->setText("");
+       Group1->GroupBox1->setTitle(tr("GEOM_CHAMFER_FACES"));
        myShapeType = 4;
-
-       Group3->SpinBox_DX->SetValue(myD1);
-       Group3->SpinBox_DY->SetValue(myD2);
        break;
       }
     }
@@ -382,7 +318,7 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
        }
       }
     }
-    if(myConstructorId == 0)
+    if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
       this->MakePreview();
 
   }
@@ -398,27 +334,6 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
 }
 
 
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose  :
-//=================================================================================
-void OperationGUI_ChamferDlg::LineEditReturnPressed()
-{
-  QLineEdit* send = (QLineEdit*)sender();
-  if(send == Group1->LineEdit1)
-    myEditCurrentArgument = Group1->LineEdit1;
-  else if (send == Group2->LineEdit1)
-    myEditCurrentArgument = Group2->LineEdit1;
-  else if (send == Group3->LineEdit1)
-    myEditCurrentArgument = Group3->LineEdit1;
-  else
-    return;
-
-  GEOMBase_Skeleton::LineEditReturnPressed();
-  return;
-}
-
-
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :
@@ -427,18 +342,9 @@ void OperationGUI_ChamferDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();  
 
-  if(send == Group1->PushButton1) {
+  if(send == Group1->PushButton1)
     Group1->LineEdit1->setFocus();
-    myEditCurrentArgument = Group1->LineEdit1;
-  }
-  else if(send == Group2->PushButton1) {
-    Group2->LineEdit1->setFocus();
-    myEditCurrentArgument = Group2->LineEdit1;
-  }
-  else if(send == Group3->PushButton1) {
-    Group3->LineEdit1->setFocus();
-    myEditCurrentArgument = Group3->LineEdit1;
-  }
+
   this->SelectionIntoArgument();
   return;
 }
@@ -499,24 +405,20 @@ void OperationGUI_ChamferDlg::closeEvent(QCloseEvent* e)
 // function : ValueChangedInSpinBox()
 // purpose  :
 //=================================================================================
-void OperationGUI_ChamferDlg::ValueChangedInSpinBox( double newValue )
+void OperationGUI_ChamferDlg::ValueChangedInSpinBox(double newValue)
 {
   myGeomBase->EraseSimulationShape(); 
   mySimulationTopoDs.Nullify();
 
   QObject* send = (QObject*)sender();
-  if(send == Group1->SpinBox_DX || send == Group2->SpinBox_DX || send == Group3->SpinBox_DX) { /* D1 */
+  if(send == Group1->SpinBox_DX /* D1 */
     myD1 = newValue;
-    if(myConstructorId == 0)
-      this->MakePreview();
-    return ;
-  } 
-  else if(send == Group1->SpinBox_DY || send == Group2->SpinBox_DY || send == Group3->SpinBox_DY) { /* D2 */
+  else if(send == Group1->SpinBox_DY)  /* D2 */
     myD2 = newValue;
-    if(myConstructorId == 0)
-      this->MakePreview();
-    return;
-  }
+
+  if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
+    this->MakePreview();
+
   return;
 }
 
@@ -548,45 +450,45 @@ void OperationGUI_ChamferDlg::ResetStateOfDialog()
 //=================================================================================
 void OperationGUI_ChamferDlg::MakePreview()
 {
-  QApplication::setOverrideCursor( Qt::waitCursor );
-  TopoDS_Shape tds ;
-  try
-  {
-  BRepFilletAPI_MakeChamfer MC(myShape);
-  switch (myConstructorId)
-    {
-    case 0: /* Chamfer All */
+  QApplication::setOverrideCursor(Qt::waitCursor);
+  TopoDS_Shape tds;
+
+  try {
+    BRepFilletAPI_MakeChamfer MC(myShape);
+    switch(myConstructorId)
       {
-       TopTools_IndexedDataMapOfShapeListOfShape M;
-       TopExp::MapShapesAndAncestors(myShape,TopAbs_EDGE,TopAbs_FACE,M);
-       for (int i = 1;i<=M.Extent();i++) 
-         {
+      case 0: /* Chamfer All */
+       {
+         TopTools_IndexedDataMapOfShapeListOfShape M;
+         TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, M);
+         for(int i = 1; i <= M.Extent(); i++) {
            TopoDS_Edge E = TopoDS::Edge(M.FindKey(i));
            TopoDS_Face F = TopoDS::Face(M.FindFromIndex(i).First());
-           if (!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E))
-             MC.Add(myD1, myD2,E,F);
+           if(!BRepTools::IsReallyClosed(E, F) && !BRep_Tool::Degenerated(E))
+             MC.Add(myD1, myD2, E, F);
          }
-       tds = MC.Shape();
-       break;
+         tds = MC.Shape();
+         break;
+       }
+      //    case 1: /* Chamfer edges */
+      //    case 2: /* Chamfer Faces */
       }
-//    case 1: /* Chamfer edges */
-//    case 2: /* Chamfer Faces */
-    }
-   if (!tds.IsNull()) 
-    {
+
+    if(!tds.IsNull()) {
       mySimulationTopoDs = tds;
-      myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) 
+      myGeomBase->DisplaySimulationShape(mySimulationTopoDs)
     }
+  }
+  catch(Standard_Failure) {
+    QApplication::restoreOverrideCursor();
+    QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK"));
+    QApplication::setOverrideCursor(Qt::waitCursor);
+    myGeomBase->EraseSimulationShape(); 
+    mySimulationTopoDs.Nullify();
+    Group1->SpinBox_DX->SetValue(5.0);
+    Group1->SpinBox_DY->SetValue(5.0);
+  }
 
-  }  
-  catch(Standard_Failure)
-    {
-      QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_CHAMFER_ABORT").arg(myD1).arg(myD2), tr("GEOM_BUT_OK"));
-      Group1->SpinBox_DX->SetValue(5.0);
-      Group1->SpinBox_DY->SetValue(5.0);
-      myGeomBase->EraseSimulationShape() ; 
-      mySimulationTopoDs.Nullify() ;
-      QApplication::restoreOverrideCursor();
-    }
   QApplication::restoreOverrideCursor();
+  return;
 }
index 46e114443b51c2cc63d83ad6ef5f9e8d1b9f4f3a..320bc37c9a19c446097e42d122d0e8703c52026c 100644 (file)
@@ -72,8 +72,6 @@ private :
     double myD2;
     
     DlgRef_1Sel2Spin* Group1;
-    DlgRef_1Sel2Spin* Group2;
-    DlgRef_1Sel2Spin* Group3;
 
 private slots:
     void ClickOnOk();
@@ -81,7 +79,6 @@ private slots:
     void ClickOnCancel();
     void ActivateThisDialog();
     void DeactivateActiveDialog();
-    void LineEditReturnPressed();
     void SelectionIntoArgument();
     void SetEditCurrentArgument();
     void ValueChangedInSpinBox(double newValue);
index 01913de90b16435652e013f642f58695bbe83f89..d9da9cdae4f486e2e89b84870c6fa55987b25e81 100644 (file)
@@ -69,21 +69,7 @@ OperationGUI_FilletDlg::OperationGUI_FilletDlg(QWidget* parent, const char* name
   Group1->TextLabel2->setText(tr("GEOM_RADIUS"));
   Group1->PushButton1->setPixmap(image3);
 
-  Group2 = new DlgRef_1Sel1Spin(this, "Group2");
-  Group2->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
-  Group2->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
-  Group2->TextLabel2->setText(tr("GEOM_RADIUS"));
-  Group2->PushButton1->setPixmap(image3);
-
-  Group3 = new DlgRef_1Sel1Spin(this, "Group3");
-  Group3->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
-  Group3->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
-  Group3->TextLabel2->setText(tr("GEOM_RADIUS"));
-  Group3->PushButton1->setPixmap(image3);
-
   Layout1->addWidget(Group1, 1, 0);
-  Layout1->addWidget(Group2, 1, 0);
-  Layout1->addWidget(Group3, 1, 0);
   /***************************************************************/
 
   /* Initialisations */
@@ -121,12 +107,7 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic)
   double SpecificStep = 10.0;
   /* min, max, step and decimals for spin boxes */
   Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-  Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-  Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3);
-
   Group1->SpinBox_DX->SetValue(myRadius);
-  Group2->SpinBox_DX->SetValue(myRadius);
-  Group3->SpinBox_DX->SetValue(myRadius);
 
   /* signals and slots connections */
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
@@ -138,26 +119,14 @@ void OperationGUI_FilletDlg::Init(Handle(AIS_InteractiveContext) ic)
   connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
 
   connect(Group1->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group2->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(Group3->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-
   connect(Group1->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group2->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(Group3->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
 
   connect(Group1->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(Group2->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(Group3->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group1->SpinBox_DX, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group2->SpinBox_DX, SLOT(SetStep(double)));
-  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), Group3->SpinBox_DX, SLOT(SetStep(double)));
 
   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   /* displays Dialog */
-  Group2->hide();
-  Group3->hide();
   Group1->show();
   this->show();
 
@@ -191,48 +160,26 @@ void OperationGUI_FilletDlg::ConstructorsClicked(int constructorId)
   }
   
   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  Group1->LineEdit1->setText("");
+  Group1->SpinBox_DX->SetValue(myRadius);
   switch (constructorId)
     {
     case 0: /* Fillet All */
       {
-       Group2->hide();
-       Group3->hide();
-       resize(0, 0);
-       Group1->show();
-
-       myEditCurrentArgument = Group1->LineEdit1;
-       Group1->LineEdit1->setText("");
+       Group1->GroupBox1->setTitle(tr("GEOM_FILLET_ALL"));
        myShapeType = -1;
-
-       Group1->SpinBox_DX->SetValue(myRadius);
        break;
       }
     case 1: /* Fillet edges */
       {
-       Group1->hide();
-       Group3->hide();
-       resize(0, 0);
-       Group2->show();
-
-       myEditCurrentArgument = Group2->LineEdit1;
-       Group2->LineEdit1->setText("");
+       Group1->GroupBox1->setTitle(tr("GEOM_FILLET_EDGES"));
        myShapeType = 6;
-
-       Group2->SpinBox_DX->SetValue(myRadius);
        break;
       }
     case 2: /* Fillet Faces */
       {
-       Group1->hide();
-       Group2->hide();
-       resize(0, 0);
-       Group3->show();
-
-       myEditCurrentArgument = Group3->LineEdit1;
-       Group3->LineEdit1->setText("");
+       Group1->GroupBox1->setTitle(tr("GEOM_FILLET_FACES"));
        myShapeType = 4;
-
-       Group3->SpinBox_DX->SetValue(myRadius);
        break;
       }
     }
@@ -358,7 +305,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
        }
       }
     }
-    if(myConstructorId == 0)
+    if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
       this->MakePreview();
   }
   else 
@@ -373,27 +320,6 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
 }
 
 
-//=================================================================================
-// function : LineEditReturnPressed()
-// purpose  :
-//=================================================================================
-void OperationGUI_FilletDlg::LineEditReturnPressed()
-{
-  QLineEdit* send = (QLineEdit*)sender();
-  if(send == Group1->LineEdit1)
-    myEditCurrentArgument = Group1->LineEdit1;
-  else if (send == Group2->LineEdit1)
-    myEditCurrentArgument = Group2->LineEdit1;
-  else if (send == Group3->LineEdit1)
-    myEditCurrentArgument = Group3->LineEdit1;
-  else
-    return;
-
-  GEOMBase_Skeleton::LineEditReturnPressed();
-  return;
-}
-
-
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :
@@ -402,18 +328,9 @@ void OperationGUI_FilletDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();  
 
-  if(send == Group1->PushButton1) {
+  if(send == Group1->PushButton1)
     Group1->LineEdit1->setFocus();
-    myEditCurrentArgument = Group1->LineEdit1;
-  }
-  else if(send == Group2->PushButton1) {
-    Group2->LineEdit1->setFocus();
-    myEditCurrentArgument = Group2->LineEdit1;
-  }
-  else if(send == Group3->PushButton1) {
-    Group3->LineEdit1->setFocus();
-    myEditCurrentArgument = Group3->LineEdit1;
-  }
+
   this->SelectionIntoArgument();
   return;
 }
@@ -502,7 +419,7 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
 
   myRadius = newValue;
 
-  if(myConstructorId == 0)
+  if(myOkShape && QAD_Application::getDesktop()->getActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_OCC && myConstructorId == 0)
     this->MakePreview();
   return;
 }
@@ -514,56 +431,57 @@ void OperationGUI_FilletDlg::ValueChangedInSpinBox(double newValue)
 //=================================================================================
 void OperationGUI_FilletDlg::MakePreview()
 {
-  QApplication::setOverrideCursor( Qt::waitCursor );
-  TopoDS_Shape tds ;
-  try
-    {
-      BRepFilletAPI_MakeFillet fill(myShape);
-      switch (myConstructorId)
+  QApplication::setOverrideCursor(Qt::waitCursor);
+  TopoDS_Shape tds;
+
+  try {
+    BRepFilletAPI_MakeFillet fill(myShape);
+    switch(myConstructorId) 
+      {
+      case 0: /* Fillet All */
        {
-       case 0: /* Fillet All */
-         {
-           TopExp_Explorer Exp ( myShape, TopAbs_EDGE );
-           for (Exp; Exp.More(); Exp.Next()) 
-             {
-               TopoDS_Edge E =TopoDS::Edge(Exp.Current());
-               fill.Add(E);
-             }
-           for (int i = 1;i<=fill.NbContours();i++) {
-             try
-               {
-                 fill.SetRadius(myRadius,i,i);
-               }  
-             catch(Standard_Failure)
-               {
-                 QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
-                 Group1->SpinBox_DX->SetValue(5.0);
-                 myGeomBase->EraseSimulationShape() ; 
-                 mySimulationTopoDs.Nullify() ;
-                 QApplication::restoreOverrideCursor();
-                 return;
-               }
+         TopExp_Explorer Exp(myShape, TopAbs_EDGE);
+         for(Exp; Exp.More(); Exp.Next()) {
+           TopoDS_Edge E = TopoDS::Edge(Exp.Current());
+           fill.Add(E);
+         }
+         
+         for(int i = 1; i <= fill.NbContours(); i++) {
+           try {
+             fill.SetRadius(myRadius,i,i);
+           }  
+           catch(Standard_Failure) {
+             QApplication::restoreOverrideCursor();
+             QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
+             QApplication::setOverrideCursor(Qt::waitCursor);
+             myGeomBase->EraseSimulationShape(); 
+             mySimulationTopoDs.Nullify();
+             Group1->SpinBox_DX->SetValue(5.0);
+             QApplication::restoreOverrideCursor();
+             return;
            }
-           tds = fill.Shape();
-           break;
          }
-         //    case 1: /* Fillet edges */
-         //    case 2: /* Fillet Faces */
-       }
-      if (!tds.IsNull()) 
-       {
-         mySimulationTopoDs = tds;
-         myGeomBase->DisplaySimulationShape( mySimulationTopoDs ) ; 
+         tds = fill.Shape();
+         break;
        }
-    }  
-  catch(Standard_Failure)
-    {
-      QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
-      Group1->SpinBox_DX->SetValue(5.0);
-      myGeomBase->EraseSimulationShape() ; 
-      mySimulationTopoDs.Nullify() ;
-      QApplication::restoreOverrideCursor();
-     
+      //    case 1: /* Fillet edges */
+      //    case 2: /* Fillet Faces */
+      }
+
+    if(!tds.IsNull()) {
+      mySimulationTopoDs = tds;
+      myGeomBase->DisplaySimulationShape(mySimulationTopoDs);
     }
+  }  
+  catch(Standard_Failure) {
+    QApplication::restoreOverrideCursor();
+    QAD_MessageBox::warn1 (QAD_Application::getDesktop(), tr("GEOM_WRN_WARNING"), tr("GEOM_FILLET_ABORT").arg(myRadius), tr("GEOM_BUT_OK"));
+    QApplication::setOverrideCursor(Qt::waitCursor);
+    myGeomBase->EraseSimulationShape(); 
+    mySimulationTopoDs.Nullify();
+    Group1->SpinBox_DX->SetValue(5.0);
+  }
+
   QApplication::restoreOverrideCursor();
+  return;
 }
index 76fbab6f5ca368bdc84d03771d905b00fb059f4b..3756f82b2825a27253f6c18dc95f7d8cc430070a 100644 (file)
@@ -71,8 +71,6 @@ private :
     double myRadius;
     
     DlgRef_1Sel1Spin* Group1;
-    DlgRef_1Sel1Spin* Group2;
-    DlgRef_1Sel1Spin* Group3;
 
 private slots:
     void ClickOnOk();
@@ -80,7 +78,6 @@ private slots:
     void ClickOnCancel();
     void ActivateThisDialog();
     void DeactivateActiveDialog();
-    void LineEditReturnPressed();
     void SelectionIntoArgument();
     void SetEditCurrentArgument();
     void ValueChangedInSpinBox(double newValue);