]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GenerationGUI/GenerationGUI_FillingDlg.cxx
Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/geom.git] / src / GenerationGUI / GenerationGUI_FillingDlg.cxx
index 968e4df57e8b74ec6d004d3dd9d49dc4d9ae7de8..85d0203b82c6cfa78e130db405ff798ee4e3b209 100644 (file)
@@ -26,9 +26,9 @@
 //  Module : GEOM
 //  $Header$
 
-using namespace std;
 #include "GenerationGUI_FillingDlg.h"
 
+#include "QAD_WaitCursor.h"
 #include "QAD_Config.h"
 
 #include <GeomFill_SectionGenerator.hxx>
@@ -38,8 +38,14 @@ using namespace std;
 #include <Geom_TrimmedCurve.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <TopExp_Explorer.hxx>
+#include <TopoDS_Iterator.hxx>
 #include <BRep_Tool.hxx>
 #include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+
+#include "utilities.h"
+
+using namespace std;
 
 //=================================================================================
 // class    : GenerationGUI_FillingDlg()
@@ -172,6 +178,7 @@ void GenerationGUI_FillingDlg::ClickOnOk()
 //=================================================================================
 void GenerationGUI_FillingDlg::ClickOnApply()
 {
+  buttonApply->setFocus();
   QAD_Application::getDesktop()->putInfo(tr(""));
   if (mySimulationTopoDs.IsNull())
     return;
@@ -209,10 +216,14 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
     return;
   
   if(myEditCurrentArgument == GroupPoints->LineEdit1 && mySectionShape.ShapeType() == TopAbs_COMPOUND) {
-    myEditCurrentArgument->setText(aString);
     myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult);
     if(!testResult)
       return;
+    // mySectionShape should be a compound of edges
+    for ( TopoDS_Iterator it( mySectionShape ); it.More(); it.Next() )
+      if ( it.Value().ShapeType() != TopAbs_EDGE )
+        return;
+    myEditCurrentArgument->setText(aString);
     myOkSectionShape = true;
   }
 
@@ -318,6 +329,8 @@ void GenerationGUI_FillingDlg::ValueChangedInSpinBox(double newValue)
 //=================================================================================
 void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
 {
+  QAD_WaitCursor wc;
+
   myGeomBase->EraseSimulationShape();
   mySimulationTopoDs.Nullify();
 
@@ -335,6 +348,7 @@ void GenerationGUI_FillingDlg::MakeFillingSimulationAndDisplay()
       if( Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE)
        return;
       C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+      if (C.IsNull()) continue;
       C = new Geom_TrimmedCurve(C, First, Last);
       Section.AddCurve(C) ;
       i++ ;