1 // Created on: 1992-08-26
2 // Created by: Remi GILET
3 // Copyright (c) 1992-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 _gce_MakeCylinder_HeaderFile
18 #define _gce_MakeCylinder_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <gp_Cylinder.hxx>
25 #include <gce_Root.hxx>
26 #include <Standard_Real.hxx>
27 class StdFail_NotDone;
35 //! This class implements the following algorithms used
36 //! to create a Cylinder from gp.
37 //! * Create a Cylinder coaxial to another and passing
39 //! * Create a Cylinder coaxial to another at a distance
41 //! * Create a Cylinder with 3 points.
42 //! * Create a Cylinder by its axis and radius.
43 //! * Create a cylinder by its circular base.
44 class gce_MakeCylinder : public gce_Root
51 //! <A2> is the local cartesian coordinate system of <me>.
52 //! The status is "NegativeRadius" if R < 0.0
53 Standard_EXPORT gce_MakeCylinder(const gp_Ax2& A2, const Standard_Real Radius);
55 //! Makes a Cylinder from gp <TheCylinder> coaxial to another
56 //! Cylinder <Cylinder> and passing through a Pnt <Point>.
57 Standard_EXPORT gce_MakeCylinder(const gp_Cylinder& Cyl, const gp_Pnt& Point);
59 //! Makes a Cylinder from gp <TheCylinder> coaxial to another
60 //! Cylinder <Cylinder> at the distance <Dist> which can
61 //! be greater or lower than zero.
62 //! The radius of the result is the absolute value of the
63 //! radius of <Cyl> plus <Dist>
64 Standard_EXPORT gce_MakeCylinder(const gp_Cylinder& Cyl, const Standard_Real Dist);
66 //! Makes a Cylinder from gp <TheCylinder> with 3 points
68 //! Its axis is <P1P2> and its radius is the distance
69 //! between <P3> and <P1P2>
70 Standard_EXPORT gce_MakeCylinder(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
72 //! Makes a Cylinder by its axis <Axis> and radius <Radius>.
73 Standard_EXPORT gce_MakeCylinder(const gp_Ax1& Axis, const Standard_Real Radius);
75 //! Makes a Cylinder by its circular base.
77 //! If an error occurs (that is, when IsDone returns
78 //! false), the Status function returns:
79 //! - gce_NegativeRadius if:
80 //! - Radius is less than 0.0, or
81 //! - Dist is negative and has an absolute value
82 //! which is greater than the radius of Cyl; or
83 //! - gce_ConfusedPoints if points P1 and P2 are coincident.
84 Standard_EXPORT gce_MakeCylinder(const gp_Circ& Circ);
86 //! Returns the constructed cylinder.
87 //! Exceptions StdFail_NotDone if no cylinder is constructed.
88 Standard_EXPORT const gp_Cylinder& Value() const;
90 Standard_EXPORT const gp_Cylinder& Operator() const;
91 Standard_EXPORT operator gp_Cylinder() const;
106 gp_Cylinder TheCylinder;
117 #endif // _gce_MakeCylinder_HeaderFile