Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:19:59

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 _GC_MakeHyperbola2d_HeaderFile
0018 #define _GC_MakeHyperbola2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GC_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 construction algorithms for hyperbolas in the plane.
0033 //! The result is a `Geom2d_Hyperbola` (main branch).
0034 //! A `GC_MakeHyperbola2d` object provides a framework for:
0035 //! - defining the construction parameters;
0036 //! - running the construction algorithm;
0037 //! - querying the construction status and the resulting hyperbola via `Value()`.
0038 //! @note Hyperbola parameterization range is ]-infinite, +infinite[.
0039 //! @note In the local coordinate system, the X axis is the major axis
0040 //!       and the Y axis is the minor axis.
0041 class GC_MakeHyperbola2d : public GC_Root
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! Creates a hyperbola from a non-persistent one from package gp.
0047   //! @param[in] theHyperbola source hyperbola
0048   Standard_EXPORT GC_MakeHyperbola2d(const gp_Hypr2d& theHyperbola);
0049 
0050   //! Creates a hyperbola from major axis placement and radii.
0051   //! @param[in] theMajorAxis major axis placement
0052   //! @param[in] theMajorRadius major radius value
0053   //! @param[in] theMinorRadius minor radius value
0054   //! @param[in] theSense orientation flag
0055   //! @note Error status is provided by the underlying `gce_MakeHypr2d`
0056   //!       (for example `gce_NegativeRadius`).
0057   Standard_EXPORT GC_MakeHyperbola2d(const gp_Ax2d& theMajorAxis,
0058                                      const double   theMajorRadius,
0059                                      const double   theMinorRadius,
0060                                      const bool     theSense);
0061 
0062   //! Creates a hyperbola from local coordinate system and radii.
0063   //! @param[in] theAxis local coordinate system
0064   //! @param[in] theMajorRadius major radius value
0065   //! @param[in] theMinorRadius minor radius value
0066   //! @note Error status is provided by the underlying `gce_MakeHypr2d`
0067   //!       (for example `gce_NegativeRadius`).
0068   Standard_EXPORT GC_MakeHyperbola2d(const gp_Ax22d& theAxis,
0069                                      const double    theMajorRadius,
0070                                      const double    theMinorRadius);
0071 
0072   //! Creates a hyperbola from two apex points and center point.
0073   //! @param[in] theS1 first apex point
0074   //! @param[in] theS2 second point defining conjugate radius
0075   //! @param[in] theCenter center point
0076   //! @note Error status is provided by the underlying `gce_MakeHypr2d`
0077   //!       (for example `gce_ConfusedPoints` or `gce_ColinearPoints`).
0078   Standard_EXPORT GC_MakeHyperbola2d(const gp_Pnt2d& theS1,
0079                                      const gp_Pnt2d& theS2,
0080                                      const gp_Pnt2d& theCenter);
0081 
0082   //! Returns the constructed hyperbola.
0083   //! Exceptions: StdFail_NotDone if no hyperbola is constructed.
0084   //! @return resulting hyperbola
0085   Standard_EXPORT const occ::handle<Geom2d_Hyperbola>& Value() const;
0086 
0087   //! Conversion operator returning the constructed object.
0088   //! @return resulting hyperbola
0089   operator const occ::handle<Geom2d_Hyperbola>&() const { return Value(); }
0090 
0091 private:
0092   occ::handle<Geom2d_Hyperbola> TheHyperbola;
0093 };
0094 
0095 #endif // _GC_MakeHyperbola2d_HeaderFile