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_MakeArcOfHyperbola2d_HeaderFile
0018 #define _GC_MakeArcOfHyperbola2d_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_TrimmedCurve.hxx>
0026 
0027 class gp_Hypr2d;
0028 class gp_Pnt2d;
0029 
0030 //! This class implements construction algorithms for arcs of hyperbolas in the plane.
0031 //! The result is a `Geom2d_TrimmedCurve`.
0032 //! A `GC_MakeArcOfHyperbola2d` object provides a framework for:
0033 //! - defining the construction parameters;
0034 //! - running the construction algorithm;
0035 //! - querying the construction status and the resulting arc via `Value()`.
0036 //! @note Angular parameters are expressed in radians.
0037 class GC_MakeArcOfHyperbola2d : public GC_Root
0038 {
0039 public:
0040   DEFINE_STANDARD_ALLOC
0041 
0042   //! Constructs an arc from angular bounds on a hyperbola.
0043   //! @param[in] theHyperbola source hyperbola
0044   //! @param[in] theAlpha1 first angle (radians)
0045   //! @param[in] theAlpha2 second angle (radians)
0046   //! @param[in] theSense orientation of resulting arc
0047   Standard_EXPORT GC_MakeArcOfHyperbola2d(const gp_Hypr2d& theHyperbola,
0048                                           const double     theAlpha1,
0049                                           const double     theAlpha2,
0050                                           const bool       theSense = true);
0051 
0052   //! Constructs an arc from a point and angular bound on a hyperbola.
0053   //! @param[in] theHyperbola source hyperbola
0054   //! @param[in] thePoint point on source hyperbola
0055   //! @param[in] theAlpha angle value (radians)
0056   //! @param[in] theSense orientation of resulting arc
0057   Standard_EXPORT GC_MakeArcOfHyperbola2d(const gp_Hypr2d& theHyperbola,
0058                                           const gp_Pnt2d&  thePoint,
0059                                           const double     theAlpha,
0060                                           const bool       theSense = true);
0061 
0062   //! Constructs an arc between two points on a hyperbola.
0063   //! @param[in] theHyperbola source hyperbola
0064   //! @param[in] theP1 first point on source hyperbola
0065   //! @param[in] theP2 second point on source hyperbola
0066   //! @param[in] theSense orientation of resulting arc
0067   //! @note Orientation is trigonometric when `theSense` is true,
0068   //!       otherwise opposite.
0069   //! @note IsDone always returns true.
0070   Standard_EXPORT GC_MakeArcOfHyperbola2d(const gp_Hypr2d& theHyperbola,
0071                                           const gp_Pnt2d&  theP1,
0072                                           const gp_Pnt2d&  theP2,
0073                                           const bool       theSense = true);
0074 
0075   //! Returns the constructed arc of hyperbola.
0076   //! @return resulting trimmed curve
0077   Standard_EXPORT const occ::handle<Geom2d_TrimmedCurve>& Value() const;
0078 
0079   //! Conversion operator returning the constructed object.
0080   //! @return resulting trimmed curve
0081   operator const occ::handle<Geom2d_TrimmedCurve>&() const { return Value(); }
0082 
0083 private:
0084   occ::handle<Geom2d_TrimmedCurve> TheArc;
0085 };
0086 
0087 #endif // _GC_MakeArcOfHyperbola2d_HeaderFile