Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:16:38

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_MakeHyperbola_HeaderFile
0018 #define _GCE2d_MakeHyperbola_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_Hyperbola.hxx>
0026 
0027 class gp_Hypr2d;
0028 class gp_Ax2d;
0029 class gp_Ax22d;
0030 class gp_Pnt2d;
0031 
0032 //! This class implements the following algorithms used to
0033 //! create Hyperbola from Geom2d.
0034 //! * Create an Hyperbola from two apex  and the center.
0035 //! Defines the main branch of an hyperbola.
0036 //! The parameterization range is ]-infinite,+infinite[
0037 //! It is possible to get the other branch and the two conjugate
0038 //! branches of the main branch.
0039 //!
0040 //! ^YAxis
0041 //! |
0042 //! FirstConjugateBranch
0043 //! |
0044 //! Other            |                Main
0045 //! --------------------- C ------------------------------>XAxis
0046 //! Branch           |                Branch
0047 //! |
0048 //! SecondConjugateBranch
0049 //! |
0050 //!
0051 //! The major radius is the distance between the Location point
0052 //! of the hyperbola C and the apex of the main Branch (or the
0053 //! Other branch). The major axis is the "XAxis".
0054 //! The minor radius is the distance between the Location point
0055 //! of the hyperbola C and the apex of the First (or Second)
0056 //! Conjugate branch. The minor axis is the "YAxis".
0057 //! The major radius can be lower than the minor radius.
0058 class GCE2d_MakeHyperbola : public GCE2d_Root
0059 {
0060 public:
0061   DEFINE_STANDARD_ALLOC
0062 
0063   //! Creates  an Hyperbola from a non persistent one from package gp
0064   Standard_EXPORT GCE2d_MakeHyperbola(const gp_Hypr2d& H);
0065 
0066   //! MajorAxis is the "XAxis" of the hyperbola.
0067   //! The major radius of the hyperbola is on this "XAxis" and
0068   //! the minor radius is on the "YAxis" of the hyperbola.
0069   //! The status is "NegativeRadius" if MajorRadius < 0.0 or if
0070   //! MinorRadius < 0.0
0071   Standard_EXPORT GCE2d_MakeHyperbola(const gp_Ax2d&         MajorAxis,
0072                                       const Standard_Real    MajorRadius,
0073                                       const Standard_Real    MinorRadius,
0074                                       const Standard_Boolean Sense);
0075 
0076   //! Axis is the local coordinate system of the hyperbola.
0077   //! The major radius of the hyperbola is on this "XAxis" and
0078   //! the minor radius is on the "YAxis" of the hyperbola.
0079   //! The status is "NegativeRadius" if MajorRadius < 0.0 or if
0080   //! MinorRadius < 0.0
0081   Standard_EXPORT GCE2d_MakeHyperbola(const gp_Ax22d&     Axis,
0082                                       const Standard_Real MajorRadius,
0083                                       const Standard_Real MinorRadius);
0084 
0085   //! Creates a hyperbol centered on the origin of the coordinate system
0086   //! Axis, with major and minor radii MajorRadius and
0087   //! MinorRadius, where the major axis is the "X Axis"
0088   //! of Axis (Axis is the local coordinate system of the hyperbola).
0089   //! The implicit orientation of the ellipse is:
0090   //! -   the sense defined by Axis or H,
0091   //! -   the sense defined by points Center, S1 and S2,
0092   //! -   the trigonometric sense if Sense is not given or is true, or
0093   //! -   the opposite sense if Sense is false.
0094   //! Warning
0095   //! If an error occurs (that is, when IsDone returns
0096   //! false), the Status function returns:
0097   //! -   gce_NegativeRadius if MajorRadius or
0098   //! MinorRadius is less than 0.0, or
0099   //! -   gce_InvertAxis if the major radius defined by
0100   //! Center and S1 is less than the minor radius
0101   //! defined by Center, S1 and S2.Make an Hyperbola with its center and two apexes.
0102   Standard_EXPORT GCE2d_MakeHyperbola(const gp_Pnt2d& S1,
0103                                       const gp_Pnt2d& S2,
0104                                       const gp_Pnt2d& Center);
0105 
0106   //! Returns the constructed hyperbola.
0107   //! Exceptions: StdFail_NotDone if no hyperbola is constructed.
0108   Standard_EXPORT const Handle(Geom2d_Hyperbola)& Value() const;
0109 
0110   operator const Handle(Geom2d_Hyperbola) & () const { return Value(); }
0111 
0112 private:
0113   Handle(Geom2d_Hyperbola) TheHyperbola;
0114 };
0115 
0116 #endif // _GCE2d_MakeHyperbola_HeaderFile