1 // Created on: 1993-07-23
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <BRepPrimAPI_MakeCylinder.ixx>
18 #include <BRepBuilderAPI.hxx>
26 static gp_Ax2 CylinderComputeAxes() {
27 static Standard_Integer firsttime=1;
28 static Standard_Integer modif=0;
29 static Standard_Real cosa=cos(0.1);
30 static Standard_Real sina=sin(0.1);
31 static Standard_Real ux=1.0;
32 static Standard_Real uy=0.0;
35 modif = getenv("PRIM_CYLINDER") != NULL;
39 Standard_Real nux = cosa*ux+sina*uy;
40 Standard_Real nuy =-sina*ux+cosa*uy;
42 return(gp_Ax2(gp::Origin(),gp::DZ(),gp_Dir(ux,uy,0.0)));
52 //=======================================================================
53 //function : BRepPrimAPI_MakeCylinder
55 //=======================================================================
57 BRepPrimAPI_MakeCylinder::BRepPrimAPI_MakeCylinder(const Standard_Real R,
58 const Standard_Real H) :
59 myCylinder(CylinderComputeAxes(), R , H)
64 //=======================================================================
65 //function : BRepPrimAPI_MakeCylinder
67 //=======================================================================
69 BRepPrimAPI_MakeCylinder::BRepPrimAPI_MakeCylinder(const Standard_Real R,
70 const Standard_Real H,
71 const Standard_Real Angle) :
74 myCylinder.Angle(Angle);
78 //=======================================================================
79 //function : BRepPrimAPI_MakeCylinder
81 //=======================================================================
83 BRepPrimAPI_MakeCylinder::BRepPrimAPI_MakeCylinder(const gp_Ax2& Axes,
84 const Standard_Real R,
85 const Standard_Real H) :
86 myCylinder( Axes, R , H)
91 //=======================================================================
92 //function : BRepPrimAPI_MakeCylinder
94 //=======================================================================
96 BRepPrimAPI_MakeCylinder::BRepPrimAPI_MakeCylinder(const gp_Ax2& Axes,
97 const Standard_Real R,
98 const Standard_Real H,
99 const Standard_Real Angle) :
100 myCylinder( Axes, R , H)
102 myCylinder.Angle(Angle);
106 //=======================================================================
109 //=======================================================================
111 Standard_Address BRepPrimAPI_MakeCylinder::OneAxis()
117 //=======================================================================
118 //function : Cylinder
120 //=======================================================================
122 BRepPrim_Cylinder& BRepPrimAPI_MakeCylinder::Cylinder()