-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 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.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <GEOMImpl_ITransformOperations.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
#include <ShapeFix_Shape.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
Handle(GEOM_Function) aVector = TI.GetVector();
gp_Vec Vec = gp::DX();
if (!aVector.IsNull()) {
- TopoDS_Shape aV = aVector->GetValue();
- if (aV.IsNull() || aV.ShapeType() != TopAbs_EDGE) return 0;
- TopoDS_Edge anEdge = TopoDS::Edge(aV);
- Vec = gp_Vec(BRep_Tool::Pnt(TopExp::FirstVertex(anEdge)), BRep_Tool::Pnt(TopExp::LastVertex(anEdge)));
+ Vec = GEOMUtils::GetVector( aVector->GetValue(), Standard_False );
Vec.Normalize();
}
gp_Vec Vec2 = gp::DY();
if (!aVector.IsNull()) {
- TopoDS_Shape aV = aVector->GetValue();
- if (aV.IsNull() || aV.ShapeType() != TopAbs_EDGE) return 0;
- TopoDS_Edge anEdge = TopoDS::Edge(aV);
- Vec1 = gp_Vec(BRep_Tool::Pnt(TopExp::FirstVertex(anEdge)), BRep_Tool::Pnt(TopExp::LastVertex(anEdge)));
+ Vec1 = GEOMUtils::GetVector( aVector->GetValue(), Standard_False );
Vec1.Normalize();
}
if (!aVector2.IsNull()) {
- TopoDS_Shape aV = aVector2->GetValue();
- if (aV.IsNull() || aV.ShapeType() != TopAbs_EDGE) return 0;
- TopoDS_Edge anEdge = TopoDS::Edge(aV);
- Vec2 = gp_Vec(BRep_Tool::Pnt(TopExp::FirstVertex(anEdge)), BRep_Tool::Pnt(TopExp::LastVertex(anEdge)));
+ Vec2 = GEOMUtils::GetVector( aVector2->GetValue(), Standard_False );
Vec2.Normalize();
}