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_MakeTorus_HeaderFile
18 #define _BRepPrimAPI_MakeTorus_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepPrim_Torus.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 tori or portions of tori.
34 //! A MakeTorus object provides a framework for:
35 //! - defining the construction of a torus,
36 //! - implementing the construction algorithm, and
37 //! - consulting the result.
38 class BRepPrimAPI_MakeTorus : public BRepPrimAPI_MakeOneAxis
45 //! Make a torus of radii R1 R2.
46 Standard_EXPORT BRepPrimAPI_MakeTorus(const Standard_Real R1, const Standard_Real R2);
48 //! Make a section of a torus of radii R1 R2.
49 Standard_EXPORT BRepPrimAPI_MakeTorus(const Standard_Real R1, const Standard_Real R2, const Standard_Real angle);
51 //! Make a torus of radii R2, R2 with angles on the
53 Standard_EXPORT BRepPrimAPI_MakeTorus(const Standard_Real R1, const Standard_Real R2, const Standard_Real angle1, const Standard_Real angle2);
55 //! Make a torus of radii R2, R2 with angles on the
57 Standard_EXPORT BRepPrimAPI_MakeTorus(const Standard_Real R1, const Standard_Real R2, const Standard_Real angle1, const Standard_Real angle2, const Standard_Real angle);
59 //! Make a torus of radii R1 R2.
60 Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2);
62 //! Make a section of a torus of radii R1 R2.
63 Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real angle);
65 //! Make a torus of radii R1 R2.
66 Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real angle1, const Standard_Real angle2);
68 //! Make a section of a torus of radii R1 R2.
69 //! For all algorithms The resulting shape is composed of
70 //! - a lateral toroidal face,
71 //! - two conical faces (defined by the equation v = angle1 and
72 //! v = angle2) if the sphere is truncated in the v parametric
73 //! direction (they may be cylindrical faces in some
74 //! particular conditions), and in case of a portion
75 //! of torus, two planar faces to close the shape.(in the planes
76 //! u = 0 and u = angle).
78 //! - The u parameter corresponds to a rotation angle around the Z axis.
79 //! - The circle whose radius is equal to the minor radius,
80 //! located in the plane defined by the X axis and the Z axis,
81 //! centered on the X axis, on its positive side, and positioned
82 //! at a distance from the origin equal to the major radius, is
83 //! the reference circle of the torus. The rotation around an
84 //! axis parallel to the Y axis and passing through the center
85 //! of the reference circle gives the v parameter on the
86 //! reference circle. The X axis gives the origin of the v
87 //! parameter. Near 0, as v increases, the Z coordinate decreases.
88 Standard_EXPORT BRepPrimAPI_MakeTorus(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real angle1, const Standard_Real angle2, const Standard_Real angle);
90 //! Returns the algorithm.
91 Standard_EXPORT Standard_Address OneAxis();
93 //! Returns the algorithm.
94 Standard_EXPORT BRepPrim_Torus& Torus();
109 BRepPrim_Torus myTorus;
120 #endif // _BRepPrimAPI_MakeTorus_HeaderFile