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_MakeTorus_HeaderFile
0018 #define _BRepPrimAPI_MakeTorus_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <BRepPrim_Torus.hxx>
0025 #include <BRepPrimAPI_MakeOneAxis.hxx>
0026 class gp_Ax2;
0027 
0028 //! Describes functions to build tori or portions of tori.
0029 //! A MakeTorus object provides a framework for:
0030 //! -   defining the construction of a torus,
0031 //! -   implementing the construction algorithm, and
0032 //! -   consulting the result.
0033 class BRepPrimAPI_MakeTorus : public BRepPrimAPI_MakeOneAxis
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Make a torus.
0039   //! @param[in] R1  distance from the center of the pipe to the center of the torus
0040   //! @param[in] R2  radius of the pipe
0041   Standard_EXPORT BRepPrimAPI_MakeTorus(const double R1, const double R2);
0042 
0043   //! Make a section of a torus.
0044   //! @param[in] R1     distance from the center of the pipe to the center of the torus
0045   //! @param[in] R2     radius of the pipe
0046   //! @param[in] angle  angle to create a torus pipe segment
0047   Standard_EXPORT BRepPrimAPI_MakeTorus(const double R1, const double R2, const double angle);
0048 
0049   //! Make  a torus with angles on the small circle.
0050   //! @param[in] R1      distance from the center of the pipe to the center of the torus
0051   //! @param[in] R2      radius of the pipe
0052   //! @param[in] angle1  first  angle to create a torus ring segment
0053   //! @param[in] angle2  second angle to create a torus ring segment
0054   Standard_EXPORT BRepPrimAPI_MakeTorus(const double R1,
0055                                         const double R2,
0056                                         const double angle1,
0057                                         const double angle2);
0058 
0059   //! Make  a torus with angles on the small circle.
0060   //! @param[in] R1      distance from the center of the pipe to the center of the torus
0061   //! @param[in] R2      radius of the pipe
0062   //! @param[in] angle1  first  angle to create a torus ring segment
0063   //! @param[in] angle2  second angle to create a torus ring segment
0064   //! @param[in] angle   angle to create a torus pipe segment
0065   Standard_EXPORT BRepPrimAPI_MakeTorus(const double R1,
0066                                         const double R2,
0067                                         const double angle1,
0068                                         const double angle2,
0069                                         const double angle);
0070 
0071   //! Make a torus.
0072   //! @param[in] Axes  coordinate system for the construction of the sphere
0073   //! @param[in] R1    distance from the center of the pipe to the center of the torus
0074   //! @param[in] R2    radius of the pipe
0075   Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes, const double R1, const double R2);
0076 
0077   //! Make a section of a torus.
0078   //! @param[in] Axes   coordinate system for the construction of the sphere
0079   //! @param[in] R1     distance from the center of the pipe to the center of the torus
0080   //! @param[in] R2     radius of the pipe
0081   //! @param[in] angle  angle to create a torus pipe segment
0082   Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes,
0083                                         const double  R1,
0084                                         const double  R2,
0085                                         const double  angle);
0086 
0087   //! Make a torus.
0088   //! @param[in] Axes    coordinate system for the construction of the sphere
0089   //! @param[in] R1      distance from the center of the pipe to the center of the torus
0090   //! @param[in] R2      radius of the pipe
0091   //! @param[in] angle1  first  angle to create a torus ring segment
0092   //! @param[in] angle2  second angle to create a torus ring segment
0093   Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes,
0094                                         const double  R1,
0095                                         const double  R2,
0096                                         const double  angle1,
0097                                         const double  angle2);
0098 
0099   //! Make a section of a torus of radii R1 R2.
0100   //! For all algorithms The resulting shape is composed of
0101   //! -      a lateral toroidal face,
0102   //! -      two conical faces (defined by the equation v = angle1 and
0103   //! v = angle2) if the sphere is truncated in the v parametric
0104   //! direction (they may be cylindrical faces in some
0105   //! particular conditions), and in case of a portion
0106   //! of torus, two planar faces to close the shape.(in the planes
0107   //! u = 0 and u = angle).
0108   //! Notes:
0109   //! -      The u parameter corresponds to a rotation angle around the Z axis.
0110   //! -      The circle whose radius is equal to the minor radius,
0111   //! located in the plane defined by the X axis and the Z axis,
0112   //! centered on the X axis, on its positive side, and positioned
0113   //! at a distance from the origin equal to the major radius, is
0114   //! the reference circle of the torus. The rotation around an
0115   //! axis parallel to the Y axis and passing through the center
0116   //! of the reference circle gives the v parameter on the
0117   //! reference circle. The X axis gives the origin of the v
0118   //! parameter. Near 0, as v increases, the Z coordinate increases
0119   //! (following the standard trigonometric convention: Z = r*sin(v)).
0120   Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes,
0121                                         const double  R1,
0122                                         const double  R2,
0123                                         const double  angle1,
0124                                         const double  angle2,
0125                                         const double  angle);
0126 
0127   //! Returns the algorithm.
0128   Standard_EXPORT void* OneAxis() override;
0129 
0130   //! Returns the algorithm.
0131   Standard_EXPORT BRepPrim_Torus& Torus();
0132 
0133 private:
0134   BRepPrim_Torus myTorus;
0135 };
0136 
0137 #endif // _BRepPrimAPI_MakeTorus_HeaderFile