Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:19:55

0001 // Created on: 1993-07-21
0002 // Created by: Remi LEQUETTE
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _BRepPrimAPI_MakeCone_HeaderFile
0018 #define _BRepPrimAPI_MakeCone_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepPrim_Cone.hxx>
0025 #include <BRepPrimAPI_MakeOneAxis.hxx>
0026 class gp_Ax2;
0027 
0028 //! Describes functions to build cones or portions of cones.
0029 //! A MakeCone object provides a framework for:
0030 //! -   defining the construction of a cone,
0031 //! -   implementing the construction algorithm, and
0032 //! -   consulting the result.
0033 class BRepPrimAPI_MakeCone : public BRepPrimAPI_MakeOneAxis
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Make a cone.
0039   //! @param[in] R1  cone bottom radius, may be null (z = 0)
0040   //! @param[in] R2  cone top radius, may be null (z = H)
0041   //! @param[in] H   cone height
0042   Standard_EXPORT BRepPrimAPI_MakeCone(const double R1, const double R2, const double H);
0043 
0044   //! Make a cone.
0045   //! @param[in] R1     cone bottom radius, may be null (z = 0)
0046   //! @param[in] R2     cone top radius, may be null (z = H)
0047   //! @param[in] H      cone height
0048   //! @param[in] angle  angle to create a part cone
0049   Standard_EXPORT BRepPrimAPI_MakeCone(const double R1,
0050                                        const double R2,
0051                                        const double H,
0052                                        const double angle);
0053 
0054   //! Make a cone.
0055   //! @param[in] axes  coordinate system for the construction of the cone
0056   //! @param[in] R1    cone bottom radius, may be null (z = 0)
0057   //! @param[in] R2    cone top radius, may be null (z = H)
0058   //! @param[in] H     cone height
0059   Standard_EXPORT BRepPrimAPI_MakeCone(const gp_Ax2& Axes,
0060                                        const double  R1,
0061                                        const double  R2,
0062                                        const double  H);
0063 
0064   //! Make a cone of height H radius R1 in the plane z =
0065   //! 0, R2 in the plane Z = H. R1 and R2 may be null.
0066   //! Take a section of <angle>
0067   //! Constructs a cone, or a portion of a cone, of height H,
0068   //! and radius R1 in the plane z = 0 and R2 in the plane
0069   //! z = H. The result is a sharp cone if R1 or R2 is equal to 0.
0070   //! The cone is constructed about the "Z Axis" of either:
0071   //! -   the global coordinate system, or
0072   //! -   the local coordinate system Axes.
0073   //! It is limited in these coordinate systems as follows:
0074   //! -   in the v parametric direction (the Z coordinate), by
0075   //! the two parameter values 0 and H,
0076   //! -   and in the u parametric direction (defined by the
0077   //! angle of rotation around the Z axis), in the case of a
0078   //! portion of a cone, by the two parameter values 0 and
0079   //! angle. Angle is given in radians.
0080   //! The resulting shape is composed of:
0081   //! -   a lateral conical face
0082   //! -   two planar faces in the planes z = 0 and z = H,
0083   //! or only one planar face in one of these two planes if a
0084   //! radius value is null (in the case of a complete cone,
0085   //! these faces are circles), and
0086   //! -   and in the case of a portion of a cone, two planar
0087   //! faces to close the shape. (either two parallelograms or
0088   //! two triangles, in the planes u = 0 and u = angle).
0089   //! Exceptions
0090   //! Standard_DomainError if:
0091   //! -   H is less than or equal to Precision::Confusion(), or
0092   //! -   the half-angle at the apex of the cone, defined by
0093   //! R1, R2 and H, is less than Precision::Confusion()/H, or greater than
0094   //! (Pi/2)-Precision::Confusion()/H.f
0095   Standard_EXPORT BRepPrimAPI_MakeCone(const gp_Ax2& Axes,
0096                                        const double  R1,
0097                                        const double  R2,
0098                                        const double  H,
0099                                        const double  angle);
0100 
0101   //! Returns the algorithm.
0102   Standard_EXPORT void* OneAxis() override;
0103 
0104   //! Returns the algorithm.
0105   Standard_EXPORT BRepPrim_Cone& Cone();
0106 
0107 private:
0108   BRepPrim_Cone myCone;
0109 };
0110 
0111 #endif // _BRepPrimAPI_MakeCone_HeaderFile