Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-09-28
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 _GC_MakeCylindricalSurface_HeaderFile
0018 #define _GC_MakeCylindricalSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GC_Root.hxx>
0025 #include <Geom_CylindricalSurface.hxx>
0026 
0027 class gp_Ax2;
0028 class gp_Cylinder;
0029 class gp_Pnt;
0030 class gp_Ax1;
0031 class gp_Circ;
0032 
0033 
0034 //! This class implements the following algorithms used
0035 //! to create a CylindricalSurface from Geom.
0036 //! * Create a CylindricalSurface parallel to another and
0037 //! passing through a point.
0038 //! * Create a CylindricalSurface parallel to another at a
0039 //! distance
0040 //! <Dist>.
0041 //! * Create a CylindricalSurface passing through 3 points.
0042 //! * Create a CylindricalSurface by its axis and radius.
0043 //! * Create a cylindricalSurface by its circular base.
0044 //! The local coordinate system of the CylindricalSurface is defined
0045 //! with an axis placement (see class ElementarySurface).
0046 //!
0047 //! The "ZAxis" is the symmetry axis of the CylindricalSurface,
0048 //! it gives the direction of increasing parametric value V.
0049 //!
0050 //! The parametrization range is :
0051 //! U [0, 2*PI],  V ]- infinite, + infinite[
0052 //!
0053 //! The "XAxis" and the "YAxis" define the placement plane of the
0054 //! surface (Z = 0, and parametric value V = 0)  perpendicular to
0055 //! the symmetry axis. The "XAxis" defines the origin of the
0056 //! parameter U = 0.  The trigonometric sense gives the positive
0057 //! orientation for the parameter U.
0058 class GC_MakeCylindricalSurface  : public GC_Root
0059 {
0060 public:
0061 
0062   DEFINE_STANDARD_ALLOC
0063 
0064   
0065 
0066   //! A2 defines the local coordinate system of the cylindrical surface.
0067   //! The "ZDirection" of A2 defines the direction of the surface's
0068   //! axis of symmetry.
0069   //! At the creation the parametrization of the surface is defined
0070   //! such that the normal Vector (N = D1U ^ D1V) is oriented towards
0071   //! the "outside region" of the surface.
0072   //! Warnings :
0073   //! It is not forbidden to create a cylindrical surface with
0074   //! Radius = 0.0
0075   //! Status is "NegativeRadius" if Radius < 0.0
0076   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Ax2& A2, const Standard_Real Radius);
0077   
0078 
0079   //! Creates a CylindricalSurface from a non persistent Cylinder
0080   //! from package gp.
0081   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Cylinder& C);
0082   
0083   //! Make a CylindricalSurface from Geom <TheCylinder>
0084   //! parallel to another
0085   //! CylindricalSurface <Cylinder> and passing through a
0086   //! Pnt <Point>.
0087   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Cylinder& Cyl, const gp_Pnt& Point);
0088   
0089   //! Make a CylindricalSurface from Geom <TheCylinder>
0090   //! parallel to another
0091   //! CylindricalSurface <Cylinder> at the distance <Dist>
0092   //! which can be greater or lower than zero.
0093   //! The radius of the result is the absolute value of the
0094   //! radius of <Cyl> plus <Dist>
0095   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Cylinder& Cyl, const Standard_Real Dist);
0096   
0097   //! Make a CylindricalSurface from Geom <TheCylinder>
0098   //! passing through 3 Pnt <P1>,<P2>,<P3>.
0099   //! Its axis is <P1P2> and its radius is the distance
0100   //! between <P3> and <P1P2>
0101   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0102   
0103   //! Make a CylindricalSurface by its axis <Axis> and radius
0104   //! <Radius>.
0105   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Ax1& Axis, const Standard_Real Radius);
0106   
0107   //! Make a CylindricalSurface by its circular base.
0108   Standard_EXPORT GC_MakeCylindricalSurface(const gp_Circ& Circ);
0109   
0110   //! Returns the constructed cylinder.
0111   //! Exceptions StdFail_NotDone if no cylinder is constructed.
0112   Standard_EXPORT const Handle(Geom_CylindricalSurface)& Value() const;
0113 
0114   operator const Handle(Geom_CylindricalSurface)& () const { return Value(); }
0115 
0116 private:
0117   Handle(Geom_CylindricalSurface) TheCylinder;
0118 };
0119 
0120 #endif // _GC_MakeCylindricalSurface_HeaderFile