File indexing completed on 2026-09-28 09:19:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _FairCurve_Energy_HeaderFile
0018 #define _FairCurve_Energy_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <gp_Pnt2d.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <NCollection_HArray1.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <gp_XY.hxx>
0029 #include <math_MultipleVarFunctionWithHessian.hxx>
0030 #include <Standard_Real.hxx>
0031 class math_Matrix;
0032 class gp_Pnt2d;
0033
0034
0035 class FairCurve_Energy : public math_MultipleVarFunctionWithHessian
0036 {
0037 public:
0038 DEFINE_STANDARD_ALLOC
0039
0040
0041 int NbVariables() const override;
0042
0043
0044
0045
0046
0047 Standard_EXPORT bool Value(const math_Vector& X, double& E) override;
0048
0049
0050
0051
0052
0053 Standard_EXPORT bool Gradient(const math_Vector& X, math_Vector& G) override;
0054
0055
0056
0057
0058
0059 Standard_EXPORT bool Values(const math_Vector& X, double& E, math_Vector& G) override;
0060
0061
0062
0063
0064
0065 Standard_EXPORT bool Values(const math_Vector& X,
0066 double& E,
0067 math_Vector& G,
0068 math_Matrix& H) override;
0069
0070
0071 Standard_EXPORT virtual bool Variable(math_Vector& X) const;
0072
0073
0074 const occ::handle<NCollection_HArray1<gp_Pnt2d>>& Poles() const;
0075
0076 protected:
0077
0078
0079 Standard_EXPORT FairCurve_Energy(const occ::handle<NCollection_HArray1<gp_Pnt2d>>& Poles,
0080 const int ConstrOrder1,
0081 const int ConstrOrder2,
0082 const bool WithAuxValue = false,
0083 const double Angle1 = 0,
0084 const double Angle2 = 0,
0085 const int Degree = 2,
0086 const double Curvature1 = 0,
0087 const double Curvature2 = 0);
0088
0089
0090 Standard_EXPORT void Gradient1(const math_Vector& TheVector, math_Vector& G);
0091
0092
0093 Standard_EXPORT void Hessian1(const math_Vector& TheVector, math_Matrix& H);
0094
0095
0096 Standard_EXPORT virtual void ComputePoles(const math_Vector& X);
0097
0098 int Indice(const int i, const int j) const;
0099
0100
0101 Standard_EXPORT void ComputePolesG1(const int Side,
0102 const double Lambda,
0103 const gp_Pnt2d& P1,
0104 gp_Pnt2d& P2) const;
0105
0106
0107 Standard_EXPORT void ComputePolesG2(const int Side,
0108 const double Lambda,
0109 const double Rho,
0110 const gp_Pnt2d& P1,
0111 gp_Pnt2d& P2) const;
0112
0113
0114 Standard_EXPORT virtual bool Compute(const int DerivativeOrder, math_Vector& Result) = 0;
0115
0116 occ::handle<NCollection_HArray1<gp_Pnt2d>> MyPoles;
0117 int MyContrOrder1;
0118 int MyContrOrder2;
0119 bool MyWithAuxValue;
0120 int MyNbVar;
0121
0122 private:
0123 int MyNbValues;
0124 NCollection_Array1<gp_XY> MyLinearForm;
0125 NCollection_Array1<gp_XY> MyQuadForm;
0126 math_Vector MyGradient;
0127 math_Vector MyHessian;
0128 };
0129
0130 #include <FairCurve_Energy.lxx>
0131
0132 #endif