]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
PAL13380 EDF PAL278 : line driver failed but OK via GUI. Error message precised. V3_2_2pre
authorjfa <jfa@opencascade.com>
Mon, 4 Sep 2006 12:24:10 +0000 (12:24 +0000)
committerjfa <jfa@opencascade.com>
Mon, 4 Sep 2006 12:24:10 +0000 (12:24 +0000)
src/GEOMImpl/GEOMImpl_LineDriver.cxx

index 8e27bcb3c5699545753ed9977fabe37bcd68429c..a7bf8d433b86970c5addbe27a797b562c6801b8c 100644 (file)
@@ -79,7 +79,9 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const
     TopoDS_Shape aShape1 = aRefPnt1->GetValue();
     TopoDS_Shape aShape2 = aRefPnt2->GetValue();
     if (aShape1.ShapeType() != TopAbs_VERTEX ||
-        aShape2.ShapeType() != TopAbs_VERTEX) return 0;
+        aShape2.ShapeType() != TopAbs_VERTEX) {
+      Standard_ConstructionError::Raise("Wrong arguments: two points must be given");
+    }
     if (aShape1.IsSame(aShape2)) {
       Standard_ConstructionError::Raise("The end points must be different");
     }
@@ -95,8 +97,12 @@ Standard_Integer GEOMImpl_LineDriver::Execute(TFunction_Logbook& log) const
     Handle(GEOM_Function) aRefDir = aPI.GetPoint2();
     TopoDS_Shape aShape1 = aRefPnt->GetValue();
     TopoDS_Shape aShape2 = aRefDir->GetValue();
-    if (aShape1.ShapeType() != TopAbs_VERTEX ||
-        aShape2.ShapeType() != TopAbs_EDGE) return 0;
+    if (aShape1.ShapeType() != TopAbs_VERTEX) {
+      Standard_ConstructionError::Raise("Wrong first argument: must be point");
+    }
+    if (aShape2.ShapeType() != TopAbs_EDGE) {
+      Standard_ConstructionError::Raise("Wrong second argument: must be vector");
+    }
     if (aShape1.IsSame(aShape2)) {
       Standard_ConstructionError::Raise("The end points must be different");
     }