Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:32

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 
0032 //! This class implements the following algorithms used
0033 //! to create a Cylinder from gp.
0034 //! * Create a Cylinder coaxial to another and passing
0035 //! through a point.
0036 //! * Create a Cylinder coaxial to another at a distance
0037 //! <Dist>.
0038 //! * Create a Cylinder with 3 points.
0039 //! * Create a Cylinder by its axis and radius.
0040 //! * Create a cylinder by its circular base.
0041 class gce_MakeCylinder  : public gce_Root
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   //! <A2> is the local cartesian coordinate system of <me>.
0049   //! The status is "NegativeRadius" if R < 0.0
0050   Standard_EXPORT gce_MakeCylinder(const gp_Ax2& A2, const Standard_Real Radius);
0051   
0052   //! Makes a Cylinder from gp <TheCylinder> coaxial to another
0053   //! Cylinder <Cylinder> and passing through a Pnt <Point>.
0054   Standard_EXPORT gce_MakeCylinder(const gp_Cylinder& Cyl, const gp_Pnt& Point);
0055   
0056   //! Makes a Cylinder from gp <TheCylinder> coaxial to another
0057   //! Cylinder <Cylinder> at the distance <Dist> which can
0058   //! be greater or lower than zero.
0059   //! The radius of the result is the absolute value of the
0060   //! radius of <Cyl> plus <Dist>
0061   Standard_EXPORT gce_MakeCylinder(const gp_Cylinder& Cyl, const Standard_Real Dist);
0062   
0063   //! Makes a Cylinder from gp <TheCylinder> with 3 points
0064   //! <P1>,<P2>,<P3>.
0065   //! Its axis is <P1P2> and its radius is the distance
0066   //! between <P3> and <P1P2>
0067   Standard_EXPORT gce_MakeCylinder(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0068   
0069   //! Makes a Cylinder by its axis <Axis> and radius <Radius>.
0070   Standard_EXPORT gce_MakeCylinder(const gp_Ax1& Axis, const Standard_Real Radius);
0071   
0072   //! Makes a Cylinder by its circular base.
0073   //! Warning
0074   //! If an error occurs (that is, when IsDone returns
0075   //! false), the Status function returns:
0076   //! -   gce_NegativeRadius if:
0077   //! -   Radius is less than 0.0, or
0078   //! -   Dist is negative and has an absolute value
0079   //! which is greater than the radius of Cyl; or
0080   //! -   gce_ConfusedPoints if points P1 and P2 are coincident.
0081   Standard_EXPORT gce_MakeCylinder(const gp_Circ& Circ);
0082   
0083   //! Returns the constructed cylinder.
0084   //! Exceptions StdFail_NotDone if no cylinder is constructed.
0085   Standard_EXPORT const gp_Cylinder& Value() const;
0086   
0087   Standard_EXPORT const gp_Cylinder& Operator() const;
0088 Standard_EXPORT operator gp_Cylinder() const;
0089 
0090 
0091 
0092 
0093 protected:
0094 
0095 
0096 
0097 
0098 
0099 private:
0100 
0101 
0102 
0103   gp_Cylinder TheCylinder;
0104 
0105 
0106 };
0107 
0108 
0109 
0110 
0111 
0112 
0113 
0114 #endif // _gce_MakeCylinder_HeaderFile