42cf5bc1 |
1 | // Created on: 1993-07-21 |
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_MakeCone_HeaderFile |
18 | #define _BRepPrimAPI_MakeCone_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRepPrim_Cone.hxx> |
25 | #include <BRepPrimAPI_MakeOneAxis.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <Standard_Address.hxx> |
42cf5bc1 |
28 | class gp_Ax2; |
42cf5bc1 |
29 | |
30 | |
31 | //! Describes functions to build cones or portions of cones. |
32 | //! A MakeCone object provides a framework for: |
33 | //! - defining the construction of a cone, |
34 | //! - implementing the construction algorithm, and |
35 | //! - consulting the result. |
36 | class BRepPrimAPI_MakeCone : public BRepPrimAPI_MakeOneAxis |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
113bda70 |
42 | |
43 | //! Make a cone. |
44 | //! @param R1 [in] cone bottom radius, may be null (z = 0) |
45 | //! @param R2 [in] cone top radius, may be null (z = H) |
46 | //! @param H [in] cone height |
42cf5bc1 |
47 | Standard_EXPORT BRepPrimAPI_MakeCone(const Standard_Real R1, const Standard_Real R2, const Standard_Real H); |
113bda70 |
48 | |
49 | //! Make a cone. |
50 | //! @param R1 [in] cone bottom radius, may be null (z = 0) |
51 | //! @param R2 [in] cone top radius, may be null (z = H) |
52 | //! @param H [in] cone height |
53 | //! @param angle [in] angle to create a part cone |
42cf5bc1 |
54 | Standard_EXPORT BRepPrimAPI_MakeCone(const Standard_Real R1, const Standard_Real R2, const Standard_Real H, const Standard_Real angle); |
113bda70 |
55 | |
56 | //! Make a cone. |
57 | //! @param axes [in] coordinate system for the construction of the cone |
58 | //! @param R1 [in] cone bottom radius, may be null (z = 0) |
59 | //! @param R2 [in] cone top radius, may be null (z = H) |
60 | //! @param H [in] cone height |
42cf5bc1 |
61 | Standard_EXPORT BRepPrimAPI_MakeCone(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real H); |
62 | |
63 | //! Make a cone of height H radius R1 in the plane z = |
64 | //! 0, R2 in the plane Z = H. R1 and R2 may be null. |
65 | //! Take a section of <angle> |
66 | //! Constructs a cone, or a portion of a cone, of height H, |
67 | //! and radius R1 in the plane z = 0 and R2 in the plane |
68 | //! z = H. The result is a sharp cone if R1 or R2 is equal to 0. |
69 | //! The cone is constructed about the "Z Axis" of either: |
70 | //! - the global coordinate system, or |
71 | //! - the local coordinate system Axes. |
72 | //! It is limited in these coordinate systems as follows: |
73 | //! - in the v parametric direction (the Z coordinate), by |
74 | //! the two parameter values 0 and H, |
75 | //! - and in the u parametric direction (defined by the |
76 | //! angle of rotation around the Z axis), in the case of a |
77 | //! portion of a cone, by the two parameter values 0 and |
78 | //! angle. Angle is given in radians. |
79 | //! The resulting shape is composed of: |
80 | //! - a lateral conical face |
81 | //! - two planar faces in the planes z = 0 and z = H, |
82 | //! or only one planar face in one of these two planes if a |
83 | //! radius value is null (in the case of a complete cone, |
84 | //! these faces are circles), and |
85 | //! - and in the case of a portion of a cone, two planar |
86 | //! faces to close the shape. (either two parallelograms or |
87 | //! two triangles, in the planes u = 0 and u = angle). |
88 | //! Exceptions |
89 | //! Standard_DomainError if: |
90 | //! - H is less than or equal to Precision::Confusion(), or |
91 | //! - the half-angle at the apex of the cone, defined by |
92 | //! R1, R2 and H, is less than Precision::Confusion()/H, or greater than |
93 | //! (Pi/2)-Precision::Confusion()/H.f |
94 | Standard_EXPORT BRepPrimAPI_MakeCone(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real H, const Standard_Real angle); |
95 | |
96 | //! Returns the algorithm. |
97 | Standard_EXPORT Standard_Address OneAxis(); |
98 | |
99 | //! Returns the algorithm. |
100 | Standard_EXPORT BRepPrim_Cone& Cone(); |
101 | |
102 | |
103 | |
104 | |
105 | protected: |
106 | |
107 | |
108 | |
109 | |
110 | |
111 | private: |
112 | |
113 | |
114 | |
115 | BRepPrim_Cone myCone; |
116 | |
117 | |
118 | }; |
119 | |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | |
126 | #endif // _BRepPrimAPI_MakeCone_HeaderFile |