File indexing completed on 2025-01-18 10:03:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BSplSLib_HeaderFile
0018 #define _BSplSLib_HeaderFile
0019
0020 #include <BSplSLib_EvaluatorFunction.hxx>
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <TColgp_Array1OfPnt.hxx>
0024 #include <TColgp_Array2OfPnt.hxx>
0025 #include <TColStd_Array1OfInteger.hxx>
0026 #include <TColStd_Array1OfReal.hxx>
0027 #include <TColStd_Array2OfReal.hxx>
0028
0029 class gp_Pnt;
0030 class gp_Vec;
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086 class BSplSLib
0087 {
0088 public:
0089
0090 DEFINE_STANDARD_ALLOC
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177 Standard_EXPORT static void RationalDerivative (const Standard_Integer UDeg, const Standard_Integer VDeg, const Standard_Integer N, const Standard_Integer M, Standard_Real& Ders, Standard_Real& RDers, const Standard_Boolean All = Standard_True);
0178
0179 Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Real V, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, gp_Pnt& P);
0180
0181 Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Real V, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer Degree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv);
0182
0183 Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Real V, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv);
0184
0185 Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Real V, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, gp_Pnt& P, gp_Vec& Vu, gp_Vec& Vv, gp_Vec& Vuu, gp_Vec& Vvv, gp_Vec& Vuv, gp_Vec& Vuuu, gp_Vec& Vvvv, gp_Vec& Vuuv, gp_Vec& Vuvv);
0186
0187 Standard_EXPORT static void DN (const Standard_Real U, const Standard_Real V, const Standard_Integer Nu, const Standard_Integer Nv, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, gp_Vec& Vn);
0188
0189
0190
0191
0192 Standard_EXPORT static void Iso (const Standard_Real Param, const Standard_Boolean IsU, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, const Standard_Integer Degree, const Standard_Boolean Periodic, TColgp_Array1OfPnt& CPoles, TColStd_Array1OfReal* CWeights);
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203 Standard_EXPORT static void Reverse (TColgp_Array2OfPnt& Poles, const Standard_Integer Last, const Standard_Boolean UDirection);
0204
0205
0206
0207
0208
0209 Standard_EXPORT static void HomogeneousD0 (const Standard_Real U, const Standard_Real V, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, Standard_Real& W, gp_Pnt& P);
0210
0211
0212
0213
0214
0215 Standard_EXPORT static void HomogeneousD1 (const Standard_Real U, const Standard_Real V, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, gp_Pnt& N, gp_Vec& Nu, gp_Vec& Nv, Standard_Real& D, Standard_Real& Du, Standard_Real& Dv);
0216
0217
0218 Standard_EXPORT static void Reverse (TColStd_Array2OfReal& Weights, const Standard_Integer Last, const Standard_Boolean UDirection);
0219
0220
0221
0222
0223
0224
0225 Standard_EXPORT static Standard_Boolean IsRational (const TColStd_Array2OfReal& Weights, const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer J1, const Standard_Integer J2, const Standard_Real Epsilon = 0.0);
0226
0227
0228 Standard_EXPORT static void SetPoles (const TColgp_Array2OfPnt& Poles, TColStd_Array1OfReal& FP, const Standard_Boolean UDirection);
0229
0230
0231 Standard_EXPORT static void SetPoles (const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal& Weights, TColStd_Array1OfReal& FP, const Standard_Boolean UDirection);
0232
0233
0234 Standard_EXPORT static void GetPoles (const TColStd_Array1OfReal& FP, TColgp_Array2OfPnt& Poles, const Standard_Boolean UDirection);
0235
0236
0237 Standard_EXPORT static void GetPoles (const TColStd_Array1OfReal& FP, TColgp_Array2OfPnt& Poles, TColStd_Array2OfReal& Weights, const Standard_Boolean UDirection);
0238
0239
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252 Standard_EXPORT static void MovePoint (const Standard_Real U, const Standard_Real V, const gp_Vec& Displ, const Standard_Integer UIndex1, const Standard_Integer UIndex2, const Standard_Integer VIndex1, const Standard_Integer VIndex2, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean Rational, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal& Weights, const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& VFlatKnots, Standard_Integer& UFirstIndex, Standard_Integer& ULastIndex, Standard_Integer& VFirstIndex, Standard_Integer& VLastIndex, TColgp_Array2OfPnt& NewPoles);
0253
0254 Standard_EXPORT static void InsertKnots (const Standard_Boolean UDirection, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger* AddMults, TColgp_Array2OfPnt& NewPoles, TColStd_Array2OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True);
0255
0256 Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Boolean UDirection, const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array2OfPnt& NewPoles, TColStd_Array2OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance);
0257
0258 Standard_EXPORT static void IncreaseDegree (const Standard_Boolean UDirection, const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array2OfPnt& NewPoles, TColStd_Array2OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults);
0259
0260 Standard_EXPORT static void Unperiodize (const Standard_Boolean UDirection, const Standard_Integer Degree, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColgp_Array2OfPnt& NewPoles, TColStd_Array2OfReal* NewWeights);
0261
0262
0263 static TColStd_Array2OfReal* NoWeights();
0264
0265
0266
0267
0268
0269 Standard_EXPORT static void BuildCache (const Standard_Real U, const Standard_Real V, const Standard_Real USpanDomain, const Standard_Real VSpanDomain, const Standard_Boolean UPeriodicFlag, const Standard_Boolean VPeriodicFlag, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Integer UIndex, const Standard_Integer VIndex, const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& VFlatKnots, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, TColgp_Array2OfPnt& CachePoles, TColStd_Array2OfReal* CacheWeights);
0270
0271
0272
0273
0274 Standard_EXPORT static void BuildCache (const Standard_Real theU, const Standard_Real theV, const Standard_Real theUSpanDomain, const Standard_Real theVSpanDomain, const Standard_Boolean theUPeriodic, const Standard_Boolean theVPeriodic, const Standard_Integer theUDegree, const Standard_Integer theVDegree, const Standard_Integer theUIndex, const Standard_Integer theVIndex, const TColStd_Array1OfReal& theUFlatKnots, const TColStd_Array1OfReal& theVFlatKnots, const TColgp_Array2OfPnt& thePoles, const TColStd_Array2OfReal* theWeights, TColStd_Array2OfReal& theCacheArray);
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287 Standard_EXPORT static void CacheD0 (const Standard_Real U, const Standard_Real V, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Real UCacheParameter, const Standard_Real VCacheParameter, const Standard_Real USpanLenght, const Standard_Real VSpanLength, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point);
0288
0289
0290
0291
0292 static void CoefsD0 (const Standard_Real U, const Standard_Real V, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point);
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305 Standard_EXPORT static void CacheD1 (const Standard_Real U, const Standard_Real V, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Real UCacheParameter, const Standard_Real VCacheParameter, const Standard_Real USpanLenght, const Standard_Real VSpanLength, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point, gp_Vec& VecU, gp_Vec& VecV);
0306
0307
0308
0309
0310 static void CoefsD1 (const Standard_Real U, const Standard_Real V, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point, gp_Vec& VecU, gp_Vec& VecV);
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323 Standard_EXPORT static void CacheD2 (const Standard_Real U, const Standard_Real V, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Real UCacheParameter, const Standard_Real VCacheParameter, const Standard_Real USpanLenght, const Standard_Real VSpanLength, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point, gp_Vec& VecU, gp_Vec& VecV, gp_Vec& VecUU, gp_Vec& VecUV, gp_Vec& VecVV);
0324
0325
0326
0327
0328 static void CoefsD2 (const Standard_Real U, const Standard_Real V, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point, gp_Vec& VecU, gp_Vec& VecV, gp_Vec& VecUU, gp_Vec& VecUV, gp_Vec& VecVV);
0329
0330
0331 static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, TColgp_Array2OfPnt& CachePoles);
0332
0333
0334
0335
0336
0337 Standard_EXPORT static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, TColgp_Array2OfPnt& CachePoles, TColStd_Array2OfReal* CacheWeights);
0338
0339
0340
0341
0342
0343
0344
0345
0346 Standard_EXPORT static void Resolution (const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger& VMults, const Standard_Integer UDegree, const Standard_Integer VDegree, const Standard_Boolean URat, const Standard_Boolean VRat, const Standard_Boolean UPer, const Standard_Boolean VPer, const Standard_Real Tolerance3D, Standard_Real& UTolerance, Standard_Real& VTolerance);
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365 Standard_EXPORT static void Interpolate (const Standard_Integer UDegree, const Standard_Integer VDegree, const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& VFlatKnots, const TColStd_Array1OfReal& UParameters, const TColStd_Array1OfReal& VParameters, TColgp_Array2OfPnt& Poles, TColStd_Array2OfReal& Weights, Standard_Integer& InversionProblem);
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383 Standard_EXPORT static void Interpolate (const Standard_Integer UDegree, const Standard_Integer VDegree, const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& VFlatKnots, const TColStd_Array1OfReal& UParameters, const TColStd_Array1OfReal& VParameters, TColgp_Array2OfPnt& Poles, Standard_Integer& InversionProblem);
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402
0403
0404
0405
0406
0407
0408
0409
0410 Standard_EXPORT static void FunctionMultiply (const BSplSLib_EvaluatorFunction& Function, const Standard_Integer UBSplineDegree, const Standard_Integer VBSplineDegree, const TColStd_Array1OfReal& UBSplineKnots, const TColStd_Array1OfReal& VBSplineKnots, const TColStd_Array1OfInteger* UMults, const TColStd_Array1OfInteger* VMults, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& VFlatKnots, const Standard_Integer UNewDegree, const Standard_Integer VNewDegree, TColgp_Array2OfPnt& NewNumerator, TColStd_Array2OfReal& NewDenominator, Standard_Integer& theStatus);
0411
0412
0413
0414
0415 protected:
0416
0417
0418
0419
0420
0421 private:
0422
0423
0424
0425
0426
0427 };
0428
0429
0430 #include <BSplSLib.lxx>
0431
0432
0433
0434
0435
0436 #endif