File indexing completed on 2026-10-01 08:59:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Approx_SweepApproximation_HeaderFile
0018 #define _Approx_SweepApproximation_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023
0024 #include <AdvApprox_EvaluatorFunction.hxx>
0025 #include <NCollection_Array1.hxx>
0026 #include <gp_GTrsf2d.hxx>
0027 #include <NCollection_HArray1.hxx>
0028 #include <GeomAbs_Shape.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <Standard_OStream.hxx>
0031 #include <NCollection_Array2.hxx>
0032 #include <NCollection_HArray2.hxx>
0033 #include <gp_Pnt2d.hxx>
0034 #include <gp_Pnt.hxx>
0035 #include <gp_Vec.hxx>
0036 #include <gp_Vec2d.hxx>
0037 #include <NCollection_Sequence.hxx>
0038 class Approx_SweepFunction;
0039 class AdvApprox_Cutting;
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 class Approx_SweepApproximation
0051 {
0052 public:
0053 DEFINE_STANDARD_ALLOC
0054
0055 Standard_EXPORT Approx_SweepApproximation(const occ::handle<Approx_SweepFunction>& Func);
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072 Standard_EXPORT void Perform(const double First,
0073 const double Last,
0074 const double Tol3d,
0075 const double BoundTol,
0076 const double Tol2d,
0077 const double TolAngular,
0078 const GeomAbs_Shape Continuity = GeomAbs_C0,
0079 const int Degmax = 11,
0080 const int Segmax = 50);
0081
0082
0083 Standard_EXPORT int Eval(const double Parameter,
0084 const int DerivativeRequest,
0085 const double First,
0086 const double Last,
0087 double& Result);
0088
0089
0090 bool IsDone() const;
0091
0092 Standard_EXPORT void SurfShape(int& UDegree,
0093 int& VDegree,
0094 int& NbUPoles,
0095 int& NbVPoles,
0096 int& NbUKnots,
0097 int& NbVKnots) const;
0098
0099 Standard_EXPORT void Surface(NCollection_Array2<gp_Pnt>& TPoles,
0100 NCollection_Array2<double>& TWeights,
0101 NCollection_Array1<double>& TUKnots,
0102 NCollection_Array1<double>& TVKnots,
0103 NCollection_Array1<int>& TUMults,
0104 NCollection_Array1<int>& TVMults) const;
0105
0106 int UDegree() const;
0107
0108 int VDegree() const;
0109
0110 const NCollection_Array2<gp_Pnt>& SurfPoles() const;
0111
0112 const NCollection_Array2<double>& SurfWeights() const;
0113
0114 const NCollection_Array1<double>& SurfUKnots() const;
0115
0116 const NCollection_Array1<double>& SurfVKnots() const;
0117
0118 const NCollection_Array1<int>& SurfUMults() const;
0119
0120 const NCollection_Array1<int>& SurfVMults() const;
0121
0122
0123 Standard_EXPORT double MaxErrorOnSurf() const;
0124
0125
0126 Standard_EXPORT double AverageErrorOnSurf() const;
0127
0128 int NbCurves2d() const;
0129
0130 Standard_EXPORT void Curves2dShape(int& Degree, int& NbPoles, int& NbKnots) const;
0131
0132 Standard_EXPORT void Curve2d(const int Index,
0133 NCollection_Array1<gp_Pnt2d>& TPoles,
0134 NCollection_Array1<double>& TKnots,
0135 NCollection_Array1<int>& TMults) const;
0136
0137 int Curves2dDegree() const;
0138
0139 const NCollection_Array1<gp_Pnt2d>& Curve2dPoles(const int Index) const;
0140
0141 const NCollection_Array1<double>& Curves2dKnots() const;
0142
0143 const NCollection_Array1<int>& Curves2dMults() const;
0144
0145
0146
0147 Standard_EXPORT double Max2dError(const int Index) const;
0148
0149
0150
0151 Standard_EXPORT double Average2dError(const int Index) const;
0152
0153
0154
0155 Standard_EXPORT double TolCurveOnSurf(const int Index) const;
0156
0157
0158 Standard_EXPORT void Dump(Standard_OStream& o) const;
0159
0160 private:
0161 Standard_EXPORT void Approximation(const occ::handle<NCollection_HArray1<double>>& OneDTol,
0162 const occ::handle<NCollection_HArray1<double>>& TwoDTol,
0163 const occ::handle<NCollection_HArray1<double>>& ThreeDTol,
0164 const double BounTol,
0165 const double First,
0166 const double Last,
0167 const GeomAbs_Shape Continuity,
0168 const int Degmax,
0169 const int Segmax,
0170 const AdvApprox_EvaluatorFunction& TheApproxFunction,
0171 const AdvApprox_Cutting& TheCuttingTool);
0172
0173 Standard_EXPORT bool D0(const double Param,
0174 const double First,
0175 const double Last,
0176 double& Result);
0177
0178 Standard_EXPORT bool D1(const double Param,
0179 const double First,
0180 const double Last,
0181 double& Result);
0182
0183 Standard_EXPORT bool D2(const double Param,
0184 const double First,
0185 const double Last,
0186 double& Result);
0187
0188 occ::handle<Approx_SweepFunction> myFunc;
0189 bool done;
0190 int Num1DSS;
0191 int Num2DSS;
0192 int Num3DSS;
0193 int udeg;
0194 int vdeg;
0195 int deg2d;
0196 occ::handle<NCollection_HArray2<gp_Pnt>> tabPoles;
0197 occ::handle<NCollection_HArray2<double>> tabWeights;
0198 occ::handle<NCollection_HArray1<double>> tabUKnots;
0199 occ::handle<NCollection_HArray1<double>> tabVKnots;
0200 occ::handle<NCollection_HArray1<double>> tab2dKnots;
0201 occ::handle<NCollection_HArray1<int>> tabUMults;
0202 occ::handle<NCollection_HArray1<int>> tabVMults;
0203 occ::handle<NCollection_HArray1<int>> tab2dMults;
0204 NCollection_Sequence<occ::handle<NCollection_HArray1<gp_Pnt2d>>> seqPoles2d;
0205 occ::handle<NCollection_HArray1<double>> MError1d;
0206 occ::handle<NCollection_HArray1<double>> tab2dError;
0207 occ::handle<NCollection_HArray1<double>> MError3d;
0208 occ::handle<NCollection_HArray1<double>> AError1d;
0209 occ::handle<NCollection_HArray1<double>> Ave2dError;
0210 occ::handle<NCollection_HArray1<double>> AError3d;
0211 occ::handle<NCollection_HArray1<gp_GTrsf2d>> AAffin;
0212 occ::handle<NCollection_HArray1<double>> COnSurfErr;
0213 gp_Vec Translation;
0214 occ::handle<NCollection_HArray1<gp_Pnt>> myPoles;
0215 occ::handle<NCollection_HArray1<gp_Pnt2d>> myPoles2d;
0216 occ::handle<NCollection_HArray1<double>> myWeigths;
0217 occ::handle<NCollection_HArray1<gp_Vec>> myDPoles;
0218 occ::handle<NCollection_HArray1<gp_Vec>> myD2Poles;
0219 occ::handle<NCollection_HArray1<gp_Vec2d>> myDPoles2d;
0220 occ::handle<NCollection_HArray1<gp_Vec2d>> myD2Poles2d;
0221 occ::handle<NCollection_HArray1<double>> myDWeigths;
0222 occ::handle<NCollection_HArray1<double>> myD2Weigths;
0223 int myOrder;
0224 double myParam;
0225 double first;
0226 double last;
0227 };
0228
0229 #include <Approx_SweepApproximation.lxx>
0230
0231 #endif