Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-04 08:32:06

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_MakeElips_HeaderFile
0018 #define _gce_MakeElips_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Elips.hxx>
0025 #include <gce_Root.hxx>
0026 class gp_Ax2;
0027 class gp_Pnt;
0028 
0029 //! This class implements the following algorithms used to
0030 //! create an ellipse from gp.
0031 //!
0032 //! * Create an ellipse from its center, and two points:
0033 //! one on the ciconference giving the major radius, the
0034 //! other giving the value of the small radius.
0035 class gce_MakeElips : public gce_Root
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   //! The major radius of the ellipse is on the "XAxis" and the
0041   //! minor radius is on the "YAxis" of the ellipse. The "XAxis"
0042   //! is defined with the "XDirection" of A2 and the "YAxis" is
0043   //! defined with the "YDirection" of A2.
0044   //! Warnings :
0045   //! It is not forbidden to create an ellipse with
0046   //! MajorRadius = MinorRadius.
0047   Standard_EXPORT gce_MakeElips(const gp_Ax2&       A2,
0048                                 const Standard_Real MajorRadius,
0049                                 const Standard_Real MinorRadius);
0050 
0051   //! Make an ellipse with its center and two points.
0052   //! Warning
0053   //! The MakeElips class does not prevent the
0054   //! construction of an ellipse where the MajorRadius is
0055   //! equal to the MinorRadius.
0056   //! If an error occurs (that is, when IsDone returns
0057   //! false), the Status function returns:
0058   //! -   gce_InvertRadius if MajorRadius is less than MinorRadius;
0059   //! -   gce_NegativeRadius if MinorRadius is less than 0.0;
0060   //! -   gce_NullAxis if the points S1 and Center are coincident; or
0061   //! -   gce_InvertAxis if:
0062   //! -   the major radius computed with Center and S1
0063   //! is less than the minor radius computed with Center, S1 and S2, or
0064   //! -   Center, S1 and S2 are collinear.
0065   Standard_EXPORT gce_MakeElips(const gp_Pnt& S1, const gp_Pnt& S2, const gp_Pnt& Center);
0066 
0067   //! Returns the constructed ellipse.
0068   //! Exceptions StdFail_NotDone if no ellipse is constructed.
0069   Standard_EXPORT const gp_Elips& Value() const;
0070 
0071   Standard_EXPORT const gp_Elips& Operator() const;
0072   Standard_EXPORT                 operator gp_Elips() const;
0073 
0074 protected:
0075 private:
0076   gp_Elips TheElips;
0077 };
0078 
0079 #endif // _gce_MakeElips_HeaderFile