File indexing completed on 2026-09-20 09:16:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRepBlend_AppFuncRoot_HeaderFile
0018 #define _BRepBlend_AppFuncRoot_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <math_Vector.hxx>
0024 #include <Blend_Point.hxx>
0025 #include <gp_Pnt.hxx>
0026 #include <Approx_SweepFunction.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <gp_Pnt2d.hxx>
0029 #include <gp_Vec.hxx>
0030 #include <gp_Vec2d.hxx>
0031 #include <Standard_Integer.hxx>
0032 #include <GeomAbs_Shape.hxx>
0033
0034 #include <memory>
0035
0036 class BRepBlend_Line;
0037 class Blend_AppFunction;
0038 class math_FunctionSetRoot;
0039
0040
0041 class BRepBlend_AppFuncRoot : public Approx_SweepFunction
0042 {
0043
0044 public:
0045
0046 Standard_EXPORT bool D0(const double Param,
0047 const double First,
0048 const double Last,
0049 NCollection_Array1<gp_Pnt>& Poles,
0050 NCollection_Array1<gp_Pnt2d>& Poles2d,
0051 NCollection_Array1<double>& Weigths) override;
0052
0053
0054
0055 Standard_EXPORT bool D1(const double Param,
0056 const double First,
0057 const double Last,
0058 NCollection_Array1<gp_Pnt>& Poles,
0059 NCollection_Array1<gp_Vec>& DPoles,
0060 NCollection_Array1<gp_Pnt2d>& Poles2d,
0061 NCollection_Array1<gp_Vec2d>& DPoles2d,
0062 NCollection_Array1<double>& Weigths,
0063 NCollection_Array1<double>& DWeigths) override;
0064
0065
0066
0067 Standard_EXPORT bool D2(const double Param,
0068 const double First,
0069 const double Last,
0070 NCollection_Array1<gp_Pnt>& Poles,
0071 NCollection_Array1<gp_Vec>& DPoles,
0072 NCollection_Array1<gp_Vec>& D2Poles,
0073 NCollection_Array1<gp_Pnt2d>& Poles2d,
0074 NCollection_Array1<gp_Vec2d>& DPoles2d,
0075 NCollection_Array1<gp_Vec2d>& D2Poles2d,
0076 NCollection_Array1<double>& Weigths,
0077 NCollection_Array1<double>& DWeigths,
0078 NCollection_Array1<double>& D2Weigths) override;
0079
0080
0081 Standard_EXPORT int Nb2dCurves() const override;
0082
0083
0084 Standard_EXPORT void SectionShape(int& NbPoles, int& NbKnots, int& Degree) const override;
0085
0086
0087 Standard_EXPORT void Knots(NCollection_Array1<double>& TKnots) const override;
0088
0089
0090 Standard_EXPORT void Mults(NCollection_Array1<int>& TMults) const override;
0091
0092
0093 Standard_EXPORT bool IsRational() const override;
0094
0095
0096
0097 Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;
0098
0099
0100
0101
0102
0103
0104 Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
0105 const GeomAbs_Shape S) const override;
0106
0107
0108
0109
0110
0111 Standard_EXPORT void SetInterval(const double First, const double Last) override;
0112
0113
0114
0115
0116 Standard_EXPORT void Resolution(const int Index,
0117 const double Tol,
0118 double& TolU,
0119 double& TolV) const override;
0120
0121
0122
0123
0124
0125
0126 Standard_EXPORT void GetTolerance(const double BoundTol,
0127 const double SurfTol,
0128 const double AngleTol,
0129 NCollection_Array1<double>& Tol3d) const override;
0130
0131
0132
0133 Standard_EXPORT void SetTolerance(const double Tol3d, const double Tol2d) override;
0134
0135
0136
0137
0138 Standard_EXPORT gp_Pnt BarycentreOfSurf() const override;
0139
0140
0141
0142
0143 Standard_EXPORT double MaximalSection() const override;
0144
0145
0146
0147
0148 Standard_EXPORT void GetMinimalWeight(NCollection_Array1<double>& Weigths) const override;
0149
0150 Standard_EXPORT virtual void Point(const Blend_AppFunction& Func,
0151 const double Param,
0152 const math_Vector& Sol,
0153 Blend_Point& Pnt) const = 0;
0154
0155 Standard_EXPORT virtual void Vec(math_Vector& Sol, const Blend_Point& Pnt) const = 0;
0156
0157 DEFINE_STANDARD_RTTIEXT(BRepBlend_AppFuncRoot, Approx_SweepFunction)
0158
0159 Standard_EXPORT ~BRepBlend_AppFuncRoot();
0160
0161 protected:
0162 Standard_EXPORT BRepBlend_AppFuncRoot(occ::handle<BRepBlend_Line>& Line,
0163 Blend_AppFunction& Func,
0164 const double Tol3d,
0165 const double Tol2d);
0166
0167 private:
0168 Standard_EXPORT bool SearchPoint(Blend_AppFunction& Func, const double Param, Blend_Point& Pnt);
0169
0170 Standard_EXPORT bool SearchLocation(const double Param,
0171 const int FirstIndex,
0172 const int LastIndex,
0173 int& ParamIndex) const;
0174
0175 occ::handle<BRepBlend_Line> myLine;
0176 void* myFunc;
0177 math_Vector myTolerance;
0178 Blend_Point myPnt;
0179 gp_Pnt myBary;
0180 math_Vector X1;
0181 math_Vector X2;
0182 math_Vector XInit;
0183 math_Vector Sol;
0184 std::unique_ptr<math_FunctionSetRoot> mySolver;
0185 };
0186
0187 #endif