Back to home page

EIC code displayed by LXR

 
 

    


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

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_AHTBezierSurface_HeaderFile
0015 #define _GeomEval_AHTBezierSurface_HeaderFile
0016 
0017 #include <Geom_BoundedSurface.hxx>
0018 #include <NCollection_Array2.hxx>
0019 #include <gp_Pnt.hxx>
0020 
0021 class gp_Trsf;
0022 class Geom_Geometry;
0023 class Geom_Curve;
0024 
0025 //! Tensor-product Algebraic-Hyperbolic-Trigonometric Bezier surface.
0026 //! Uses a mixed basis in each parametric direction:
0027 //! {1, t, ..., t^k, sinh(alpha*t), cosh(alpha*t), sin(beta*t), cos(beta*t)}.
0028 //!
0029 //! Separate AHT parameters per direction: (algDegreeU, alphaU, betaU)
0030 //! and (algDegreeV, alphaV, betaV).
0031 //!
0032 //! The number of basis functions in each direction must equal the number
0033 //! of poles in that direction.
0034 //! Parameter range: U in [0, 1], V in [0, 1].
0035 class GeomEval_AHTBezierSurface : public Geom_BoundedSurface
0036 {
0037 public:
0038   //! Non-rational constructor.
0039   //! @param[in] thePoles 2D array of control points
0040   //! @param[in] theAlgDegreeU algebraic polynomial degree in U (>= 0)
0041   //! @param[in] theAlgDegreeV algebraic polynomial degree in V (>= 0)
0042   //! @param[in] theAlphaU hyperbolic frequency in U (>= 0)
0043   //! @param[in] theAlphaV hyperbolic frequency in V (>= 0)
0044   //! @param[in] theBetaU trigonometric frequency in U (>= 0)
0045   //! @param[in] theBetaV trigonometric frequency in V (>= 0)
0046   Standard_EXPORT GeomEval_AHTBezierSurface(const NCollection_Array2<gp_Pnt>& thePoles,
0047                                             int                               theAlgDegreeU,
0048                                             int                               theAlgDegreeV,
0049                                             double                            theAlphaU,
0050                                             double                            theAlphaV,
0051                                             double                            theBetaU,
0052                                             double                            theBetaV);
0053 
0054   //! Rational constructor.
0055   //! @param[in] thePoles 2D array of control points
0056   //! @param[in] theWeights 2D array of weights (must be > 0)
0057   //! @param[in] theAlgDegreeU algebraic polynomial degree in U (>= 0)
0058   //! @param[in] theAlgDegreeV algebraic polynomial degree in V (>= 0)
0059   //! @param[in] theAlphaU hyperbolic frequency in U (>= 0)
0060   //! @param[in] theAlphaV hyperbolic frequency in V (>= 0)
0061   //! @param[in] theBetaU trigonometric frequency in U (>= 0)
0062   //! @param[in] theBetaV trigonometric frequency in V (>= 0)
0063   Standard_EXPORT GeomEval_AHTBezierSurface(const NCollection_Array2<gp_Pnt>& thePoles,
0064                                             const NCollection_Array2<double>& theWeights,
0065                                             int                               theAlgDegreeU,
0066                                             int                               theAlgDegreeV,
0067                                             double                            theAlphaU,
0068                                             double                            theAlphaV,
0069                                             double                            theBetaU,
0070                                             double                            theBetaV);
0071 
0072   //! Returns the 2D array of poles.
0073   Standard_EXPORT const NCollection_Array2<gp_Pnt>& Poles() const;
0074 
0075   //! Returns the 2D array of weights.
0076   Standard_EXPORT const NCollection_Array2<double>& Weights() const;
0077 
0078   //! Returns the algebraic polynomial degree in U.
0079   Standard_EXPORT int AlgDegreeU() const;
0080 
0081   //! Returns the algebraic polynomial degree in V.
0082   Standard_EXPORT int AlgDegreeV() const;
0083 
0084   //! Returns the hyperbolic frequency in U.
0085   Standard_EXPORT double AlphaU() const;
0086 
0087   //! Returns the hyperbolic frequency in V.
0088   Standard_EXPORT double AlphaV() const;
0089 
0090   //! Returns the trigonometric frequency in U.
0091   Standard_EXPORT double BetaU() const;
0092 
0093   //! Returns the trigonometric frequency in V.
0094   Standard_EXPORT double BetaV() const;
0095 
0096   //! Returns the number of poles in U direction.
0097   Standard_EXPORT int NbPolesU() const;
0098 
0099   //! Returns the number of poles in V direction.
0100   Standard_EXPORT int NbPolesV() const;
0101 
0102   //! Returns true if the surface is rational in U direction.
0103   Standard_EXPORT bool IsURational() const;
0104 
0105   //! Returns true if the surface is rational in V direction.
0106   Standard_EXPORT bool IsVRational() const;
0107 
0108   // Surface interface
0109 
0110   //! Reversal is not supported for this eval surface.
0111   //! @throw Standard_NotImplemented
0112   Standard_EXPORT void UReverse() final;
0113 
0114   //! Reversal is not supported for this eval surface.
0115   //! @throw Standard_NotImplemented
0116   Standard_EXPORT void VReverse() final;
0117 
0118   //! Reversal is not supported for this eval surface.
0119   //! @throw Standard_NotImplemented
0120   Standard_EXPORT double UReversedParameter(const double U) const final;
0121 
0122   //! Reversal is not supported for this eval surface.
0123   //! @throw Standard_NotImplemented
0124   Standard_EXPORT double VReversedParameter(const double V) const final;
0125 
0126   //! Returns the parametric bounds.
0127   //! @param[out] U1 lower U bound (0)
0128   //! @param[out] U2 upper U bound (1)
0129   //! @param[out] V1 lower V bound (0)
0130   //! @param[out] V2 upper V bound (1)
0131   Standard_EXPORT void Bounds(double& U1, double& U2, double& V1, double& V2) const final;
0132 
0133   //! Returns false. The AHT-Bezier surface is not closed in U.
0134   Standard_EXPORT bool IsUClosed() const final;
0135 
0136   //! Returns false. The AHT-Bezier surface is not closed in V.
0137   Standard_EXPORT bool IsVClosed() const final;
0138 
0139   //! Returns false. The AHT-Bezier surface is not periodic in U.
0140   Standard_EXPORT bool IsUPeriodic() const final;
0141 
0142   //! Returns false. The AHT-Bezier surface is not periodic in V.
0143   Standard_EXPORT bool IsVPeriodic() const final;
0144 
0145   //! Isoparametric curve extraction is not supported for this eval surface.
0146   //! @throw Standard_NotImplemented
0147   Standard_EXPORT occ::handle<Geom_Curve> UIso(const double U) const final;
0148 
0149   //! Isoparametric curve extraction is not supported for this eval surface.
0150   //! @throw Standard_NotImplemented
0151   Standard_EXPORT occ::handle<Geom_Curve> VIso(const double V) const final;
0152 
0153   //! Returns GeomAbs_CN.
0154   Standard_EXPORT GeomAbs_Shape Continuity() const final;
0155 
0156   //! Returns true for any N.
0157   Standard_EXPORT bool IsCNu(const int N) const final;
0158 
0159   //! Returns true for any N.
0160   Standard_EXPORT bool IsCNv(const int N) const final;
0161 
0162   //! Computes the point at parameters (U, V).
0163   Standard_EXPORT gp_Pnt EvalD0(const double U, const double V) const final;
0164 
0165   //! Computes the point and first partial derivatives at (U, V).
0166   Standard_EXPORT Geom_Surface::ResD1 EvalD1(const double U, const double V) const final;
0167 
0168   //! Computes the point and partial derivatives up to 2nd order at (U, V).
0169   Standard_EXPORT Geom_Surface::ResD2 EvalD2(const double U, const double V) const final;
0170 
0171   //! Computes the point and partial derivatives up to 3rd order at (U, V).
0172   Standard_EXPORT Geom_Surface::ResD3 EvalD3(const double U, const double V) const final;
0173 
0174   //! Computes the derivative of order Nu in U and Nv in V.
0175   //! @param[in] U the u parameter
0176   //! @param[in] V the v parameter
0177   //! @param[in] Nu derivative order in u (must be >= 0)
0178   //! @param[in] Nv derivative order in v (must be >= 0)
0179   //! @return the derivative vector
0180   //! @throw Standard_RangeError if Nu + Nv < 1 or Nu < 0 or Nv < 0
0181   Standard_EXPORT gp_Vec EvalDN(const double U,
0182                                 const double V,
0183                                 const int    Nu,
0184                                 const int    Nv) const final;
0185 
0186   //! Transformation is not supported for this eval geometry.
0187   //! @throw Standard_NotImplemented
0188   Standard_EXPORT void Transform(const gp_Trsf& T) final;
0189 
0190   //! Creates a new object which is a copy of this surface.
0191   Standard_EXPORT occ::handle<Geom_Geometry> Copy() const final;
0192 
0193   //! Dumps the content of me into the stream.
0194   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const final;
0195 
0196   DEFINE_STANDARD_RTTIEXT(GeomEval_AHTBezierSurface, Geom_BoundedSurface)
0197 
0198 private:
0199   //! Compute the number of basis functions for the given parameters.
0200   static int basisDimension(int theAlgDegree, double theAlpha, double theBeta);
0201 
0202   NCollection_Array2<gp_Pnt> myPoles;
0203   NCollection_Array2<double> myWeights;
0204   int                        myAlgDegreeU;
0205   int                        myAlgDegreeV;
0206   double                     myAlphaU;
0207   double                     myAlphaV;
0208   double                     myBetaU;
0209   double                     myBetaV;
0210   bool                       myURational;
0211   bool                       myVRational;
0212 };
0213 
0214 #endif // _GeomEval_AHTBezierSurface_HeaderFile