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_MakeCircle_HeaderFile
0018 #define _GC_MakeCircle_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_Circle.hxx>
0026 
0027 class gp_Circ;
0028 class gp_Ax2;
0029 class gp_Pnt;
0030 class gp_Dir;
0031 class gp_Ax1;
0032 
0033 
0034 //! This class implements the following algorithms used
0035 //! to create Cirlec from Geom.
0036 //!
0037 //! * Create a Circle parallel to another and passing
0038 //! though a point.
0039 //! * Create a Circle parallel to another at the distance
0040 //! Dist.
0041 //! * Create a Circle passing through 3 points.
0042 //! * Create a Circle with its center and the normal of its
0043 //! plane and its radius.
0044 //! * Create a Circle with its axis and radius.
0045 //! The circle's parameter is the angle (Radian).
0046 //! The parametrization range is [0,2*PI].
0047 //! The circle is a closed and periodic curve.
0048 //! The center of the circle is the Location point of its axis
0049 //! placement. The XDirection of the axis placement defines the
0050 //! origin of the parametrization.
0051 class GC_MakeCircle  : public GC_Root
0052 {
0053 public:
0054 
0055   DEFINE_STANDARD_ALLOC
0056 
0057   
0058   //! creates a circle from a non persistent circle C by its conversion.
0059   Standard_EXPORT GC_MakeCircle(const gp_Circ& C);
0060   
0061 
0062   //! A2 is the local coordinates system of the circle.
0063   //! It is not forbidden to create a circle with Radius = 0.0
0064   //! Status is "NegativeRadius" if Radius < 0.
0065   Standard_EXPORT GC_MakeCircle(const gp_Ax2& A2, const Standard_Real Radius);
0066   
0067   //! Make a Circle from Geom <TheCirc> parallel to another
0068   //! Circ <Circ> with a distance <Dist>.
0069   //! If Dist is greater than zero the result is enclosing
0070   //! the circle <Circ>, else the result is enclosed by the
0071   //! circle <Circ>.
0072   Standard_EXPORT GC_MakeCircle(const gp_Circ& Circ, const Standard_Real Dist);
0073   
0074   //! Make a Circle from Geom <TheCirc> parallel to another
0075   //! Circ <Circ> and passing through a Pnt <Point>.
0076   Standard_EXPORT GC_MakeCircle(const gp_Circ& Circ, const gp_Pnt& Point);
0077   
0078   //! Make a Circ from gp <TheCirc> passing through 3
0079   //! Pnt2d <P1>,<P2>,<P3>.
0080   Standard_EXPORT GC_MakeCircle(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0081   
0082   //! Make a Circle from Geom <TheCirc> with its center
0083   //! <Center> and the normal of its plane <Norm> and
0084   //! its radius <Radius>.
0085   Standard_EXPORT GC_MakeCircle(const gp_Pnt& Center, const gp_Dir& Norm, const Standard_Real Radius);
0086   
0087   //! Make a Circle from Geom <TheCirc> with its center
0088   //! <Center> and the normal of its plane defined by the
0089   //! two points <Center> and <PtAxis> and its radius <Radius>.
0090   Standard_EXPORT GC_MakeCircle(const gp_Pnt& Center, const gp_Pnt& PtAxis, const Standard_Real Radius);
0091   
0092   //! Make a Circle from Geom <TheCirc> with its center
0093   //! <Center> and its radius <Radius>.
0094   Standard_EXPORT GC_MakeCircle(const gp_Ax1& Axis, const Standard_Real Radius);
0095   
0096 
0097   //! Returns the constructed circle.
0098   //! Exceptions
0099   //! StdFail_NotDone if no circle is constructed.
0100   Standard_EXPORT const Handle(Geom_Circle)& Value() const;
0101 
0102   operator const Handle(Geom_Circle)& () const { return Value(); }
0103 
0104 private:
0105   Handle(Geom_Circle) TheCircle;
0106 };
0107 
0108 #endif // _GC_MakeCircle_HeaderFile