1 // Created on: 1993-07-22
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16 
17 #ifndef _BRepPrimAPI_MakeSphere_HeaderFile
18 #define _BRepPrimAPI_MakeSphere_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <BRepPrim_Sphere.hxx>
25 #include <BRepPrimAPI_MakeOneAxis.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Address.hxx>
28 class Standard_DomainError;
29 class gp_Pnt;
30 class gp_Ax2;
31 class BRepPrim_Sphere;
32 
33 
34 //! Describes functions to build spheres or portions of spheres.
35 //! A MakeSphere object provides a framework for:
36 //! -   defining the construction of a sphere,
37 //! -   implementing the construction algorithm, and
38 //! -   consulting the result.
39 class BRepPrimAPI_MakeSphere  : public BRepPrimAPI_MakeOneAxis
40 {
41 public:
42 
43   DEFINE_STANDARD_ALLOC
44 
45 
46   //! Make a sphere of radius R.
47   Standard_EXPORT BRepPrimAPI_MakeSphere(const Standard_Real R);
48 
49   //! Make a sphere of radius R.
50   Standard_EXPORT BRepPrimAPI_MakeSphere(const Standard_Real R, const Standard_Real angle);
51 
52   //! Make a sphere of radius R.
53   Standard_EXPORT BRepPrimAPI_MakeSphere(const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2);
54 
55   //! Make a sphere of radius R.
56   Standard_EXPORT BRepPrimAPI_MakeSphere(const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2, const Standard_Real angle3);
57 
58   //! Make a sphere of radius R.
59   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R);
60 
61   //! Make a sphere of radius R.
62   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R, const Standard_Real angle);
63 
64   //! Make a sphere of radius R.
65   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2);
66 
67   //! Make a sphere of radius R.
68   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2, const Standard_Real angle3);
69 
70   //! Make a sphere of radius R.
71   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Ax2& Axis, const Standard_Real R);
72 
73   //! Make a sphere of radius R.
74   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Ax2& Axis, const Standard_Real R, const Standard_Real angle);
75 
76   //! Make a sphere of radius R.
77   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Ax2& Axis, const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2);
78 
79   //! Make a sphere of radius R.
80   //! For all algorithms The resulting shape is composed of
81   //! -   a lateral spherical face,
82   //! -   two planar faces parallel to the plane z = 0 if the
83   //! sphere is truncated in the v parametric direction, or
84   //! only one planar face if angle1 is equal to -p/2 or if
85   //! angle2 is equal to p/2 (these faces are circles in
86   //! case of a complete truncated sphere),
87   //! -   and in case of a portion of sphere, two planar faces
88   //! to shut the shape.(in the planes u = 0 and u = angle).
89   Standard_EXPORT BRepPrimAPI_MakeSphere(const gp_Ax2& Axis, const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2, const Standard_Real angle3);
90 
91   //! Returns the algorithm.
92   Standard_EXPORT Standard_Address OneAxis();
93 
94   //! Returns the algorithm.
95   Standard_EXPORT BRepPrim_Sphere& Sphere();
96 
97 
98 
99 
100 protected:
101 
102 
103 
104 
105 
106 private:
107 
108 
109 
110   BRepPrim_Sphere mySphere;
111 
112 
113 };
114 
115 
116 
117 
118 
119 
120 
121 #endif // _BRepPrimAPI_MakeSphere_HeaderFile
122