File indexing completed on 2025-01-18 10:02:58
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 <Standard_Integer.hxx>
0025 #include <TColgp_HArray2OfPnt.hxx>
0026 #include <TColStd_HArray2OfReal.hxx>
0027 #include <TColStd_HArray1OfReal.hxx>
0028 #include <TColStd_HArray1OfInteger.hxx>
0029 #include <TColgp_SequenceOfArray1OfPnt2d.hxx>
0030 #include <Approx_HArray1OfGTrsf2d.hxx>
0031 #include <gp_Vec.hxx>
0032 #include <TColgp_HArray1OfPnt.hxx>
0033 #include <TColgp_HArray1OfPnt2d.hxx>
0034 #include <TColgp_HArray1OfVec.hxx>
0035 #include <TColgp_HArray1OfVec2d.hxx>
0036 #include <GeomAbs_Shape.hxx>
0037 #include <AdvApprox_EvaluatorFunction.hxx>
0038 #include <TColgp_Array2OfPnt.hxx>
0039 #include <TColStd_Array2OfReal.hxx>
0040 #include <TColStd_Array1OfReal.hxx>
0041 #include <TColStd_Array1OfInteger.hxx>
0042 #include <TColgp_Array1OfPnt2d.hxx>
0043 #include <Standard_OStream.hxx>
0044 class Approx_SweepFunction;
0045 class AdvApprox_Cutting;
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 class Approx_SweepApproximation
0058 {
0059 public:
0060
0061 DEFINE_STANDARD_ALLOC
0062
0063
0064 Standard_EXPORT Approx_SweepApproximation(const Handle(Approx_SweepFunction)& Func);
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081 Standard_EXPORT void Perform (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol3d, const Standard_Real BoundTol, const Standard_Real Tol2d, const Standard_Real TolAngular, const GeomAbs_Shape Continuity = GeomAbs_C0, const Standard_Integer Degmax = 11, const Standard_Integer Segmax = 50);
0082
0083
0084 Standard_EXPORT Standard_Integer Eval (const Standard_Real Parameter, const Standard_Integer DerivativeRequest, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
0085
0086
0087 Standard_Boolean IsDone() const;
0088
0089 Standard_EXPORT void SurfShape (Standard_Integer& UDegree, Standard_Integer& VDegree, Standard_Integer& NbUPoles, Standard_Integer& NbVPoles, Standard_Integer& NbUKnots, Standard_Integer& NbVKnots) const;
0090
0091 Standard_EXPORT void Surface (TColgp_Array2OfPnt& TPoles, TColStd_Array2OfReal& TWeights, TColStd_Array1OfReal& TUKnots, TColStd_Array1OfReal& TVKnots, TColStd_Array1OfInteger& TUMults, TColStd_Array1OfInteger& TVMults) const;
0092
0093 Standard_Integer UDegree() const;
0094
0095 Standard_Integer VDegree() const;
0096
0097 const TColgp_Array2OfPnt& SurfPoles() const;
0098
0099 const TColStd_Array2OfReal& SurfWeights() const;
0100
0101 const TColStd_Array1OfReal& SurfUKnots() const;
0102
0103 const TColStd_Array1OfReal& SurfVKnots() const;
0104
0105 const TColStd_Array1OfInteger& SurfUMults() const;
0106
0107 const TColStd_Array1OfInteger& SurfVMults() const;
0108
0109
0110 Standard_EXPORT Standard_Real MaxErrorOnSurf() const;
0111
0112
0113 Standard_EXPORT Standard_Real AverageErrorOnSurf() const;
0114
0115 Standard_Integer NbCurves2d() const;
0116
0117 Standard_EXPORT void Curves2dShape (Standard_Integer& Degree, Standard_Integer& NbPoles, Standard_Integer& NbKnots) const;
0118
0119 Standard_EXPORT void Curve2d (const Standard_Integer Index, TColgp_Array1OfPnt2d& TPoles, TColStd_Array1OfReal& TKnots, TColStd_Array1OfInteger& TMults) const;
0120
0121 Standard_Integer Curves2dDegree() const;
0122
0123 const TColgp_Array1OfPnt2d& Curve2dPoles (const Standard_Integer Index) const;
0124
0125 const TColStd_Array1OfReal& Curves2dKnots() const;
0126
0127 const TColStd_Array1OfInteger& Curves2dMults() const;
0128
0129
0130
0131 Standard_EXPORT Standard_Real Max2dError (const Standard_Integer Index) const;
0132
0133
0134
0135 Standard_EXPORT Standard_Real Average2dError (const Standard_Integer Index) const;
0136
0137
0138
0139 Standard_EXPORT Standard_Real TolCurveOnSurf (const Standard_Integer Index) const;
0140
0141
0142 Standard_EXPORT void Dump (Standard_OStream& o) const;
0143
0144
0145
0146
0147 protected:
0148
0149
0150
0151
0152
0153 private:
0154
0155
0156 Standard_EXPORT void Approximation (const Handle(TColStd_HArray1OfReal)& OneDTol, const Handle(TColStd_HArray1OfReal)& TwoDTol, const Handle(TColStd_HArray1OfReal)& ThreeDTol, const Standard_Real BounTol, const Standard_Real First, const Standard_Real Last, const GeomAbs_Shape Continuity, const Standard_Integer Degmax, const Standard_Integer Segmax, const AdvApprox_EvaluatorFunction& TheApproxFunction, const AdvApprox_Cutting& TheCuttingTool);
0157
0158 Standard_EXPORT Standard_Boolean D0 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
0159
0160 Standard_EXPORT Standard_Boolean D1 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
0161
0162 Standard_EXPORT Standard_Boolean D2 (const Standard_Real Param, const Standard_Real First, const Standard_Real Last, Standard_Real& Result);
0163
0164
0165 Handle(Approx_SweepFunction) myFunc;
0166 Standard_Boolean done;
0167 Standard_Integer Num1DSS;
0168 Standard_Integer Num2DSS;
0169 Standard_Integer Num3DSS;
0170 Standard_Integer udeg;
0171 Standard_Integer vdeg;
0172 Standard_Integer deg2d;
0173 Handle(TColgp_HArray2OfPnt) tabPoles;
0174 Handle(TColStd_HArray2OfReal) tabWeights;
0175 Handle(TColStd_HArray1OfReal) tabUKnots;
0176 Handle(TColStd_HArray1OfReal) tabVKnots;
0177 Handle(TColStd_HArray1OfReal) tab2dKnots;
0178 Handle(TColStd_HArray1OfInteger) tabUMults;
0179 Handle(TColStd_HArray1OfInteger) tabVMults;
0180 Handle(TColStd_HArray1OfInteger) tab2dMults;
0181 TColgp_SequenceOfArray1OfPnt2d seqPoles2d;
0182 Handle(TColStd_HArray1OfReal) MError1d;
0183 Handle(TColStd_HArray1OfReal) tab2dError;
0184 Handle(TColStd_HArray1OfReal) MError3d;
0185 Handle(TColStd_HArray1OfReal) AError1d;
0186 Handle(TColStd_HArray1OfReal) Ave2dError;
0187 Handle(TColStd_HArray1OfReal) AError3d;
0188 Handle(Approx_HArray1OfGTrsf2d) AAffin;
0189 Handle(TColStd_HArray1OfReal) COnSurfErr;
0190 gp_Vec Translation;
0191 Handle(TColgp_HArray1OfPnt) myPoles;
0192 Handle(TColgp_HArray1OfPnt2d) myPoles2d;
0193 Handle(TColStd_HArray1OfReal) myWeigths;
0194 Handle(TColgp_HArray1OfVec) myDPoles;
0195 Handle(TColgp_HArray1OfVec) myD2Poles;
0196 Handle(TColgp_HArray1OfVec2d) myDPoles2d;
0197 Handle(TColgp_HArray1OfVec2d) myD2Poles2d;
0198 Handle(TColStd_HArray1OfReal) myDWeigths;
0199 Handle(TColStd_HArray1OfReal) myD2Weigths;
0200 Standard_Integer myOrder;
0201 Standard_Real myParam;
0202 Standard_Real first;
0203 Standard_Real last;
0204
0205
0206 };
0207
0208
0209 #include <Approx_SweepApproximation.lxx>
0210
0211
0212
0213
0214
0215 #endif