-
-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 <Standard_Stream.hxx>
+
+#include <GEOMImpl_RevolutionDriver.hxx>
+#include <GEOMImpl_IRevolution.hxx>
+#include <GEOMImpl_Types.hxx>
+#include <GEOM_Function.hxx>
#include <BRepPrimAPI_MakeRevol.hxx>
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <gp_Pnt.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Dir.hxx>
#include <Precision.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_TypeMismatch.hxx>
("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();