Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:20:09

0001 // Copyright (c) 2025 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _GeomEval_SineWaveCurve_HeaderFile
0015 #define _GeomEval_SineWaveCurve_HeaderFile
0016 
0017 #include <Geom_Curve.hxx>
0018 #include <gp_Ax2.hxx>
0019 
0020 class gp_Trsf;
0021 class Geom_Geometry;
0022 
0023 //! Describes a 3D sine wave curve.
0024 //! The curve lies in the plane defined by the local coordinate system,
0025 //! oscillating along YDir with propagation along XDir.
0026 //!
0027 //! The parametric equation is:
0028 //! @code
0029 //!   C(t) = O + t*XDir + A*sin(omega*t + phi)*YDir
0030 //! @endcode
0031 //! where:
0032 //! - O, XDir, YDir are from the local coordinate system,
0033 //! - A is the amplitude (> 0),
0034 //! - omega is the angular frequency (> 0),
0035 //! - phi is the phase shift.
0036 //!
0037 //! The parameter range is (-inf, +inf). The curve is not periodic.
0038 class GeomEval_SineWaveCurve : public Geom_Curve
0039 {
0040 public:
0041   //! Creates a 3D sine wave curve.
0042   //! @param[in] thePosition the local coordinate system
0043   //! @param[in] theAmplitude the wave amplitude (must be > 0)
0044   //! @param[in] theOmega the angular frequency (must be > 0)
0045   //! @param[in] thePhase the phase shift (default 0)
0046   //! @throw Standard_ConstructionError if theAmplitude <= 0 or theOmega <= 0
0047   Standard_EXPORT GeomEval_SineWaveCurve(const gp_Ax2& thePosition,
0048                                          double        theAmplitude,
0049                                          double        theOmega,
0050                                          double        thePhase = 0.0);
0051 
0052   //! Returns the local coordinate system.
0053   Standard_EXPORT const gp_Ax2& Position() const;
0054 
0055   //! Returns the amplitude.
0056   Standard_EXPORT double Amplitude() const;
0057 
0058   //! Returns the angular frequency.
0059   Standard_EXPORT double Omega() const;
0060 
0061   //! Returns the phase shift.
0062   Standard_EXPORT double Phase() const;
0063 
0064   //! Reversal is not supported for this eval curve.
0065   //! @throw Standard_NotImplemented
0066   Standard_EXPORT void Reverse() final;
0067 
0068   //! Reversal is not supported for this eval curve.
0069   //! @throw Standard_NotImplemented
0070   Standard_EXPORT double ReversedParameter(const double U) const final;
0071 
0072   //! Returns -Precision::Infinite().
0073   Standard_EXPORT double FirstParameter() const final;
0074 
0075   //! Returns Precision::Infinite().
0076   Standard_EXPORT double LastParameter() const final;
0077 
0078   //! Returns false.
0079   Standard_EXPORT bool IsClosed() const final;
0080 
0081   //! Returns false.
0082   Standard_EXPORT bool IsPeriodic() const final;
0083 
0084   //! Returns GeomAbs_CN.
0085   Standard_EXPORT GeomAbs_Shape Continuity() const final;
0086 
0087   //! Returns true for any N >= 0.
0088   Standard_EXPORT bool IsCN(const int N) const final;
0089 
0090   //! Computes the point at parameter U.
0091   Standard_EXPORT gp_Pnt EvalD0(const double U) const final;
0092 
0093   //! Computes the point and first derivative at parameter U.
0094   Standard_EXPORT Geom_Curve::ResD1 EvalD1(const double U) const final;
0095 
0096   //! Computes the point and first two derivatives at parameter U.
0097   Standard_EXPORT Geom_Curve::ResD2 EvalD2(const double U) const final;
0098 
0099   //! Computes the point and first three derivatives at parameter U.
0100   Standard_EXPORT Geom_Curve::ResD3 EvalD3(const double U) const final;
0101 
0102   //! Computes the N-th derivative at parameter U.
0103   //! @throw Standard_RangeError if N < 1
0104   Standard_EXPORT gp_Vec EvalDN(const double U, const int N) const final;
0105 
0106   //! Transformation is not supported for this eval geometry.
0107   //! @throw Standard_NotImplemented
0108   Standard_EXPORT void Transform(const gp_Trsf& T) final;
0109 
0110   //! Creates a new object which is a copy of this curve.
0111   Standard_EXPORT occ::handle<Geom_Geometry> Copy() const final;
0112 
0113   //! Dumps the content of me into the stream.
0114   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const final;
0115 
0116   DEFINE_STANDARD_RTTIEXT(GeomEval_SineWaveCurve, Geom_Curve)
0117 
0118 private:
0119   gp_Ax2 myPosition;  //!< Local coordinate system
0120   double myAmplitude; //!< Wave amplitude (> 0)
0121   double myOmega;     //!< Angular frequency (> 0)
0122   double myPhase;     //!< Phase shift
0123 };
0124 
0125 #endif // _GeomEval_SineWaveCurve_HeaderFile