Back to home page

EIC code displayed by LXR

 
 

    


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

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 _GCE2d_MakeCircle_HeaderFile
0018 #define _GCE2d_MakeCircle_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GCE2d_Root.hxx>
0025 #include <Geom2d_Circle.hxx>
0026 
0027 class gp_Circ2d;
0028 class gp_Ax2d;
0029 class gp_Ax22d;
0030 class gp_Pnt2d;
0031 
0032 
0033 //! This class implements the following algorithms used
0034 //! to create Circle from Geom2d.
0035 //!
0036 //! * Create a Circle parallel to another and passing
0037 //! though a point.
0038 //! * Create a Circle parallel to another at the distance
0039 //! Dist.
0040 //! * Create a Circle passing through 3 points.
0041 //! * Create a Circle with its center and the normal of its
0042 //! plane and its radius.
0043 //! * Create a Circle with its axis and radius.
0044 class GCE2d_MakeCircle  : public GCE2d_Root
0045 {
0046 public:
0047 
0048   DEFINE_STANDARD_ALLOC
0049 
0050   
0051   //! creates a circle from a non persistent one.
0052   Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& C);
0053   
0054 
0055   //! A is the "XAxis" of the circle which defines the origin
0056   //! of parametrization.
0057   //! It is not forbidden to create a circle with Radius = 0.0
0058   //! The status is "NegativeRadius" if Radius < 0.
0059   Standard_EXPORT GCE2d_MakeCircle(const gp_Ax2d& A, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
0060   
0061 
0062   //! A is the local coordinate system of the circle which defines
0063   //! the origin of parametrization.
0064   //! It is not forbidden to create a circle with Radius = 0.0
0065   //! The status is "NegativeRadius" if Radius < 0.
0066   Standard_EXPORT GCE2d_MakeCircle(const gp_Ax22d& A, const Standard_Real Radius);
0067   
0068   //! Make a Circle from Geom2d <TheCirc> parallel to another
0069   //! Circ <Circ> with a distance <Dist>.
0070   //! If Dist is greater than zero the result is enclosing
0071   //! the circle <Circ>, else the result is enclosed by the
0072   //! circle <Circ>.
0073   Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const Standard_Real Dist);
0074   
0075   //! Make a Circle from Geom2d <TheCirc> parallel to another
0076   //! Circ <Circ> and passing through a Pnt <Point>.
0077   Standard_EXPORT GCE2d_MakeCircle(const gp_Circ2d& Circ, const gp_Pnt2d& Point);
0078   
0079   //! Make a Circ from gp <TheCirc> passing through 3
0080   //! Pnt2d <P1>,<P2>,<P3>.
0081   Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3);
0082   
0083   //! Make a Circ from geom2d <TheCirc> by its center an radius.
0084   Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& P, const Standard_Real Radius, const Standard_Boolean Sense = Standard_True);
0085   
0086   //! Makes a Circle from geom2d <TheCirc> with its center
0087   //! <Center> and a point giving the radius.
0088   //! If Sense is true the local coordinate system of
0089   //! the solution is direct and non direct in the other case.
0090   //! Warning
0091   //! The MakeCircle class does not prevent the
0092   //! construction of a circle with a null radius.
0093   //! If an error occurs (that is, when IsDone returns
0094   //! false), the Status function returns:
0095   //! -   gce_NegativeRadius if Radius is less than 0.0, or
0096   //! -   gce_IntersectionError if points P1, P2 and P3
0097   //! are collinear and the three are not coincident.
0098   Standard_EXPORT GCE2d_MakeCircle(const gp_Pnt2d& Center, const gp_Pnt2d& Point, const Standard_Boolean Sense = Standard_True);
0099   
0100   //! Returns the constructed circle.
0101   //! Exceptions StdFail_NotDone if no circle is constructed.
0102   Standard_EXPORT const Handle(Geom2d_Circle)& Value() const;
0103 
0104   operator const Handle(Geom2d_Circle)& () const { return Value(); }
0105 
0106 private:
0107   Handle(Geom2d_Circle) TheCircle;
0108 };
0109 
0110 #endif // _GCE2d_MakeCircle_HeaderFile