Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-03-10
0002 // Created by: JCV
0003 // Copyright (c) 1993-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 _Geom_Parabola_HeaderFile
0018 #define _Geom_Parabola_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Geom_Conic.hxx>
0024 #include <Standard_Integer.hxx>
0025 class gp_Parab;
0026 class gp_Ax2;
0027 class gp_Ax1;
0028 class gp_Pnt;
0029 class gp_Vec;
0030 class gp_Trsf;
0031 class Geom_Geometry;
0032 
0033 
0034 class Geom_Parabola;
0035 DEFINE_STANDARD_HANDLE(Geom_Parabola, Geom_Conic)
0036 
0037 //! Describes a parabola in 3D space.
0038 //! A parabola is defined by its focal length (i.e. the
0039 //! distance between its focus and its apex) and is
0040 //! positioned in space with a coordinate system
0041 //! (gp_Ax2 object) where:
0042 //! - the origin is the apex of the parabola,
0043 //! - the "X Axis" defines the axis of symmetry; the
0044 //! parabola is on the positive side of this axis,
0045 //! - the origin, "X Direction" and "Y Direction" define the
0046 //! plane of the parabola.
0047 //! This coordinate system is the local coordinate
0048 //! system of the parabola.
0049 //! The "main Direction" of this coordinate system is a
0050 //! vector normal to the plane of the parabola. The axis,
0051 //! of which the origin and unit vector are respectively the
0052 //! origin and "main Direction" of the local coordinate
0053 //! system, is termed the "Axis" or "main Axis" of the parabola.
0054 //! The "main Direction" of the local coordinate system
0055 //! gives an explicit orientation to the parabola,
0056 //! determining the direction in which the parameter
0057 //! increases along the parabola.
0058 //! The Geom_Parabola parabola is parameterized as follows:
0059 //! P(U) = O + U*U/(4.*F)*XDir + U*YDir
0060 //! where:
0061 //! - P is the point of parameter U,
0062 //! - O, XDir and YDir are respectively the origin, "X
0063 //! Direction" and "Y Direction" of its local coordinate system,
0064 //! - F is the focal length of the parabola.
0065 //! The parameter of the parabola is therefore its Y
0066 //! coordinate in the local coordinate system, with the "X
0067 //! Axis" of the local coordinate system defining the origin
0068 //! of the parameter.
0069 //! The parameter range is ] -infinite, +infinite [.
0070 class Geom_Parabola : public Geom_Conic
0071 {
0072 
0073 public:
0074 
0075   
0076   //! Creates a parabola from a non transient one.
0077   Standard_EXPORT Geom_Parabola(const gp_Parab& Prb);
0078   
0079 
0080   //! Creates a parabola with its local coordinate system "A2"
0081   //! and it's focal length "Focal".
0082   //! The XDirection of A2 defines the axis of symmetry of the
0083   //! parabola. The YDirection of A2 is parallel to the directrix
0084   //! of the parabola. The Location point of A2 is the vertex of
0085   //! the parabola
0086   //! Raised if Focal < 0.0
0087   Standard_EXPORT Geom_Parabola(const gp_Ax2& A2, const Standard_Real Focal);
0088   
0089 
0090   //! D is the directrix of the parabola and F the focus point.
0091   //! The symmetry axis (XAxis) of the parabola is normal to the
0092   //! directrix and pass through the focus point F, but its
0093   //! location point is the vertex of the parabola.
0094   //! The YAxis of the parabola is parallel to D and its location
0095   //! point is the vertex of the parabola. The normal to the plane
0096   //! of the parabola is the cross product between the XAxis and the
0097   //! YAxis.
0098   Standard_EXPORT Geom_Parabola(const gp_Ax1& D, const gp_Pnt& F);
0099   
0100   //! Assigns the value Focal to the focal distance of this parabola.
0101   //! Exceptions Standard_ConstructionError if Focal is negative.
0102   Standard_EXPORT void SetFocal (const Standard_Real Focal);
0103   
0104   //! Converts the gp_Parab parabola Prb into this parabola.
0105   Standard_EXPORT void SetParab (const gp_Parab& Prb);
0106   
0107 
0108   //! Returns the non transient parabola from gp with the same
0109   //! geometric properties as <me>.
0110   Standard_EXPORT gp_Parab Parab() const;
0111   
0112   //! Computes the parameter on the reversed parabola,
0113   //! for the point of parameter U on this parabola.
0114   //! For a parabola, the returned value is: -U.
0115   Standard_EXPORT Standard_Real ReversedParameter (const Standard_Real U) const Standard_OVERRIDE;
0116   
0117   //! Returns the value of the first or last parameter of this
0118   //! parabola. This is, respectively:
0119   //! - Standard_Real::RealFirst(), or
0120   //! - Standard_Real::RealLast().
0121   Standard_EXPORT Standard_Real FirstParameter() const Standard_OVERRIDE;
0122   
0123   //! Returns the value of the first or last parameter of this
0124   //! parabola. This is, respectively:
0125   //! - Standard_Real::RealFirst(), or
0126   //! - Standard_Real::RealLast().
0127   Standard_EXPORT Standard_Real LastParameter() const Standard_OVERRIDE;
0128   
0129   //! Returns False
0130   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
0131   
0132   //! Returns False
0133   Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
0134   
0135   //! Computes the directrix of this parabola.
0136   //! This is a line normal to the axis of symmetry, in the
0137   //! plane of this parabola, located on the negative side
0138   //! of its axis of symmetry, at a distance from the apex
0139   //! equal to the focal length.
0140   //! The directrix is returned as an axis (gp_Ax1 object),
0141   //! where the origin is located on the "X Axis" of this parabola.
0142   Standard_EXPORT gp_Ax1 Directrix() const;
0143   
0144   //! Returns 1. (which is the eccentricity of any parabola).
0145   Standard_EXPORT Standard_Real Eccentricity() const Standard_OVERRIDE;
0146   
0147   //! Computes the focus of this parabola. The focus is on the
0148   //! positive side of the "X Axis" of the local coordinate
0149   //! system of the parabola.
0150   Standard_EXPORT gp_Pnt Focus() const;
0151   
0152   //! Computes the focal distance of this parabola
0153   //! The focal distance is the distance between the apex
0154   //! and the focus of the parabola.
0155   Standard_EXPORT Standard_Real Focal() const;
0156   
0157   //! Computes the parameter of this parabola which is the
0158   //! distance between its focus and its directrix. This
0159   //! distance is twice the focal length.
0160   //! If P is the parameter of the parabola, the equation of
0161   //! the parabola in its local coordinate system is: Y**2 = 2.*P*X.
0162   Standard_EXPORT Standard_Real Parameter() const;
0163   
0164   //! Returns in P the point of parameter U.
0165   //! If U = 0 the returned point is the origin of the XAxis and
0166   //! the YAxis of the parabola and it is the vertex of the parabola.
0167   //! P = S + F * (U * U * XDir +  * U * YDir)
0168   //! where S is the vertex of the parabola, XDir the XDirection and
0169   //! YDir the YDirection of the parabola's local coordinate system.
0170   Standard_EXPORT void D0 (const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE;
0171   
0172 
0173   //! Returns the point P of parameter U and the first derivative V1.
0174   Standard_EXPORT void D1 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1) const Standard_OVERRIDE;
0175   
0176 
0177   //! Returns the point P of parameter U, the first and second
0178   //! derivatives V1 and V2.
0179   Standard_EXPORT void D2 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
0180   
0181 
0182   //! Returns the point P of parameter U, the first second and third
0183   //! derivatives V1 V2 and V3.
0184   Standard_EXPORT void D3 (const Standard_Real U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const Standard_OVERRIDE;
0185   
0186   //! For the point of parameter U of this parabola,
0187   //! computes the vector corresponding to the Nth derivative.
0188   //! Exceptions Standard_RangeError if N is less than 1.
0189   Standard_EXPORT gp_Vec DN (const Standard_Real U, const Standard_Integer N) const Standard_OVERRIDE;
0190   
0191   //! Applies the transformation T to this parabola.
0192   Standard_EXPORT void Transform (const gp_Trsf& T) Standard_OVERRIDE;
0193   
0194   //! Returns the  parameter on the  transformed  curve for
0195   //! the transform of the point of parameter U on <me>.
0196   //!
0197   //! me->Transformed(T)->Value(me->TransformedParameter(U,T))
0198   //!
0199   //! is the same point as
0200   //!
0201   //! me->Value(U).Transformed(T)
0202   //!
0203   //! This methods returns <U> * T.ScaleFactor()
0204   Standard_EXPORT Standard_Real TransformedParameter (const Standard_Real U, const gp_Trsf& T) const Standard_OVERRIDE;
0205   
0206   //! Returns a  coefficient to compute the parameter on
0207   //! the transformed  curve  for  the transform  of the
0208   //! point on <me>.
0209   //!
0210   //! Transformed(T)->Value(U * ParametricTransformation(T))
0211   //!
0212   //! is the same point as
0213   //!
0214   //! Value(U).Transformed(T)
0215   //!
0216   //! This methods returns T.ScaleFactor()
0217   Standard_EXPORT Standard_Real ParametricTransformation (const gp_Trsf& T) const Standard_OVERRIDE;
0218   
0219   //! Creates a new object which is a copy of this parabola.
0220   Standard_EXPORT Handle(Geom_Geometry) Copy() const Standard_OVERRIDE;
0221 
0222   //! Dumps the content of me into the stream
0223   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0224 
0225 
0226 
0227 
0228   DEFINE_STANDARD_RTTIEXT(Geom_Parabola,Geom_Conic)
0229 
0230 protected:
0231 
0232 
0233 
0234 
0235 private:
0236 
0237 
0238   Standard_Real focalLength;
0239 
0240 
0241 };
0242 
0243 
0244 
0245 
0246 
0247 
0248 
0249 #endif // _Geom_Parabola_HeaderFile