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_SameParameter_HeaderFile
0018 #define _Approx_SameParameter_HeaderFile
0019
0020 #include <Adaptor3d_CurveOnSurface.hxx>
0021 #include <Adaptor3d_Surface.hxx>
0022
0023 class Geom_Curve;
0024 class Geom2d_Curve;
0025 class Geom_Surface;
0026
0027
0028
0029
0030 class Approx_SameParameter
0031 {
0032 public:
0033
0034 DEFINE_STANDARD_ALLOC
0035
0036
0037 Standard_EXPORT Approx_SameParameter(const Handle(Geom_Curve)& C3D,
0038 const Handle(Geom2d_Curve)& C2D,
0039 const Handle(Geom_Surface)& S,
0040 const Standard_Real Tol);
0041
0042
0043 Standard_EXPORT Approx_SameParameter(const Handle(Adaptor3d_Curve)& C3D,
0044 const Handle(Geom2d_Curve)& C2D,
0045 const Handle(Adaptor3d_Surface)& S,
0046 const Standard_Real Tol);
0047
0048
0049 Standard_EXPORT Approx_SameParameter(const Handle(Adaptor3d_Curve)& C3D,
0050 const Handle(Adaptor2d_Curve2d)& C2D,
0051 const Handle(Adaptor3d_Surface)& S,
0052 const Standard_Real Tol);
0053
0054
0055
0056 Standard_Boolean IsDone() const
0057 {
0058 return myDone;
0059 }
0060
0061
0062
0063 Standard_Real TolReached() const
0064 {
0065 return myTolReached;
0066 }
0067
0068
0069
0070
0071 Standard_Boolean IsSameParameter() const
0072 {
0073 return mySameParameter;
0074 }
0075
0076
0077
0078
0079 Handle(Geom2d_Curve) Curve2d() const
0080 {
0081 return myCurve2d;
0082 }
0083
0084
0085
0086
0087 Handle(Adaptor3d_Curve) Curve3d() const
0088 {
0089 return myC3d;
0090 }
0091
0092
0093
0094 Handle(Adaptor3d_CurveOnSurface) CurveOnSurface() const
0095 {
0096 return myCurveOnSurface;
0097 }
0098
0099 private:
0100
0101
0102
0103
0104 struct Approx_SameParameter_Data
0105 {
0106 Adaptor3d_CurveOnSurface myCOnS;
0107 Standard_Integer myNbPnt;
0108 Standard_Real *myPC3d;
0109 Standard_Real *myPC2d;
0110
0111
0112 Standard_Real *myNewPC3d;
0113 Standard_Real *myNewPC2d;
0114
0115
0116 Standard_Real myC3dPF;
0117 Standard_Real myC3dPL;
0118 Standard_Real myC2dPF;
0119 Standard_Real myC2dPL;
0120
0121 Standard_Real myTol;
0122
0123
0124 void Swap(const Standard_Integer theNewNbPoints)
0125 {
0126 myNbPnt = theNewNbPoints;
0127 Standard_Real * temp;
0128
0129
0130 temp = myPC3d;
0131 myPC3d = myNewPC3d;
0132 myNewPC3d = temp;
0133
0134
0135 temp = myPC2d;
0136 myPC2d = myNewPC2d;
0137 myNewPC2d = temp;
0138 }
0139 };
0140
0141
0142 Approx_SameParameter(const Approx_SameParameter &);
0143 Approx_SameParameter& operator=(const Approx_SameParameter &);
0144
0145
0146 Standard_EXPORT void Build (const Standard_Real Tol);
0147
0148
0149 Standard_Boolean BuildInitialDistribution(Approx_SameParameter_Data &theData) const;
0150
0151
0152
0153
0154 Standard_Boolean IncreaseInitialNbSamples(Approx_SameParameter_Data &theData) const;
0155
0156
0157
0158 Standard_Boolean ComputeTangents(const Adaptor3d_CurveOnSurface & theCOnS,
0159 Standard_Real &theFirstTangent,
0160 Standard_Real &theLastTangent) const;
0161
0162
0163
0164
0165 Standard_Boolean CheckSameParameter(Approx_SameParameter_Data &theData,
0166 Standard_Real &theSqDist) const;
0167
0168
0169
0170 Standard_Boolean Interpolate(const Approx_SameParameter_Data & theData,
0171 const Standard_Real aTangFirst,
0172 const Standard_Real aTangLast,
0173 TColStd_Array1OfReal & thePoles,
0174 TColStd_Array1OfReal & theFlatKnots) const;
0175
0176
0177
0178 Standard_Boolean IncreaseNbPoles(const TColStd_Array1OfReal & thePoles,
0179 const TColStd_Array1OfReal & theFlatKnots,
0180 Approx_SameParameter_Data & theData,
0181 Standard_Real &theBestSqTol) const;
0182
0183 static const Standard_Integer myNbSamples = 22;
0184 static const Standard_Integer myMaxArraySize = 1000;
0185 const Standard_Real myDeltaMin;
0186
0187 Standard_Boolean mySameParameter;
0188 Standard_Boolean myDone;
0189 Standard_Real myTolReached;
0190 Handle(Geom2d_Curve) myCurve2d;
0191 Handle(Adaptor2d_Curve2d) myHCurve2d;
0192 Handle(Adaptor3d_Curve) myC3d;
0193 Handle(Adaptor3d_Surface) mySurf;
0194 Handle(Adaptor3d_CurveOnSurface) myCurveOnSurface;
0195 };
0196
0197 #endif