Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/gce_MakeCylinder.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 1992-08-26
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-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 _gce_MakeCylinder_HeaderFile
0018 #define _gce_MakeCylinder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Cylinder.hxx>
0025 #include <gce_Root.hxx>
0026 class gp_Ax2;
0027 class gp_Pnt;
0028 class gp_Ax1;
0029 class gp_Circ;
0030 
0031 //! This class implements construction algorithms for `gp_Cylinder`.
0032 //! Supported constructions include:
0033 //! - cylinder from axis placement and radius;
0034 //! - cylinder coaxial to another, through point or at signed offset;
0035 //! - cylinder from three points;
0036 //! - cylinder from axis and radius;
0037 //! - cylinder from circular base.
0038 class gce_MakeCylinder : public gce_Root
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   //! Creates a cylinder from axis placement and radius.
0044   //! @note Construction fails with `gce_NegativeRadius` if `Radius` is negative.
0045   //! @param[in] A2 local coordinate system
0046   //! @param[in] Radius radius value
0047   Standard_EXPORT gce_MakeCylinder(const gp_Ax2& A2, const double Radius);
0048 
0049   //! Creates a cylinder coaxial to input cylinder and passing through a point.
0050   //! @param[in] Cyl source cylinder
0051   //! @param[in] Point reference point
0052   Standard_EXPORT gce_MakeCylinder(const gp_Cylinder& Cyl, const gp_Pnt& Point);
0053 
0054   //! Creates a cylinder coaxial to input cylinder at signed distance.
0055   //! @note Construction fails with `gce_NegativeRadius` if resulting radius is negative.
0056   //! @param[in] Cyl source cylinder
0057   //! @param[in] Dist signed distance
0058   Standard_EXPORT gce_MakeCylinder(const gp_Cylinder& Cyl, const double Dist);
0059 
0060   //! Creates a cylinder from three points.
0061   //! @note Axis is defined by points `P1` and `P2`.
0062   //! @note Radius is the distance from `P3` to that axis.
0063   //! @param[in] P1 first point
0064   //! @param[in] P2 second point
0065   //! @param[in] P3 third point
0066   Standard_EXPORT gce_MakeCylinder(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0067 
0068   //! Makes a Cylinder by its axis <Axis> and radius <Radius>.
0069   //! @param[in] Axis axis definition
0070   //! @param[in] Radius radius value
0071   Standard_EXPORT gce_MakeCylinder(const gp_Ax1& Axis, const double Radius);
0072 
0073   //! Creates a cylinder from circular base.
0074   //! @note The resulting cylinder axis equals the circle axis.
0075   //! @note This constructor succeeds for any valid `Circ`.
0076   //! @param[in] Circ source circle
0077   Standard_EXPORT gce_MakeCylinder(const gp_Circ& Circ);
0078 
0079   //! Returns the constructed cylinder.
0080   //! Exceptions StdFail_NotDone if no cylinder is constructed.
0081   //! @return resulting cylinder
0082   Standard_EXPORT const gp_Cylinder& Value() const;
0083 
0084   //! Alias for Value() returning a copy.
0085   //! @return resulting object
0086   gp_Cylinder Operator() const { return Value(); }
0087 
0088   //! Conversion operator returning the constructed object.
0089   //! @return resulting object
0090   operator gp_Cylinder() const { return Operator(); }
0091 
0092 private:
0093   gp_Cylinder TheCylinder;
0094 };
0095 
0096 #endif // _gce_MakeCylinder_HeaderFile