Salome HOME
Porting to Qt4.
[modules/geom.git] / src / GEOMImpl / GEOMImpl_LineDriver.cxx
index b76dd1e5e9654ed49ab59ec6d1a2d1386880c717..a7bf8d433b86970c5addbe27a797b562c6801b8c 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either 
+// version 2.1 of the License.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include <Standard_Stream.hxx>
 
@@ -60,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");
     }
@@ -76,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");
     }