File indexing completed on 2025-01-18 10:03:30
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 <TColgp_HArray1OfPnt2d.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TColgp_Array1OfXY.hxx>
0027 #include <math_MultipleVarFunctionWithHessian.hxx>
0028 #include <Standard_Real.hxx>
0029 class math_Matrix;
0030 class gp_Pnt2d;
0031
0032
0033
0034 class FairCurve_Energy : public math_MultipleVarFunctionWithHessian
0035 {
0036 public:
0037
0038 DEFINE_STANDARD_ALLOC
0039
0040
0041
0042 virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
0043
0044
0045
0046
0047
0048 Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X, Standard_Real& E) Standard_OVERRIDE;
0049
0050
0051
0052
0053
0054 Standard_EXPORT virtual Standard_Boolean Gradient (const math_Vector& X, math_Vector& G) Standard_OVERRIDE;
0055
0056
0057
0058
0059
0060 Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, Standard_Real& E, math_Vector& G) Standard_OVERRIDE;
0061
0062
0063
0064
0065
0066 Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, Standard_Real& E, math_Vector& G, math_Matrix& H) Standard_OVERRIDE;
0067
0068
0069 Standard_EXPORT virtual Standard_Boolean Variable (math_Vector& X) const;
0070
0071
0072 const Handle(TColgp_HArray1OfPnt2d)& Poles() const;
0073
0074
0075
0076
0077 protected:
0078
0079
0080
0081
0082 Standard_EXPORT FairCurve_Energy(const Handle(TColgp_HArray1OfPnt2d)& Poles, const Standard_Integer ConstrOrder1, const Standard_Integer ConstrOrder2, const Standard_Boolean WithAuxValue = Standard_False, const Standard_Real Angle1 = 0, const Standard_Real Angle2 = 0, const Standard_Integer Degree = 2, const Standard_Real Curvature1 = 0, const Standard_Real Curvature2 = 0);
0083
0084
0085 Standard_EXPORT void Gradient1 (const math_Vector& TheVector, math_Vector& G);
0086
0087
0088 Standard_EXPORT void Hessian1 (const math_Vector& TheVector, math_Matrix& H);
0089
0090
0091 Standard_EXPORT virtual void ComputePoles (const math_Vector& X);
0092
0093 Standard_Integer Indice (const Standard_Integer i, const Standard_Integer j) const;
0094
0095
0096 Standard_EXPORT void ComputePolesG1 (const Standard_Integer Side, const Standard_Real Lambda, const gp_Pnt2d& P1, gp_Pnt2d& P2) const;
0097
0098
0099 Standard_EXPORT void ComputePolesG2 (const Standard_Integer Side, const Standard_Real Lambda, const Standard_Real Rho, const gp_Pnt2d& P1, gp_Pnt2d& P2) const;
0100
0101
0102 Standard_EXPORT virtual Standard_Boolean Compute (const Standard_Integer DerivativeOrder, math_Vector& Result) = 0;
0103
0104
0105 Handle(TColgp_HArray1OfPnt2d) MyPoles;
0106 Standard_Integer MyContrOrder1;
0107 Standard_Integer MyContrOrder2;
0108 Standard_Boolean MyWithAuxValue;
0109 Standard_Integer MyNbVar;
0110
0111
0112 private:
0113
0114
0115
0116 Standard_Integer MyNbValues;
0117 TColgp_Array1OfXY MyLinearForm;
0118 TColgp_Array1OfXY MyQuadForm;
0119 math_Vector MyGradient;
0120 math_Vector MyHessian;
0121
0122
0123 };
0124
0125
0126 #include <FairCurve_Energy.lxx>
0127
0128
0129
0130
0131
0132 #endif