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_MakeCylinder_HeaderFile |
18 | #define _BRepPrimAPI_MakeCylinder_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRepPrim_Cylinder.hxx> |
25 | #include <BRepPrimAPI_MakeOneAxis.hxx> |
26 | #include <Standard_Real.hxx> |
27 | #include <Standard_Address.hxx> |
28 | class Standard_DomainError; |
29 | class gp_Ax2; |
30 | class BRepPrim_Cylinder; |
31 | |
32 | |
33 | //! Describes functions to build cylinders or portions of cylinders. |
34 | //! A MakeCylinder object provides a framework for: |
35 | //! - defining the construction of a cylinder, |
36 | //! - implementing the construction algorithm, and |
37 | //! - consulting the result. |
38 | class BRepPrimAPI_MakeCylinder : public BRepPrimAPI_MakeOneAxis |
39 | { |
40 | public: |
41 | |
42 | DEFINE_STANDARD_ALLOC |
43 | |
113bda70 |
44 | //! Make a cylinder. |
45 | //! @param R [in] cylinder radius |
46 | //! @param H [in] cylinder height |
42cf5bc1 |
47 | Standard_EXPORT BRepPrimAPI_MakeCylinder(const Standard_Real R, const Standard_Real H); |
113bda70 |
48 | |
49 | //! Make a cylinder (part cylinder). |
50 | //! @param R [in] cylinder radius |
51 | //! @param H [in] cylinder height |
52 | //! @param Angle [in] defines the missing portion of the cylinder |
42cf5bc1 |
53 | Standard_EXPORT BRepPrimAPI_MakeCylinder(const Standard_Real R, const Standard_Real H, const Standard_Real Angle); |
113bda70 |
54 | |
42cf5bc1 |
55 | //! Make a cylinder of radius R and length H. |
113bda70 |
56 | //! @param Axes [in] coordinate system for the construction of the cylinder |
57 | //! @param R [in] cylinder radius |
58 | //! @param H [in] cylinder height |
42cf5bc1 |
59 | Standard_EXPORT BRepPrimAPI_MakeCylinder(const gp_Ax2& Axes, const Standard_Real R, const Standard_Real H); |
113bda70 |
60 | |
42cf5bc1 |
61 | //! Make a cylinder of radius R and length H with |
62 | //! angle H. |
63 | //! Constructs |
64 | //! - a cylinder of radius R and height H, or |
65 | //! - a portion of cylinder of radius R and height H, and of |
66 | //! the angle Angle defining the missing portion of the cylinder. |
67 | //! The cylinder is constructed about the "Z Axis" of either: |
68 | //! - the global coordinate system, or |
69 | //! - the local coordinate system Axes. |
70 | //! It is limited in this coordinate system as follows: |
71 | //! - in the v parametric direction (the Z axis), by the two |
72 | //! parameter values 0 and H, |
73 | //! - and in the u parametric direction (the rotation angle |
74 | //! around the Z Axis), in the case of a portion of a |
75 | //! cylinder, by the two parameter values 0 and Angle. |
76 | //! Angle is given in radians. |
77 | //! The resulting shape is composed of: |
78 | //! - a lateral cylindrical face, |
79 | //! - two planar faces in the planes z = 0 and z = H |
80 | //! (in the case of a complete cylinder, these faces are circles), and |
81 | //! - in case of a portion of a cylinder, two additional |
82 | //! planar faces to close the shape.(two rectangles in the |
83 | //! planes u = 0 and u = Angle). |
84 | //! Exceptions Standard_DomainError if: |
85 | //! - R is less than or equal to Precision::Confusion(), or |
86 | //! - H is less than or equal to Precision::Confusion(). |
87 | Standard_EXPORT BRepPrimAPI_MakeCylinder(const gp_Ax2& Axes, const Standard_Real R, const Standard_Real H, const Standard_Real Angle); |
88 | |
89 | //! Returns the algorithm. |
90 | Standard_EXPORT Standard_Address OneAxis(); |
91 | |
92 | //! Returns the algorithm. |
93 | Standard_EXPORT BRepPrim_Cylinder& Cylinder(); |
94 | |
95 | |
96 | |
97 | |
98 | protected: |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | private: |
105 | |
106 | |
107 | |
108 | BRepPrim_Cylinder myCylinder; |
109 | |
110 | |
111 | }; |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | #endif // _BRepPrimAPI_MakeCylinder_HeaderFile |