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_MakeParabola2d_HeaderFile
0018 #define _GC_MakeParabola2d_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_Parabola.hxx>
0026 
0027 class gp_Parab2d;
0028 class gp_Ax22d;
0029 class gp_Ax2d;
0030 class gp_Pnt2d;
0031 
0032 //! This class implements construction algorithms for parabolas in the plane.
0033 //! The result is a `Geom2d_Parabola`.
0034 //! A `GC_MakeParabola2d` object provides a framework for:
0035 //! - defining the construction parameters;
0036 //! - running the construction algorithm;
0037 //! - querying the construction status and the resulting parabola via `Value()`.
0038 //! @note Parabola parameterization range is ]-infinite, +infinite[.
0039 //! @note In the local coordinate system, the parabola equation is
0040 //!       Y**2 = (2*P) * X, where P is the parameter and F = P/2 is focal length.
0041 class GC_MakeParabola2d : public GC_Root
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! Creates a parabola from a non-persistent one from package gp.
0047   //! @param[in] theParabola source parabola
0048   Standard_EXPORT GC_MakeParabola2d(const gp_Parab2d& theParabola);
0049 
0050   //! Creates a parabola from a local coordinate system and focal length.
0051   //! @param[in] theAxis local coordinate system
0052   //! @param[in] theFocal focal length
0053   //! @note Construction fails with `gce_NullFocusLength` if `theFocal` is negative.
0054   Standard_EXPORT GC_MakeParabola2d(const gp_Ax22d& theAxis, const double theFocal);
0055 
0056   //! Creates a parabola from symmetry axis and focal length.
0057   //! @param[in] theMirrorAxis symmetry axis placement
0058   //! @param[in] theFocal focal length
0059   //! @param[in] theSense orientation flag
0060   //! @note Construction fails with `gce_NullFocusLength` if `theFocal` is negative.
0061   Standard_EXPORT GC_MakeParabola2d(const gp_Ax2d& theMirrorAxis,
0062                                     const double   theFocal,
0063                                     const bool     theSense);
0064 
0065   //! Creates a parabola from directrix and focus point.
0066   //! @param[in] theDirectrix directrix axis
0067   //! @param[in] theFocus focus point
0068   //! @param[in] theSense orientation flag
0069   Standard_EXPORT GC_MakeParabola2d(const gp_Ax2d&  theDirectrix,
0070                                     const gp_Pnt2d& theFocus,
0071                                     const bool      theSense = true);
0072 
0073   //! Creates a parabola from focus and vertex points.
0074   //! @param[in] theFocus focus point
0075   //! @param[in] theVertex vertex point
0076   //! @note Error status is provided by the underlying `gce_MakeParab2d`
0077   //!       (for example `gce_NullAxis`).
0078   Standard_EXPORT GC_MakeParabola2d(const gp_Pnt2d& theFocus, const gp_Pnt2d& theVertex);
0079 
0080   //! Returns the constructed parabola.
0081   //! Exceptions StdFail_NotDone if no parabola is constructed.
0082   //! @return resulting parabola
0083   Standard_EXPORT const occ::handle<Geom2d_Parabola>& Value() const;
0084 
0085   //! Conversion operator returning the constructed object.
0086   //! @return resulting parabola
0087   operator const occ::handle<Geom2d_Parabola>&() const { return Value(); }
0088 
0089 private:
0090   occ::handle<Geom2d_Parabola> TheParabola;
0091 };
0092 
0093 #endif // _GC_MakeParabola2d_HeaderFile