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.
18 #include <BRepBuilderAPI.hxx>
19 #include <BRepPrim_Sphere.hxx>
20 #include <BRepPrimAPI_MakeSphere.hxx>
25 #include <Standard_DomainError.hxx>
27 //=======================================================================
28 //function : BRepPrimAPI_MakeSphere
30 //=======================================================================
32 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R) :
38 //=======================================================================
39 //function : BRepPrimAPI_MakeSphere
41 //=======================================================================
43 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R,
44 const Standard_Real angle) :
45 mySphere(gp_Ax2(gp::Origin(), (angle<0.?-1:1)*gp::DZ(), gp::DX()),
48 mySphere.Angle(Abs(angle));
52 //=======================================================================
53 //function : BRepPrimAPI_MakeSphere
55 //=======================================================================
57 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R,
58 const Standard_Real angle1,
59 const Standard_Real angle2) :
62 mySphere.VMin(angle1);
63 mySphere.VMax(angle2);
67 //=======================================================================
68 //function : BRepPrimAPI_MakeSphere
70 //=======================================================================
72 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R,
73 const Standard_Real angle1,
74 const Standard_Real angle2,
75 const Standard_Real angle3) :
78 mySphere.VMin(angle1);
79 mySphere.VMax(angle2);
80 mySphere.Angle(angle3);
83 //=======================================================================
84 //function : BRepPrimAPI_MakeSphere
86 //=======================================================================
88 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center,
89 const Standard_Real R) :
90 mySphere(gp_Ax2(Center, gp_Dir(0,0,1), gp_Dir(1,0,0)),
96 //=======================================================================
97 //function : BRepPrimAPI_MakeSphere
99 //=======================================================================
101 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center,
102 const Standard_Real R,
103 const Standard_Real angle) :
104 mySphere(gp_Ax2(Center, gp_Dir(0,0,1), gp_Dir(1,0,0)),
107 mySphere.Angle(angle);
111 //=======================================================================
112 //function : BRepPrimAPI_MakeSphere
114 //=======================================================================
116 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center,
117 const Standard_Real R,
118 const Standard_Real angle1,
119 const Standard_Real angle2) :
120 mySphere(gp_Ax2(Center, gp_Dir(0,0,1), gp_Dir(1,0,0)),
123 mySphere.VMin(angle1);
124 mySphere.VMax(angle2);
128 //=======================================================================
129 //function : BRepPrimAPI_MakeSphere
131 //=======================================================================
133 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center,
134 const Standard_Real R,
135 const Standard_Real angle1,
136 const Standard_Real angle2,
137 const Standard_Real angle3) :
138 mySphere(gp_Ax2(Center, gp_Dir(0,0,1), gp_Dir(1,0,0)),
141 mySphere.VMin(angle1);
142 mySphere.VMax(angle2);
143 mySphere.Angle(angle3);
147 //=======================================================================
148 //function : BRepPrimAPI_MakeSphere
150 //=======================================================================
152 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Ax2& Axis,
153 const Standard_Real R) :
159 //=======================================================================
160 //function : BRepPrimAPI_MakeSphere
162 //=======================================================================
164 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Ax2& Axis,
165 const Standard_Real R,
166 const Standard_Real angle) :
169 mySphere.Angle(angle);
173 //=======================================================================
174 //function : BRepPrimAPI_MakeSphere
176 //=======================================================================
178 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Ax2& Axis,
179 const Standard_Real R,
180 const Standard_Real angle1,
181 const Standard_Real angle2) :
184 mySphere.VMin(angle1);
185 mySphere.VMax(angle2);
189 //=======================================================================
190 //function : BRepPrimAPI_MakeSphere
192 //=======================================================================
194 BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Ax2& Axis,
195 const Standard_Real R,
196 const Standard_Real angle1,
197 const Standard_Real angle2,
198 const Standard_Real angle3) :
201 mySphere.VMin(angle1);
202 mySphere.VMax(angle2);
203 mySphere.Angle(angle3);
208 //=======================================================================
211 //=======================================================================
213 Standard_Address BRepPrimAPI_MakeSphere::OneAxis()
219 //=======================================================================
222 //=======================================================================
224 BRepPrim_Sphere& BRepPrimAPI_MakeSphere::Sphere()