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_MakeCirc_HeaderFile
0018 #define _gce_MakeCirc_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <gp_Circ.hxx>
0024 #include <gce_Root.hxx>
0025 class gp_Ax2;
0026 class gp_Pnt;
0027 class gp_Dir;
0028 class gp_Pln;
0029 class gp_Ax1;
0030 
0031 
0032 //! This class implements the following algorithms used
0033 //! to create Circ from gp.
0034 //!
0035 //! * Create a Circ coaxial to another and passing
0036 //! though a point.
0037 //! * Create a Circ coaxial to another at the distance
0038 //! Dist.
0039 //! * Create a Circ passing through 3 points.
0040 //! * Create a Circ with its center and the normal of its
0041 //! plane and its radius.
0042 //! * Create a Circ with its center and its plane and its
0043 //! radius.
0044 //! * Create a Circ with its axis and radius.
0045 //! * Create a Circ with two points giving its axis and
0046 //! its radius.
0047 //! * Create a Circ with is Ax2 and its Radius.
0048 class gce_MakeCirc  : public gce_Root
0049 {
0050 public:
0051 
0052   DEFINE_STANDARD_ALLOC
0053 
0054   
0055 
0056   //! A2 locates the circle and gives its orientation in 3D space.
0057   //! Warnings :
0058   //! It is not forbidden to create a circle with Radius = 0.0
0059   //! The status is "NegativeRadius" if Radius < 0.0
0060   Standard_EXPORT gce_MakeCirc(const gp_Ax2& A2, const Standard_Real Radius);
0061   
0062   //! Makes a Circ from gp <TheCirc> coaxial to another
0063   //! Circ <Circ> at a distance <Dist>.
0064   //! If Dist is greater than zero the result is encloses
0065   //! the circle <Circ>, else the result is enclosed by the
0066   //! circle <Circ>.
0067   Standard_EXPORT gce_MakeCirc(const gp_Circ& Circ, const Standard_Real Dist);
0068   
0069   //! Makes a Circ from gp <TheCirc> coaxial to another
0070   //! Circ <Circ> and passing through a Pnt2d <Point>.
0071   Standard_EXPORT gce_MakeCirc(const gp_Circ& Circ, const gp_Pnt& Point);
0072   
0073   //! Makes a Circ from gp <TheCirc> passing through 3
0074   //! Pnt2d <P1>,<P2>,<P3>.
0075   Standard_EXPORT gce_MakeCirc(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0076   
0077   //! Makes a Circ from gp <TheCirc> with its center
0078   //! <Center> and the normal of its plane <Norm> and
0079   //! its radius <Radius>.
0080   Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Dir& Norm, const Standard_Real Radius);
0081   
0082   //! Makes a Circ from gp <TheCirc> with its center
0083   //! <Center> and the normal of its plane <Plane> and
0084   //! its radius <Radius>.
0085   Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Pln& Plane, const Standard_Real Radius);
0086   
0087   //! Makes a Circ from gp <TheCirc> with its center
0088   //! <Center> and a point <Ptaxis> giving the normal
0089   //! of its plane <Plane> and its radius <Radius>.
0090   Standard_EXPORT gce_MakeCirc(const gp_Pnt& Center, const gp_Pnt& Ptaxis, const Standard_Real Radius);
0091   
0092   //! Makes a Circ from gp <TheCirc> with its center
0093   //! <Center> and its radius <Radius>.
0094   //! Warning
0095   //! The MakeCirc class does not prevent the
0096   //! construction of a circle with a null radius.
0097   //! If an error occurs (that is, when IsDone returns
0098   //! false), the Status function returns:
0099   //! -   gce_Negative Radius if:
0100   //! -   Radius is less than 0.0, or
0101   //! -   Dist is less than 0.0 and the absolute value of
0102   //! Dist is greater than the radius of Circ;
0103   //! -   gce_IntersectionError if the points P1, P2 and
0104   //! P3 are collinear, and the three are not coincident;
0105   //! -   gce_ConfusedPoints if two of the three points
0106   //! P1, P2 and P3 are coincident; or
0107   //! -   gce_NullAxis if Center and Ptaxis are coincident.
0108   Standard_EXPORT gce_MakeCirc(const gp_Ax1& Axis, const Standard_Real Radius);
0109   
0110   //! Returns the constructed circle.
0111   //! Exceptions StdFail_NotDone if no circle is constructed.
0112   Standard_EXPORT const gp_Circ& Value() const;
0113   
0114   Standard_EXPORT const gp_Circ& Operator() const;
0115 Standard_EXPORT operator gp_Circ() const;
0116 
0117 
0118 
0119 
0120 protected:
0121 
0122 
0123 
0124 
0125 
0126 private:
0127 
0128 
0129 
0130   gp_Circ TheCirc;
0131 
0132 
0133 };
0134 
0135 
0136 
0137 
0138 
0139 
0140 
0141 #endif // _gce_MakeCirc_HeaderFile