X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOMImpl%2FGEOMImpl_RevolutionDriver.cxx;h=beec64f3c3387041c585ace91401777cc74d91f3;hb=6e638ed22140cb8c1a65e73c43541e44b2aa3bf5;hp=60222bcdf097e609fcfcb76f6bd7bcced7de45cd;hpb=d3dd282390888d7dc091ba2c2ffe7923bd7458e6;p=modules%2Fgeom.git diff --git a/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx b/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx index 60222bcdf..beec64f3c 100644 --- a/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx @@ -1,9 +1,29 @@ - -using namespace std; -#include "GEOMImpl_RevolutionDriver.hxx" -#include "GEOMImpl_IRevolution.hxx" -#include "GEOMImpl_Types.hxx" -#include "GEOM_Function.hxx" +// 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 + +#include +#include +#include +#include #include #include @@ -15,6 +35,8 @@ using namespace std; #include #include +#include +#include #include #include #include @@ -75,6 +97,14 @@ Standard_Integer GEOMImpl_RevolutionDriver::Execute(TFunction_Logbook& log) cons ("End vertices of edge, defining the Revolution Axis, are too close"); } + if (aShapeBase.ShapeType() == TopAbs_VERTEX) { + gp_Lin aL(BRep_Tool::Pnt(V1), gp_Dir(aV)); + Standard_Real d = aL.Distance(BRep_Tool::Pnt(TopoDS::Vertex(aShapeBase))); + if (d < Precision::Confusion()) { + Standard_ConstructionError::Raise("Vertex to be rotated is too close to Revolution Axis"); + } + } + gp_Ax1 anAxis (BRep_Tool::Pnt(V1), aV); BRepPrimAPI_MakeRevol MR (aShapeBase, anAxis, aCI.GetAngle(), Standard_False); if (!MR.IsDone()) MR.Build();