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_MakeElips2d_HeaderFile
0018 #define _gce_MakeElips2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Elips2d.hxx>
0025 #include <gce_Root.hxx>
0026 #include <Standard_Boolean.hxx>
0027 class gp_Ax2d;
0028 class gp_Ax22d;
0029 class gp_Pnt2d;
0030 
0031 
0032 //! This class implements the following algorithms used to
0033 //! create Elips2d from gp.
0034 //!
0035 //! * Create an ellipse from its center, and two points:
0036 //! one on the ciconference giving the major radius, the
0037 //! other giving the value of the small radius.
0038 //! * Create an ellipse from its major axis and its major
0039 //! radius and its minor radius.
0040 class gce_MakeElips2d  : public gce_Root
0041 {
0042 public:
0043 
0044   DEFINE_STANDARD_ALLOC
0045 
0046   
0047 
0048   //! Creates an ellipse with the major axis, the major and the
0049   //! minor radius. The location of the MajorAxis is the center
0050   //! of the  ellipse.
0051   //! The sense of parametrization is given by Sense.
0052   //! It is possible to create an ellipse with MajorRadius = MinorRadius.
0053   //! the status is "InvertRadius" if MajorRadius < MinorRadius or
0054   //! "NegativeRadius" if MinorRadius < 0.0
0055   Standard_EXPORT gce_MakeElips2d(const gp_Ax2d& MajorAxis, const Standard_Real MajorRadius, const Standard_Real MinorRadius, const Standard_Boolean Sense = Standard_True);
0056   
0057 
0058   //! Axis defines the Xaxis and Yaxis of the ellipse which defines
0059   //! the origin and the sense of parametrization.
0060   //! Creates an ellipse with the AxisPlacement the major and the
0061   //! minor radius. The location of Axis is the center
0062   //! of the  ellipse.
0063   //! It is possible to create an ellipse with MajorRadius = MinorRadius.
0064   //! the status is "InvertRadius" if MajorRadius < MinorRadius or
0065   //! "NegativeRadius" if MinorRadius < 0.0
0066   Standard_EXPORT gce_MakeElips2d(const gp_Ax22d& A, const Standard_Real MajorRadius, const Standard_Real MinorRadius);
0067   
0068   //! Makes an Elips2d with its center and two points.
0069   //! The sense of parametrization is given by S1, S2,
0070   //! and Center.
0071   //! Depending on the constructor, the  implicit orientation of the ellipse is:
0072   //! -   the sense defined by A,
0073   //! -   the sense defined by points Center, S1 and S2,
0074   //! -   the trigonometric sense if Sense is not given or is true, or
0075   //! -   the opposite if Sense is false.
0076   //! It is possible to construct an ellipse where the major
0077   //! and minor radii are equal.
0078   //! Warning
0079   //! If an error occurs (that is, when IsDone returns
0080   //! false), the Status function returns:
0081   //! -   gce_InvertRadius if MajorRadius is less than MinorRadius,
0082   //! -   gce_NegativeRadius if MajorRadius or
0083   //! MinorRadius is less than 0.0,
0084   //! -   gce_NullAxis if points S1, S2 and Center are collinear, or
0085   //! -   gce_InvertAxis if the major radius computed with
0086   //! Center and S1 is less than the minor radius
0087   //! computed with Center, S1 and S2.
0088   Standard_EXPORT gce_MakeElips2d(const gp_Pnt2d& S1, const gp_Pnt2d& S2, const gp_Pnt2d& Center);
0089   
0090   //! Returns the constructed ellipse.
0091   //! Exceptions StdFail_NotDone if no ellipse is constructed.
0092   Standard_EXPORT const gp_Elips2d& Value() const;
0093   
0094   Standard_EXPORT const gp_Elips2d& Operator() const;
0095 Standard_EXPORT operator gp_Elips2d() const;
0096 
0097 
0098 
0099 
0100 protected:
0101 
0102 
0103 
0104 
0105 
0106 private:
0107 
0108 
0109 
0110   gp_Elips2d TheElips2d;
0111 
0112 
0113 };
0114 
0115 
0116 
0117 
0118 
0119 
0120 
0121 #endif // _gce_MakeElips2d_HeaderFile