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
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 #ifndef _BRepPrimAPI_MakeCone_HeaderFile
18 #define _BRepPrimAPI_MakeCone_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepPrim_Cone.hxx>
25 #include <BRepPrimAPI_MakeOneAxis.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Address.hxx>
28 class Standard_DomainError;
33 //! Describes functions to build cones or portions of cones.
34 //! A MakeCone object provides a framework for:
35 //! - defining the construction of a cone,
36 //! - implementing the construction algorithm, and
37 //! - consulting the result.
38 class BRepPrimAPI_MakeCone : public BRepPrimAPI_MakeOneAxis
45 //! Make a cone of height H radius R1 in the plane z =
46 //! 0, R2 in the plane Z = H. R1 and R2 may be null.
47 Standard_EXPORT BRepPrimAPI_MakeCone(const Standard_Real R1, const Standard_Real R2, const Standard_Real H);
49 //! Make a cone of height H radius R1 in the plane z =
50 //! 0, R2 in the plane Z = H. R1 and R2 may be null.
51 //! Take a section of <angle>
52 Standard_EXPORT BRepPrimAPI_MakeCone(const Standard_Real R1, const Standard_Real R2, const Standard_Real H, const Standard_Real angle);
54 //! Make a cone of height H radius R1 in the plane z =
55 //! 0, R2 in the plane Z = H. R1 and R2 may be null.
56 Standard_EXPORT BRepPrimAPI_MakeCone(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real H);
58 //! Make a cone of height H radius R1 in the plane z =
59 //! 0, R2 in the plane Z = H. R1 and R2 may be null.
60 //! Take a section of <angle>
61 //! Constructs a cone, or a portion of a cone, of height H,
62 //! and radius R1 in the plane z = 0 and R2 in the plane
63 //! z = H. The result is a sharp cone if R1 or R2 is equal to 0.
64 //! The cone is constructed about the "Z Axis" of either:
65 //! - the global coordinate system, or
66 //! - the local coordinate system Axes.
67 //! It is limited in these coordinate systems as follows:
68 //! - in the v parametric direction (the Z coordinate), by
69 //! the two parameter values 0 and H,
70 //! - and in the u parametric direction (defined by the
71 //! angle of rotation around the Z axis), in the case of a
72 //! portion of a cone, by the two parameter values 0 and
73 //! angle. Angle is given in radians.
74 //! The resulting shape is composed of:
75 //! - a lateral conical face
76 //! - two planar faces in the planes z = 0 and z = H,
77 //! or only one planar face in one of these two planes if a
78 //! radius value is null (in the case of a complete cone,
79 //! these faces are circles), and
80 //! - and in the case of a portion of a cone, two planar
81 //! faces to close the shape. (either two parallelograms or
82 //! two triangles, in the planes u = 0 and u = angle).
84 //! Standard_DomainError if:
85 //! - H is less than or equal to Precision::Confusion(), or
86 //! - the half-angle at the apex of the cone, defined by
87 //! R1, R2 and H, is less than Precision::Confusion()/H, or greater than
88 //! (Pi/2)-Precision::Confusion()/H.f
89 Standard_EXPORT BRepPrimAPI_MakeCone(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real H, const Standard_Real angle);
91 //! Returns the algorithm.
92 Standard_EXPORT Standard_Address OneAxis();
94 //! Returns the algorithm.
95 Standard_EXPORT BRepPrim_Cone& Cone();
110 BRepPrim_Cone myCone;
121 #endif // _BRepPrimAPI_MakeCone_HeaderFile