Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:32

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_MakeParabola_HeaderFile
0018 #define _GCE2d_MakeParabola_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_Parabola.hxx>
0026 
0027 class gp_Parab2d;
0028 class gp_Ax22d;
0029 class gp_Ax2d;
0030 class gp_Pnt2d;
0031 
0032 
0033 //! This class implements the following algorithms used to
0034 //! create Parabola from Geom2d.
0035 //! * Create an Parabola from two apex  and the center.
0036 //! Defines the parabola in the parameterization range  :
0037 //! ]-infinite,+infinite[
0038 //! The vertex of the parabola is the "Location" point of the
0039 //! local coordinate system "XAxis" of the parabola.
0040 //! The "XAxis" of the parabola is its axis of symmetry.
0041 //! The "Xaxis" is oriented from the vertex of the parabola to the
0042 //! Focus of the parabola.
0043 //! The equation of the parabola in the local coordinate system is
0044 //! Y**2 = (2*P) * X
0045 //! P is the distance between the focus and the directrix of the
0046 //! parabola called Parameter).
0047 //! The focal length F = P/2 is the distance between the vertex
0048 //! and the focus of the parabola.
0049 class GCE2d_MakeParabola  : public GCE2d_Root
0050 {
0051 public:
0052 
0053   DEFINE_STANDARD_ALLOC
0054 
0055   
0056   //! Creates a parabola from a non persistent one.
0057   Standard_EXPORT GCE2d_MakeParabola(const gp_Parab2d& Prb);
0058   
0059   //! Creates a parabola with its local coordinate system and it's focal
0060   //! length "Focal".
0061   //! The "Location" point of "Axis" is the vertex of the parabola
0062   //! Status is "NegativeFocusLength" if Focal < 0.0
0063   Standard_EXPORT GCE2d_MakeParabola(const gp_Ax22d& Axis, const Standard_Real Focal);
0064   
0065   //! Creates a parabola with its "MirrorAxis" and it's focal length "Focal".
0066   //! MirrorAxis is the axis of symmetry of the curve, it is the
0067   //! "XAxis". The "YAxis" is parallel to the directrix of the
0068   //! parabola. The "Location" point of "MirrorAxis" is the vertex of the parabola
0069   //! Status is "NegativeFocusLength" if Focal < 0.0
0070   Standard_EXPORT GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis, const Standard_Real Focal, const Standard_Boolean Sense);
0071   
0072   //! D is the directrix of the parabola and F the focus point.
0073   //! The symmetry axis "XAxis" of the parabola is normal to the
0074   //! directrix and pass through the focus point F, but its
0075   //! "Location" point is the vertex of the parabola.
0076   //! The "YAxis" of the parabola is parallel to D and its "Location"
0077   //! point is the vertex of the parabola.
0078   Standard_EXPORT GCE2d_MakeParabola(const gp_Ax2d& D, const gp_Pnt2d& F, const Standard_Boolean Sense = Standard_True);
0079   
0080   //! Make a parabola with focal point S1 and
0081   //! center O
0082   //! The branch of the parabola returned will have <S1> as
0083   //! focal point
0084   //! The implicit orientation of the parabola is:
0085   //! -   the same one as the parabola Prb,
0086   //! -   the sense defined by the coordinate system Axis or the directrix D,
0087   //! -   the trigonometric sense if Sense is not given or is true, or
0088   //! -   the opposite sense if Sense is false.
0089   //! Warning
0090   //! The MakeParabola class does not prevent the
0091   //! construction of a parabola with a null focal distance.
0092   //! If an error occurs (that is, when IsDone returns
0093   //! false), the Status function returns:
0094   //! -   gce_NullFocusLength if Focal is less than 0.0, or
0095   //! -   gce_NullAxis if points S1 and O are coincident.
0096   Standard_EXPORT GCE2d_MakeParabola(const gp_Pnt2d& S1, const gp_Pnt2d& O);
0097   
0098   //! Returns the constructed parabola.
0099   //! Exceptions StdFail_NotDone if no parabola is constructed.
0100   Standard_EXPORT const Handle(Geom2d_Parabola)& Value() const;
0101 
0102   operator const Handle(Geom2d_Parabola)& () const { return Value(); }
0103 
0104 private:
0105   Handle(Geom2d_Parabola) TheParabola;
0106 };
0107 
0108 #endif // _GCE2d_MakeParabola_HeaderFile