1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0026042: OCCT won't work with the latest Xcode

Dereferenced null pointers was eliminated for PLib, BSplCLib and BSplSLib. All affected code was changed accordingly.
This commit is contained in:
akz 2015-09-23 16:31:15 +03:00 committed by bugmaster
parent 42a9dcfc64
commit 0e14656b30
53 changed files with 867 additions and 906 deletions

View File

@ -143,7 +143,7 @@ AppParCurves_Gradient::
for (k = 1; k <= nbP3d; k++) { for (k = 1; k <= nbP3d; k++) {
for (l=1; l<=deg+1; l++) TabCoef(l) = TheCoef(l+i2); for (l=1; l<=deg+1; l++) TabCoef(l) = TheCoef(l+i2);
i2 += deg+1; i2 += deg+1;
BSplCLib::CoefsD1(UF, TabCoef, PLib::NoWeights(), Pt, V1); BSplCLib::CoefsD1(UF, TabCoef, BSplCLib::NoWeights(), Pt, V1);
MyV = gp_Vec(Pt, TabP(k)); MyV = gp_Vec(Pt, TabP(k));
FU += MyV*V1; FU += MyV*V1;
DFU += V1.SquareMagnitude(); DFU += V1.SquareMagnitude();
@ -152,7 +152,7 @@ AppParCurves_Gradient::
for (k = 1; k <= nbP2d; k++) { for (k = 1; k <= nbP2d; k++) {
for (l=1; l<=deg+1; l++) TabCoef2d(l) = TheCoef2d(l+i2); for (l=1; l<=deg+1; l++) TabCoef2d(l) = TheCoef2d(l+i2);
i2 += deg+1; i2 += deg+1;
BSplCLib::CoefsD1(UF, TabCoef2d, PLib::NoWeights(), Pt2d, V12d); BSplCLib::CoefsD1(UF, TabCoef2d, BSplCLib::NoWeights(), Pt2d, V12d);
MyV2d = gp_Vec2d(Pt2d, TabP2d(k)); MyV2d = gp_Vec2d(Pt2d, TabP2d(k));
FU += MyV2d*V12d; FU += MyV2d*V12d;
DFU += V12d.SquareMagnitude(); DFU += V12d.SquareMagnitude();

View File

@ -172,7 +172,7 @@ void AppParCurves_MultiBSpCurve::Value (const Standard_Integer CuIndex,
Curve(CuIndex, TabPoles); Curve(CuIndex, TabPoles);
BSplCLib::D0(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(), BSplCLib::D0(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
myknots->Array1(),mymults->Array1(),Pt); myknots->Array1(),&mymults->Array1(),Pt);
} }
@ -192,7 +192,7 @@ void AppParCurves_MultiBSpCurve::Value (const Standard_Integer CuIndex,
Curve(CuIndex, TabPoles); Curve(CuIndex, TabPoles);
BSplCLib::D0(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(), BSplCLib::D0(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
myknots->Array1(),mymults->Array1(),Pt); myknots->Array1(),&mymults->Array1(),Pt);
} }
@ -211,7 +211,7 @@ void AppParCurves_MultiBSpCurve::D1 (const Standard_Integer CuIndex,
Curve(CuIndex, TabPoles); Curve(CuIndex, TabPoles);
BSplCLib::D1(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(), BSplCLib::D1(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
myknots->Array1(),mymults->Array1(),Pt,V1); myknots->Array1(),&mymults->Array1(),Pt,V1);
} }
@ -233,7 +233,7 @@ void AppParCurves_MultiBSpCurve::D2 (const Standard_Integer CuIndex,
Curve(CuIndex, TabPoles); Curve(CuIndex, TabPoles);
BSplCLib::D2(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(), BSplCLib::D2(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
myknots->Array1(),mymults->Array1(),Pt,V1,V2); myknots->Array1(),&mymults->Array1(),Pt,V1,V2);
} }
@ -252,7 +252,7 @@ void AppParCurves_MultiBSpCurve::D1 (const Standard_Integer CuIndex,
Curve(CuIndex, TabPoles); Curve(CuIndex, TabPoles);
BSplCLib::D1(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(), BSplCLib::D1(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
myknots->Array1(),mymults->Array1(),Pt,V1); myknots->Array1(),&mymults->Array1(),Pt,V1);
} }
@ -274,7 +274,7 @@ void AppParCurves_MultiBSpCurve::D2 (const Standard_Integer CuIndex,
Curve(CuIndex, TabPoles); Curve(CuIndex, TabPoles);
BSplCLib::D2(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(), BSplCLib::D2(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
myknots->Array1(),mymults->Array1(),Pt,V1,V2); myknots->Array1(),&mymults->Array1(),Pt,V1,V2);
} }

View File

@ -187,7 +187,7 @@ void AppParCurves_MultiCurve::Value (const Standard_Integer CuIndex,
TabPoles(i) = tabPoint->Value(i).Point(CuIndex); TabPoles(i) = tabPoint->Value(i).Point(CuIndex);
} }
BSplCLib::D0 (U, TabPoles,PLib::NoWeights(), Pt); BSplCLib::D0 (U, TabPoles,BSplCLib::NoWeights(), Pt);
} }
@ -203,7 +203,7 @@ void AppParCurves_MultiCurve::Value (const Standard_Integer CuIndex,
TabPole(i) = tabPoint->Value(i).Point2d(CuIndex); TabPole(i) = tabPoint->Value(i).Point2d(CuIndex);
} }
BSplCLib::D0 (U, TabPole, PLib::NoWeights(), Pt); BSplCLib::D0 (U, TabPole, BSplCLib::NoWeights(), Pt);
} }
@ -222,7 +222,7 @@ void AppParCurves_MultiCurve::D1 (const Standard_Integer CuIndex,
TabPole(i) = tabPoint->Value(i).Point(CuIndex); TabPole(i) = tabPoint->Value(i).Point(CuIndex);
} }
BSplCLib::D1 (U, TabPole, PLib::NoWeights(), Pt, V1); BSplCLib::D1 (U, TabPole, BSplCLib::NoWeights(), Pt, V1);
} }
@ -242,7 +242,7 @@ void AppParCurves_MultiCurve::D2 (const Standard_Integer CuIndex,
TabPole(i) = tabPoint->Value(i).Point(CuIndex); TabPole(i) = tabPoint->Value(i).Point(CuIndex);
} }
BSplCLib::D2 (U, TabPole, PLib::NoWeights(), Pt, V1, V2); BSplCLib::D2 (U, TabPole, BSplCLib::NoWeights(), Pt, V1, V2);
} }
@ -259,7 +259,7 @@ void AppParCurves_MultiCurve::D1 (const Standard_Integer CuIndex,
TabPole(i) = tabPoint->Value(i).Point2d(CuIndex); TabPole(i) = tabPoint->Value(i).Point2d(CuIndex);
} }
BSplCLib::D1 (U, TabPole, PLib::NoWeights(), Pt, V1); BSplCLib::D1 (U, TabPole, BSplCLib::NoWeights(), Pt, V1);
} }
@ -279,7 +279,7 @@ void AppParCurves_MultiCurve::D2 (const Standard_Integer CuIndex,
TabPole(i) = tabPoint->Value(i).Point2d(CuIndex); TabPole(i) = tabPoint->Value(i).Point2d(CuIndex);
} }
BSplCLib::D2(U, TabPole, PLib::NoWeights(), Pt, V1, V2); BSplCLib::D2(U, TabPole, BSplCLib::NoWeights(), Pt, V1, V2);
} }

View File

@ -194,8 +194,8 @@ void Approx_MCurvesToBSpCurve::Perform
Inc = deg-mydegre; Inc = deg-mydegre;
TColgp_Array1OfPnt Points(1, deg+1); TColgp_Array1OfPnt Points(1, deg+1);
if (Inc > 0) { if (Inc > 0) {
BSplCLib::IncreaseDegree(deg, ThePoles, PLib::NoWeights(), BSplCLib::IncreaseDegree(deg, ThePoles, BSplCLib::NoWeights(),
Points, PLib::NoWeights()); Points, BSplCLib::NoWeights());
} }
else { else {
Points = ThePoles; Points = ThePoles;
@ -215,8 +215,8 @@ void Approx_MCurvesToBSpCurve::Perform
Inc = deg-mydegre; Inc = deg-mydegre;
TColgp_Array1OfPnt2d Points2d(1, deg+1); TColgp_Array1OfPnt2d Points2d(1, deg+1);
if (Inc > 0) { if (Inc > 0) {
BSplCLib::IncreaseDegree(deg, ThePoles2d, PLib::NoWeights(), BSplCLib::IncreaseDegree(deg, ThePoles2d, BSplCLib::NoWeights(),
Points2d, PLib::NoWeights()); Points2d, BSplCLib::NoWeights());
} }
else { else {
Points2d = ThePoles2d; Points2d = ThePoles2d;

View File

@ -315,21 +315,21 @@ void BSplCLib::LocateParameter
void BSplCLib::LocateParameter void BSplCLib::LocateParameter
(const Standard_Integer Degree, (const Standard_Integer Degree,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
const Standard_Real U, const Standard_Real U,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
Standard_Integer& KnotIndex, Standard_Integer& KnotIndex,
Standard_Real& NewU) Standard_Real& NewU)
{ {
Standard_Integer first,last; Standard_Integer first,last;
if (&Mults) { if (Mults) {
if (Periodic) { if (Periodic) {
first = Knots.Lower(); first = Knots.Lower();
last = Knots.Upper(); last = Knots.Upper();
} }
else { else {
first = FirstUKnotIndex(Degree,Mults); first = FirstUKnotIndex(Degree,*Mults);
last = LastUKnotIndex (Degree,Mults); last = LastUKnotIndex (Degree,*Mults);
} }
} }
else { else {
@ -1453,14 +1453,14 @@ void BSplCLib::BuildKnots(const Standard_Integer Degree,
const Standard_Integer Index, const Standard_Integer Index,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Standard_Real& LK) Standard_Real& LK)
{ {
Standard_Integer KLower = Knots.Lower(); Standard_Integer KLower = Knots.Lower();
const Standard_Real * pkn = &Knots(KLower); const Standard_Real * pkn = &Knots(KLower);
pkn -= KLower; pkn -= KLower;
Standard_Real *knot = &LK; Standard_Real *knot = &LK;
if (&Mults == NULL) { if (Mults == NULL) {
switch (Degree) { switch (Degree) {
case 1 : { case 1 : {
Standard_Integer j = Index ; Standard_Integer j = Index ;
@ -1544,9 +1544,9 @@ void BSplCLib::BuildKnots(const Standard_Integer Degree,
Standard_Integer i; Standard_Integer i;
Standard_Integer Deg1 = Degree - 1; Standard_Integer Deg1 = Degree - 1;
Standard_Integer KUpper = Knots.Upper(); Standard_Integer KUpper = Knots.Upper();
Standard_Integer MLower = Mults.Lower(); Standard_Integer MLower = Mults->Lower();
Standard_Integer MUpper = Mults.Upper(); Standard_Integer MUpper = Mults->Upper();
const Standard_Integer * pmu = &Mults(MLower); const Standard_Integer * pmu = &(*Mults)(MLower);
pmu -= MLower; pmu -= MLower;
Standard_Real dknot = 0; Standard_Real dknot = 0;
Standard_Integer ilow = Index , mlow = 0; Standard_Integer ilow = Index , mlow = 0;
@ -1692,13 +1692,13 @@ Standard_Boolean BSplCLib::PrepareInsertKnots
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfReal& AddKnots,
const TColStd_Array1OfInteger& AddMults, const TColStd_Array1OfInteger* AddMults,
Standard_Integer& NbPoles, Standard_Integer& NbPoles,
Standard_Integer& NbKnots, Standard_Integer& NbKnots,
const Standard_Real Tolerance, const Standard_Real Tolerance,
const Standard_Boolean Add) const Standard_Boolean Add)
{ {
Standard_Boolean addflat = &AddMults == NULL; Standard_Boolean addflat = AddMults == NULL;
Standard_Integer first,last; Standard_Integer first,last;
if (Periodic) { if (Periodic) {
@ -1745,14 +1745,14 @@ Standard_Boolean BSplCLib::PrepareInsertKnots
} }
if (addflat) amult = 1; if (addflat) amult = 1;
else amult = Max(0,AddMults(ak)); else amult = Max(0,(*AddMults)(ak));
while ((ak < AddKnots.Upper()) && while ((ak < AddKnots.Upper()) &&
(Abs(au - AddKnots(ak+1)) <= Eps)) { (Abs(au - AddKnots(ak+1)) <= Eps)) {
ak++; ak++;
if (Add) { if (Add) {
if (addflat) amult++; if (addflat) amult++;
else amult += Max(0,AddMults(ak)); else amult += Max(0,(*AddMults)(ak));
} }
} }
@ -1875,14 +1875,14 @@ void BSplCLib::InsertKnots
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfReal& AddKnots,
const TColStd_Array1OfInteger& AddMults, const TColStd_Array1OfInteger* AddMults,
TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewPoles,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
const Standard_Real Tolerance, const Standard_Real Tolerance,
const Standard_Boolean Add) const Standard_Boolean Add)
{ {
Standard_Boolean addflat = &AddMults == NULL; Standard_Boolean addflat = AddMults == NULL;
Standard_Integer i,k,mult,firstmult; Standard_Integer i,k,mult,firstmult;
Standard_Integer index,kn,curnk,curk; Standard_Integer index,kn,curnk,curk;
@ -1989,7 +1989,7 @@ void BSplCLib::InsertKnots
else length = Degree; else length = Degree;
if (addflat) depth = 1; if (addflat) depth = 1;
else depth = Min(Degree,AddMults(kn)); else depth = Min(Degree,(*AddMults)(kn));
if (sameknot) { if (sameknot) {
if (Add) { if (Add) {
@ -2011,7 +2011,7 @@ void BSplCLib::InsertKnots
} }
if (depth <= 0) continue; if (depth <= 0) continue;
BuildKnots(Degree,curnk,Periodic,nknots,nmults,*knots); BuildKnots(Degree,curnk,Periodic,nknots,&nmults,*knots);
// copy the poles // copy the poles
@ -2083,7 +2083,7 @@ void BSplCLib::InsertKnots
length = Degree - NewMults(curnk); length = Degree - NewMults(curnk);
depth = firstmult; depth = firstmult;
BuildKnots(Degree,curnk,Periodic,NewKnots,NewMults,*knots); BuildKnots(Degree,curnk,Periodic,NewKnots,&NewMults,*knots);
TColStd_Array1OfReal npoles(NewPoles(NewPoles.Lower()), TColStd_Array1OfReal npoles(NewPoles(NewPoles.Lower()),
NewPoles.Lower(), NewPoles.Lower(),
NewPoles.Upper()-depth*Dimension); NewPoles.Upper()-depth*Dimension);
@ -2170,9 +2170,9 @@ Standard_Boolean BSplCLib::RemoveKnot
// the new sequence of knots // the new sequence of knots
// is obtained from the knots at Index-1 and Index // is obtained from the knots at Index-1 and Index
BSplCLib::BuildKnots(Degree,TheIndex-1,Periodic,Knots,Mults,*knots); BSplCLib::BuildKnots(Degree,TheIndex-1,Periodic,Knots,&Mults,*knots);
index = PoleIndex(Degree,TheIndex-1,Periodic,Mults); index = PoleIndex(Degree,TheIndex-1,Periodic,Mults);
BSplCLib::BuildKnots(Degree,TheIndex,Periodic,Knots,Mults,knots[2*Degree]); BSplCLib::BuildKnots(Degree,TheIndex,Periodic,Knots,&Mults,knots[2*Degree]);
index += Mult; index += Mult;
@ -2814,7 +2814,7 @@ void BSplCLib::Trimming(const Standard_Integer Degree,
K(1) = U1; K(2) = U2; K(1) = U1; K(2) = U2;
mm[0] = mm[1] = Degree; mm[0] = mm[1] = Degree;
if (!PrepareInsertKnots( Degree, Periodic, Knots, Mults, K, M, if (!PrepareInsertKnots( Degree, Periodic, Knots, Mults, K, &M,
nbpoles, nbknots, Epsilon( U1), 0)) nbpoles, nbknots, Epsilon( U1), 0))
Standard_OutOfRange::Raise(); Standard_OutOfRange::Raise();
@ -2826,7 +2826,7 @@ void BSplCLib::Trimming(const Standard_Integer Degree,
// do not allow the multiplicities to Add : they must be less than Degree // do not allow the multiplicities to Add : they must be less than Degree
// //
InsertKnots(Degree, Periodic, Dimension, Poles, Knots, Mults, InsertKnots(Degree, Periodic, Dimension, Poles, Knots, Mults,
K, M, TempPoles, TempKnots, TempMults, Epsilon(U1), K, &M, TempPoles, TempKnots, TempMults, Epsilon(U1),
Standard_False); Standard_False);
// find in TempPoles the index of the pole corresponding to U1 // find in TempPoles the index of the pole corresponding to U1
@ -3608,8 +3608,8 @@ void BSplCLib::TangExtendToConstraint
TColStd_Array1OfReal ExtrapPoles(1,Csize*CDimension); TColStd_Array1OfReal ExtrapPoles(1,Csize*CDimension);
Standard_Real * EPadr = &ExtrapPoles(1) ; Standard_Real * EPadr = &ExtrapPoles(1) ;
PLib::CoefficientsPoles(CDimension, PLib::CoefficientsPoles(CDimension,
ExtraCoeffs, PLib::NoWeights(), ExtraCoeffs, PLib::NoWeights(),
ExtrapPoles, PLib::NoWeights()); ExtrapPoles, PLib::NoWeights());
// calculate the nodes of extension with multiplicities // calculate the nodes of extension with multiplicities
TColStd_Array1OfReal ExtrapNoeuds(1,2); TColStd_Array1OfReal ExtrapNoeuds(1,2);
@ -3911,7 +3911,7 @@ void BSplCLib::TangExtendToConstraint
void BSplCLib::Resolution( Standard_Real& Poles, void BSplCLib::Resolution( Standard_Real& Poles,
const Standard_Integer ArrayDimension, const Standard_Integer ArrayDimension,
const Standard_Integer NumPoles, const Standard_Integer NumPoles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& FlatKnots, const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Real Tolerance3D, const Standard_Real Tolerance3D,
@ -3932,8 +3932,8 @@ void BSplCLib::Resolution( Standard_Real& Poles,
num_poles = FlatKnots.Length() - Deg1; num_poles = FlatKnots.Length() - Deg1;
switch (ArrayDimension) { switch (ArrayDimension) {
case 2 : { case 2 : {
if (&Weights != NULL) { if (Weights != NULL) {
const Standard_Real * WG = &Weights(Weights.Lower()); const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0]; min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) { for (ii = 1 ; ii < NumPoles ; ii++) {
@ -4000,8 +4000,8 @@ void BSplCLib::Resolution( Standard_Real& Poles,
break; break;
} }
case 3 : { case 3 : {
if (&Weights != NULL) { if (Weights != NULL) {
const Standard_Real * WG = &Weights(Weights.Lower()); const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0]; min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) { for (ii = 1 ; ii < NumPoles ; ii++) {
@ -4077,8 +4077,8 @@ void BSplCLib::Resolution( Standard_Real& Poles,
break; break;
} }
case 4 : { case 4 : {
if (&Weights != NULL) { if (Weights != NULL) {
const Standard_Real * WG = &Weights(Weights.Lower()); const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0]; min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) { for (ii = 1 ; ii < NumPoles ; ii++) {
@ -4164,8 +4164,8 @@ void BSplCLib::Resolution( Standard_Real& Poles,
} }
default : { default : {
Standard_Integer kk; Standard_Integer kk;
if (&Weights != NULL) { if (Weights != NULL) {
const Standard_Real * WG = &Weights(Weights.Lower()); const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0]; min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) { for (ii = 1 ; ii < NumPoles ; ii++) {

View File

@ -97,11 +97,12 @@ class math_Matrix;
//! The bounds of Poles and Weights should be the same. //! The bounds of Poles and Weights should be the same.
//! The bounds of Knots and Mults should be the same. //! The bounds of Knots and Mults should be the same.
//! //!
//! Weights can be a null reference (BSplCLib::NoWeights()) //! Note: weight and multiplicity arrays can be passed by pointer for
//! the curve is non rational. //! some functions so that NULL pointer is valid.
//! That means no weights/no multiplicities passed.
//! //!
//! Mults can be a null reference (BSplCLib::NoMults()) //! No weights (BSplCLib::NoWeights()) means the curve is non rational.
//! the knots are "flat" knots. //! No mults (BSplCLib::NoMults()) means the knots are "flat" knots.
//! //!
//! KeyWords : //! KeyWords :
//! B-spline curve, Functions, Library //! B-spline curve, Functions, Library
@ -188,7 +189,7 @@ public:
//! Warning: Knots have to be "flat" //! Warning: Knots have to be "flat"
Standard_EXPORT static void LocateParameter (const Standard_Integer Degree, const TColStd_Array1OfReal& Knots, const Standard_Real U, const Standard_Boolean IsPeriodic, const Standard_Integer FromK1, const Standard_Integer ToK2, Standard_Integer& KnotIndex, Standard_Real& NewU); Standard_EXPORT static void LocateParameter (const Standard_Integer Degree, const TColStd_Array1OfReal& Knots, const Standard_Real U, const Standard_Boolean IsPeriodic, const Standard_Integer FromK1, const Standard_Integer ToK2, Standard_Integer& KnotIndex, Standard_Real& NewU);
Standard_EXPORT static void LocateParameter (const Standard_Integer Degree, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const Standard_Real U, const Standard_Boolean Periodic, Standard_Integer& Index, Standard_Real& NewU); Standard_EXPORT static void LocateParameter (const Standard_Integer Degree, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, const Standard_Real U, const Standard_Boolean Periodic, Standard_Integer& Index, Standard_Real& NewU);
//! Finds the greatest multiplicity in a set of knots //! Finds the greatest multiplicity in a set of knots
//! between K1 and K2. Mults is the multiplicity //! between K1 and K2. Mults is the multiplicity
@ -384,27 +385,27 @@ public:
Standard_EXPORT static void Bohm (const Standard_Real U, const Standard_Integer Degree, const Standard_Integer N, Standard_Real& Knots, const Standard_Integer Dimension, Standard_Real& Poles); Standard_EXPORT static void Bohm (const Standard_Real U, const Standard_Integer Degree, const Standard_Integer N, Standard_Real& Knots, const Standard_Integer Dimension, Standard_Real& Poles);
//! Used as argument for a non rational curve. //! Used as argument for a non rational curve.
static TColStd_Array1OfReal& NoWeights(); static TColStd_Array1OfReal* NoWeights();
//! Used as argument for a flatknots evaluation. //! Used as argument for a flatknots evaluation.
static TColStd_Array1OfInteger& NoMults(); static TColStd_Array1OfInteger* NoMults();
//! Stores in LK the usefull knots for the BoorSchem //! Stores in LK the usefull knots for the BoorSchem
//! on the span Knots(Index) - Knots(Index+1) //! on the span Knots(Index) - Knots(Index+1)
Standard_EXPORT static void BuildKnots (const Standard_Integer Degree, const Standard_Integer Index, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, Standard_Real& LK); Standard_EXPORT static void BuildKnots (const Standard_Integer Degree, const Standard_Integer Index, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, Standard_Real& LK);
//! Return the index of the first Pole to use on the //! Return the index of the first Pole to use on the
//! span Mults(Index) - Mults(Index+1). This index //! span Mults(Index) - Mults(Index+1). This index
//! must be added to Poles.Lower(). //! must be added to Poles.Lower().
Standard_EXPORT static Standard_Integer PoleIndex (const Standard_Integer Degree, const Standard_Integer Index, const Standard_Boolean Periodic, const TColStd_Array1OfInteger& Mults); Standard_EXPORT static Standard_Integer PoleIndex (const Standard_Integer Degree, const Standard_Integer Index, const Standard_Boolean Periodic, const TColStd_Array1OfInteger& Mults);
Standard_EXPORT static void BuildEval (const Standard_Integer Degree, const Standard_Integer Index, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, Standard_Real& LP); Standard_EXPORT static void BuildEval (const Standard_Integer Degree, const Standard_Integer Index, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal* Weights, Standard_Real& LP);
Standard_EXPORT static void BuildEval (const Standard_Integer Degree, const Standard_Integer Index, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, Standard_Real& LP); Standard_EXPORT static void BuildEval (const Standard_Integer Degree, const Standard_Integer Index, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, Standard_Real& LP);
//! Copy in <LP> the poles and weights for the Eval //! Copy in <LP> the poles and weights for the Eval
//! scheme. starting from Poles(Poles.Lower()+Index) //! scheme. starting from Poles(Poles.Lower()+Index)
Standard_EXPORT static void BuildEval (const Standard_Integer Degree, const Standard_Integer Index, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, Standard_Real& LP); Standard_EXPORT static void BuildEval (const Standard_Integer Degree, const Standard_Integer Index, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, Standard_Real& LP);
//! Copy in <LP> poles for <Dimension> Boor scheme. //! Copy in <LP> poles for <Dimension> Boor scheme.
//! Starting from <Index> * <Dimension>, copy //! Starting from <Index> * <Dimension>, copy
@ -436,11 +437,11 @@ public:
//! Return False if : //! Return False if :
//! The knew knots are knot increasing. //! The knew knots are knot increasing.
//! The new knots are not in the range. //! The new knots are not in the range.
Standard_EXPORT static Standard_Boolean PrepareInsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger& AddMults, Standard_Integer& NbPoles, Standard_Integer& NbKnots, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True); Standard_EXPORT static Standard_Boolean PrepareInsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger* AddMults, Standard_Integer& NbPoles, Standard_Integer& NbKnots, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True);
Standard_EXPORT static void InsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger& AddMults, TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True); Standard_EXPORT static void InsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger* AddMults, TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True);
Standard_EXPORT static void InsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger& AddMults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True); Standard_EXPORT static void InsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger* AddMults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True);
//! Insert a sequence of knots <AddKnots> with //! Insert a sequence of knots <AddKnots> with
//! multiplicities <AddMults>. <AddKnots> must be a non //! multiplicities <AddMults>. <AddKnots> must be a non
@ -468,9 +469,9 @@ public:
//! When all the new knots are existing knots, i.e. only the //! When all the new knots are existing knots, i.e. only the
//! multiplicities will change it is safe to use the same //! multiplicities will change it is safe to use the same
//! arrays as input and output. //! arrays as input and output.
Standard_EXPORT static void InsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger& AddMults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True); Standard_EXPORT static void InsertKnots (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfInteger* AddMults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Epsilon, const Standard_Boolean Add = Standard_True);
Standard_EXPORT static void InsertKnot (const Standard_Integer UIndex, const Standard_Real U, const Standard_Integer UMult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void InsertKnot (const Standard_Integer UIndex, const Standard_Real U, const Standard_Integer UMult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights);
//! Insert a new knot U of multiplicity UMult in the //! Insert a new knot U of multiplicity UMult in the
//! knot sequence. //! knot sequence.
@ -481,19 +482,19 @@ public:
//! //!
//! The new control points corresponding to this insertion are //! The new control points corresponding to this insertion are
//! returned. Knots and Mults are not updated. //! returned. Knots and Mults are not updated.
Standard_EXPORT static void InsertKnot (const Standard_Integer UIndex, const Standard_Real U, const Standard_Integer UMult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void InsertKnot (const Standard_Integer UIndex, const Standard_Real U, const Standard_Integer UMult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights);
Standard_EXPORT static void RaiseMultiplicity (const Standard_Integer KnotIndex, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void RaiseMultiplicity (const Standard_Integer KnotIndex, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights);
//! Raise the multiplicity of knot to <UMult>. //! Raise the multiplicity of knot to <UMult>.
//! //!
//! The new control points are returned. Knots and Mults are //! The new control points are returned. Knots and Mults are
//! not updated. //! not updated.
Standard_EXPORT static void RaiseMultiplicity (const Standard_Integer KnotIndex, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void RaiseMultiplicity (const Standard_Integer KnotIndex, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights);
Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance); Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance);
Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance); Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance);
//! Decrement the multiplicity of <Knots(Index)> //! Decrement the multiplicity of <Knots(Index)>
//! to <Mult>. If <Mult> is null the knot is //! to <Mult>. If <Mult> is null the knot is
@ -513,7 +514,7 @@ public:
//! //!
//! A high tolerance can be used to "smooth" the //! A high tolerance can be used to "smooth" the
//! curve. //! curve.
Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance); Standard_EXPORT static Standard_Boolean RemoveKnot (const Standard_Integer Index, const Standard_Integer Mult, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, const Standard_Real Tolerance);
//! Returns the number of knots of a curve with //! Returns the number of knots of a curve with
//! multiplicities <Mults> after elevating the degree from //! multiplicities <Mults> after elevating the degree from
@ -523,11 +524,11 @@ public:
Standard_EXPORT static void IncreaseDegree (const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults); Standard_EXPORT static void IncreaseDegree (const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColStd_Array1OfReal& NewPoles, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults);
Standard_EXPORT static void IncreaseDegree (const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults); Standard_EXPORT static void IncreaseDegree (const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults);
Standard_EXPORT static void IncreaseDegree (const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults); Standard_EXPORT static void IncreaseDegree (const Standard_Integer Degree, const Standard_Integer NewDegree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults);
Standard_EXPORT static void IncreaseDegree (const Standard_Integer NewDegree, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void IncreaseDegree (const Standard_Integer NewDegree, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights);
//! Increase the degree of a bspline (or bezier) curve //! Increase the degree of a bspline (or bezier) curve
//! of dimension <Dimension> form <Degree> to //! of dimension <Dimension> form <Degree> to
@ -586,7 +587,7 @@ public:
//! //!
//! The method IncreaseDegreeCountKnots can be used to //! The method IncreaseDegreeCountKnots can be used to
//! compute the new number of knots. //! compute the new number of knots.
Standard_EXPORT static void IncreaseDegree (const Standard_Integer NewDegree, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void IncreaseDegree (const Standard_Integer NewDegree, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights);
//! Set in <NbKnots> and <NbPolesToAdd> the number of Knots and //! Set in <NbKnots> and <NbPolesToAdd> the number of Knots and
//! Poles of the NotPeriodic Curve identical at the //! Poles of the NotPeriodic Curve identical at the
@ -596,9 +597,9 @@ public:
Standard_EXPORT static void Unperiodize (const Standard_Integer Degree, const Standard_Integer Dimension, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Poles, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewPoles); Standard_EXPORT static void Unperiodize (const Standard_Integer Degree, const Standard_Integer Dimension, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Poles, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewPoles);
Standard_EXPORT static void Unperiodize (const Standard_Integer Degree, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void Unperiodize (const Standard_Integer Degree, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights);
Standard_EXPORT static void Unperiodize (const Standard_Integer Degree, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void Unperiodize (const Standard_Integer Degree, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Knots, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewKnots, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights);
//! Set in <NbKnots> and <NbPoles> the number of Knots and //! Set in <NbKnots> and <NbPoles> the number of Knots and
//! Poles of the curve resulting of the trimming of the //! Poles of the curve resulting of the trimming of the
@ -607,55 +608,55 @@ public:
Standard_EXPORT static void Trimming (const Standard_Integer Degree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Poles, const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewPoles); Standard_EXPORT static void Trimming (const Standard_Integer Degree, const Standard_Boolean Periodic, const Standard_Integer Dimension, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfReal& Poles, const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, TColStd_Array1OfReal& NewPoles);
Standard_EXPORT static void Trimming (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void Trimming (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, TColgp_Array1OfPnt& NewPoles, TColStd_Array1OfReal* NewWeights);
Standard_EXPORT static void Trimming (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal& NewWeights); Standard_EXPORT static void Trimming (const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& NewKnots, TColStd_Array1OfInteger& NewMults, TColgp_Array1OfPnt2d& NewPoles, TColStd_Array1OfReal* NewWeights);
Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, Standard_Real& P); Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, Standard_Real& P);
Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt& P); Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt& P);
Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt2d& P); Standard_EXPORT static void D0 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt2d& P);
Standard_EXPORT static void D0 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& P); Standard_EXPORT static void D0 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& P);
Standard_EXPORT static void D0 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& P); Standard_EXPORT static void D0 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& P);
Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, Standard_Real& P, Standard_Real& V); Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, Standard_Real& P, Standard_Real& V);
Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt& P, gp_Vec& V); Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt& P, gp_Vec& V);
Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt2d& P, gp_Vec2d& V); Standard_EXPORT static void D1 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt2d& P, gp_Vec2d& V);
Standard_EXPORT static void D1 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& P, gp_Vec& V); Standard_EXPORT static void D1 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& P, gp_Vec& V);
Standard_EXPORT static void D1 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& P, gp_Vec2d& V); Standard_EXPORT static void D1 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& P, gp_Vec2d& V);
Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, Standard_Real& P, Standard_Real& V1, Standard_Real& V2); Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, Standard_Real& P, Standard_Real& V1, Standard_Real& V2);
Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2); Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2); Standard_EXPORT static void D2 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
Standard_EXPORT static void D2 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2); Standard_EXPORT static void D2 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2);
Standard_EXPORT static void D2 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2); Standard_EXPORT static void D2 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2);
Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, Standard_Real& P, Standard_Real& V1, Standard_Real& V2, Standard_Real& V3); Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, Standard_Real& P, Standard_Real& V1, Standard_Real& V2, Standard_Real& V3);
Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3); Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3); Standard_EXPORT static void D3 (const Standard_Real U, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
Standard_EXPORT static void D3 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3); Standard_EXPORT static void D3 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3);
Standard_EXPORT static void D3 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3); Standard_EXPORT static void D3 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3);
Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, Standard_Real& VN); Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, Standard_Real& VN);
Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Vec& VN); Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const Standard_Integer Index, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Vec& VN);
Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults, gp_Vec2d& V); Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const Standard_Integer UIndex, const Standard_Integer Degree, const Standard_Boolean Periodic, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger* Mults, gp_Vec2d& V);
Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& P, gp_Vec& VN); Standard_EXPORT static void DN (const Standard_Real U, const Standard_Integer N, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& P, gp_Vec& VN);
@ -1036,7 +1037,7 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
Standard_EXPORT static void CacheD0 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point); Standard_EXPORT static void CacheD0 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point);
//! Perform the evaluation of the Bspline Basis //! Perform the evaluation of the Bspline Basis
//! and then multiplies by the weights //! and then multiplies by the weights
@ -1050,17 +1051,17 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effectsis just evaluates the current point //! effectsis just evaluates the current point
Standard_EXPORT static void CacheD0 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point); Standard_EXPORT static void CacheD0 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point);
//! Calls CacheD0 for Bezier Curves Arrays computed with //! Calls CacheD0 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD0 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point); static void CoefsD0 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point);
//! Calls CacheD0 for Bezier Curves Arrays computed with //! Calls CacheD0 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD0 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point); static void CoefsD0 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point);
//! Perform the evaluation of the of the cache //! Perform the evaluation of the of the cache
//! the parameter must be normalized between //! the parameter must be normalized between
@ -1073,7 +1074,7 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
Standard_EXPORT static void CacheD1 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point, gp_Vec& Vec); Standard_EXPORT static void CacheD1 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point, gp_Vec& Vec);
//! Perform the evaluation of the Bspline Basis //! Perform the evaluation of the Bspline Basis
//! and then multiplies by the weights //! and then multiplies by the weights
@ -1087,17 +1088,17 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effectsis just evaluates the current point //! effectsis just evaluates the current point
Standard_EXPORT static void CacheD1 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point, gp_Vec2d& Vec); Standard_EXPORT static void CacheD1 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point, gp_Vec2d& Vec);
//! Calls CacheD1 for Bezier Curves Arrays computed with //! Calls CacheD1 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD1 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point, gp_Vec& Vec); static void CoefsD1 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point, gp_Vec& Vec);
//! Calls CacheD1 for Bezier Curves Arrays computed with //! Calls CacheD1 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD1 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point, gp_Vec2d& Vec); static void CoefsD1 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point, gp_Vec2d& Vec);
//! Perform the evaluation of the of the cache //! Perform the evaluation of the of the cache
//! the parameter must be normalized between //! the parameter must be normalized between
@ -1110,7 +1111,7 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
Standard_EXPORT static void CacheD2 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2); Standard_EXPORT static void CacheD2 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2);
//! Perform the evaluation of the Bspline Basis //! Perform the evaluation of the Bspline Basis
//! and then multiplies by the weights //! and then multiplies by the weights
@ -1124,17 +1125,17 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effectsis just evaluates the current point //! effectsis just evaluates the current point
Standard_EXPORT static void CacheD2 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2); Standard_EXPORT static void CacheD2 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2);
//! Calls CacheD1 for Bezier Curves Arrays computed with //! Calls CacheD1 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD2 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2); static void CoefsD2 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2);
//! Calls CacheD1 for Bezier Curves Arrays computed with //! Calls CacheD1 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD2 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2); static void CoefsD2 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2);
//! Perform the evaluation of the of the cache //! Perform the evaluation of the of the cache
//! the parameter must be normalized between //! the parameter must be normalized between
@ -1147,7 +1148,7 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
Standard_EXPORT static void CacheD3 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2, gp_Vec& Vec3); Standard_EXPORT static void CacheD3 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2, gp_Vec& Vec3);
//! Perform the evaluation of the Bspline Basis //! Perform the evaluation of the Bspline Basis
//! and then multiplies by the weights //! and then multiplies by the weights
@ -1161,43 +1162,43 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effectsis just evaluates the current point //! effectsis just evaluates the current point
Standard_EXPORT static void CacheD3 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2, gp_Vec2d& Vec3); Standard_EXPORT static void CacheD3 (const Standard_Real U, const Standard_Integer Degree, const Standard_Real CacheParameter, const Standard_Real SpanLenght, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2, gp_Vec2d& Vec3);
//! Calls CacheD1 for Bezier Curves Arrays computed with //! Calls CacheD1 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD3 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2, gp_Vec& Vec3); static void CoefsD3 (const Standard_Real U, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt& Point, gp_Vec& Vec1, gp_Vec& Vec2, gp_Vec& Vec3);
//! Calls CacheD1 for Bezier Curves Arrays computed with //! Calls CacheD1 for Bezier Curves Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
static void CoefsD3 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2, gp_Vec2d& Vec3); static void CoefsD3 (const Standard_Real U, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, gp_Pnt2d& Point, gp_Vec2d& Vec1, gp_Vec2d& Vec2, gp_Vec2d& Vec3);
//! Perform the evaluation of the Taylor expansion //! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1. //! of the Bspline normalized between 0 and 1.
//! If rational computes the homogeneous Taylor expension //! If rational computes the homogeneous Taylor expension
//! for the numerator and stores it in CachePoles //! for the numerator and stores it in CachePoles
Standard_EXPORT static void BuildCache (const Standard_Real U, const Standard_Real InverseOfSpanDomain, const Standard_Boolean PeriodicFlag, const Standard_Integer Degree, const TColStd_Array1OfReal& FlatKnots, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, TColgp_Array1OfPnt& CachePoles, TColStd_Array1OfReal& CacheWeights); Standard_EXPORT static void BuildCache (const Standard_Real U, const Standard_Real InverseOfSpanDomain, const Standard_Boolean PeriodicFlag, const Standard_Integer Degree, const TColStd_Array1OfReal& FlatKnots, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt& CachePoles, TColStd_Array1OfReal* CacheWeights);
//! Perform the evaluation of the Taylor expansion //! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1. //! of the Bspline normalized between 0 and 1.
//! If rational computes the homogeneous Taylor expension //! If rational computes the homogeneous Taylor expension
//! for the numerator and stores it in CachePoles //! for the numerator and stores it in CachePoles
Standard_EXPORT static void BuildCache (const Standard_Real U, const Standard_Real InverseOfSpanDomain, const Standard_Boolean PeriodicFlag, const Standard_Integer Degree, const TColStd_Array1OfReal& FlatKnots, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, TColgp_Array1OfPnt2d& CachePoles, TColStd_Array1OfReal& CacheWeights); Standard_EXPORT static void BuildCache (const Standard_Real U, const Standard_Real InverseOfSpanDomain, const Standard_Boolean PeriodicFlag, const Standard_Integer Degree, const TColStd_Array1OfReal& FlatKnots, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt2d& CachePoles, TColStd_Array1OfReal* CacheWeights);
//! Perform the evaluation of the Taylor expansion //! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1. //! of the Bspline normalized between 0 and 1.
//! Structure of result optimized for BSplCLib_Cache. //! Structure of result optimized for BSplCLib_Cache.
Standard_EXPORT static void BuildCache (const Standard_Real theParameter, const Standard_Real theSpanDomain, const Standard_Boolean thePeriodicFlag, const Standard_Integer theDegree, const TColStd_Array1OfReal& theFlatKnots, const TColgp_Array1OfPnt& thePoles, const TColStd_Array1OfReal& theWeights, TColStd_Array2OfReal& theCacheArray); Standard_EXPORT static void BuildCache (const Standard_Real theParameter, const Standard_Real theSpanDomain, const Standard_Boolean thePeriodicFlag, const Standard_Integer theDegree, const TColStd_Array1OfReal& theFlatKnots, const TColgp_Array1OfPnt& thePoles, const TColStd_Array1OfReal* theWeights, TColStd_Array2OfReal& theCacheArray);
//! Perform the evaluation of the Taylor expansion //! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1. //! of the Bspline normalized between 0 and 1.
//! Structure of result optimized for BSplCLib_Cache. //! Structure of result optimized for BSplCLib_Cache.
Standard_EXPORT static void BuildCache (const Standard_Real theParameter, const Standard_Real theSpanDomain, const Standard_Boolean thePeriodicFlag, const Standard_Integer theDegree, const TColStd_Array1OfReal& theFlatKnots, const TColgp_Array1OfPnt2d& thePoles, const TColStd_Array1OfReal& theWeights, TColStd_Array2OfReal& theCacheArray); Standard_EXPORT static void BuildCache (const Standard_Real theParameter, const Standard_Real theSpanDomain, const Standard_Boolean thePeriodicFlag, const Standard_Integer theDegree, const TColStd_Array1OfReal& theFlatKnots, const TColgp_Array1OfPnt2d& thePoles, const TColStd_Array1OfReal* theWeights, TColStd_Array2OfReal& theCacheArray);
static void PolesCoefficients (const TColgp_Array1OfPnt2d& Poles, TColgp_Array1OfPnt2d& CachePoles); static void PolesCoefficients (const TColgp_Array1OfPnt2d& Poles, TColgp_Array1OfPnt2d& CachePoles);
Standard_EXPORT static void PolesCoefficients (const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, TColgp_Array1OfPnt2d& CachePoles, TColStd_Array1OfReal& CacheWeights); Standard_EXPORT static void PolesCoefficients (const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt2d& CachePoles, TColStd_Array1OfReal* CacheWeights);
static void PolesCoefficients (const TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt& CachePoles); static void PolesCoefficients (const TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt& CachePoles);
@ -1205,7 +1206,7 @@ public:
//! evaluation of the Taylor expansion for beziercurves //! evaluation of the Taylor expansion for beziercurves
//! at parameter 0. //! at parameter 0.
//! Warning: To be used for Beziercurves ONLY!!! //! Warning: To be used for Beziercurves ONLY!!!
Standard_EXPORT static void PolesCoefficients (const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, TColgp_Array1OfPnt& CachePoles, TColStd_Array1OfReal& CacheWeights); Standard_EXPORT static void PolesCoefficients (const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, TColgp_Array1OfPnt& CachePoles, TColStd_Array1OfReal* CacheWeights);
//! Returns pointer to statically allocated array representing //! Returns pointer to statically allocated array representing
//! flat knots for bezier curve of the specified degree. //! flat knots for bezier curve of the specified degree.
@ -1437,7 +1438,7 @@ public:
//! all u1 and u0 in the domain of the curve f(u) //! all u1 and u0 in the domain of the curve f(u)
//! | u1 - u0 | < UTolerance and //! | u1 - u0 | < UTolerance and
//! we have |f (u1) - f (u0)| < Tolerance3D //! we have |f (u1) - f (u0)| < Tolerance3D
Standard_EXPORT static void Resolution (Standard_Real& PolesArray, const Standard_Integer ArrayDimension, const Standard_Integer NumPoles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance); Standard_EXPORT static void Resolution (Standard_Real& PolesArray, const Standard_Integer ArrayDimension, const Standard_Integer NumPoles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance);
//! given a tolerance in 3D space returns a //! given a tolerance in 3D space returns a
@ -1445,7 +1446,7 @@ public:
//! all u1 and u0 in the domain of the curve f(u) //! all u1 and u0 in the domain of the curve f(u)
//! | u1 - u0 | < UTolerance and //! | u1 - u0 | < UTolerance and
//! we have |f (u1) - f (u0)| < Tolerance3D //! we have |f (u1) - f (u0)| < Tolerance3D
Standard_EXPORT static void Resolution (const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const Standard_Integer NumPoles, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance); Standard_EXPORT static void Resolution (const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const Standard_Integer NumPoles, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance);
//! given a tolerance in 3D space returns a //! given a tolerance in 3D space returns a
@ -1453,7 +1454,7 @@ public:
//! all u1 and u0 in the domain of the curve f(u) //! all u1 and u0 in the domain of the curve f(u)
//! | u1 - u0 | < UTolerance and //! | u1 - u0 | < UTolerance and
//! we have |f (u1) - f (u0)| < Tolerance3D //! we have |f (u1) - f (u0)| < Tolerance3D
Standard_EXPORT static void Resolution (const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const Standard_Integer NumPoles, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance); Standard_EXPORT static void Resolution (const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const Standard_Integer NumPoles, const TColStd_Array1OfReal& FlatKnots, const Standard_Integer Degree, const Standard_Real Tolerance3D, Standard_Real& UTolerance);

View File

@ -33,9 +33,9 @@ inline Standard_Integer BSplCLib::MaxDegree ()
//purpose : //purpose :
//======================================================================= //=======================================================================
inline TColStd_Array1OfReal& BSplCLib::NoWeights() inline TColStd_Array1OfReal* BSplCLib::NoWeights()
{ {
return (*((TColStd_Array1OfReal*) NULL)); return NULL;
} }
//======================================================================= //=======================================================================
@ -43,9 +43,9 @@ inline TColStd_Array1OfReal& BSplCLib::NoWeights()
//purpose : //purpose :
//======================================================================= //=======================================================================
inline TColStd_Array1OfInteger& BSplCLib::NoMults() inline TColStd_Array1OfInteger* BSplCLib::NoMults()
{ {
return (*((TColStd_Array1OfInteger*) NULL)); return NULL;
} }
//======================================================================= //=======================================================================
@ -55,7 +55,7 @@ inline TColStd_Array1OfInteger& BSplCLib::NoMults()
inline void BSplCLib::CoefsD0(const Standard_Real U, inline void BSplCLib::CoefsD0(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P) gp_Pnt& P)
{ {
BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P); BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P);
@ -68,7 +68,7 @@ inline void BSplCLib::CoefsD0(const Standard_Real U,
inline void BSplCLib::CoefsD0(const Standard_Real U, inline void BSplCLib::CoefsD0(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P) gp_Pnt2d& P)
{ {
BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P); BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P);
@ -81,7 +81,7 @@ inline void BSplCLib::CoefsD0(const Standard_Real U,
inline void BSplCLib::CoefsD1(const Standard_Real U, inline void BSplCLib::CoefsD1(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& Vec) gp_Vec& Vec)
{ {
@ -95,7 +95,7 @@ inline void BSplCLib::CoefsD1(const Standard_Real U,
inline void BSplCLib::CoefsD1(const Standard_Real U, inline void BSplCLib::CoefsD1(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& Vec) gp_Vec2d& Vec)
{ {
@ -109,7 +109,7 @@ inline void BSplCLib::CoefsD1(const Standard_Real U,
inline void BSplCLib::CoefsD2(const Standard_Real U, inline void BSplCLib::CoefsD2(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& Vec1, gp_Vec& Vec1,
gp_Vec& Vec2) gp_Vec& Vec2)
@ -125,7 +125,7 @@ inline void BSplCLib::CoefsD2(const Standard_Real U,
inline void BSplCLib::CoefsD2(const Standard_Real U, inline void BSplCLib::CoefsD2(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& Vec1, gp_Vec2d& Vec1,
gp_Vec2d& Vec2) gp_Vec2d& Vec2)
@ -141,7 +141,7 @@ inline void BSplCLib::CoefsD2(const Standard_Real U,
inline void BSplCLib::CoefsD3(const Standard_Real U, inline void BSplCLib::CoefsD3(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& Vec1, gp_Vec& Vec1,
gp_Vec& Vec2, gp_Vec& Vec2,
@ -158,7 +158,7 @@ inline void BSplCLib::CoefsD3(const Standard_Real U,
inline void BSplCLib::CoefsD3(const Standard_Real U, inline void BSplCLib::CoefsD3(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& Vec1, gp_Vec2d& Vec1,
gp_Vec2d& Vec2, gp_Vec2d& Vec2,

View File

@ -62,7 +62,7 @@ struct BSplCLib_DataContainer
void BSplCLib::BuildEval(const Standard_Integer Degree, void BSplCLib::BuildEval(const Standard_Integer Degree,
const Standard_Integer Index, const Standard_Integer Index,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
Standard_Real& LP) Standard_Real& LP)
{ {
Standard_Integer PLower = Poles.Lower(); Standard_Integer PLower = Poles.Lower();
@ -70,7 +70,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree,
Standard_Integer i; Standard_Integer i;
Standard_Integer ip = PLower + Index - 1; Standard_Integer ip = PLower + Index - 1;
Standard_Real w, *pole = &LP; Standard_Real w, *pole = &LP;
if (&Weights == NULL) { if (Weights == NULL) {
for (i = 0; i <= Degree; i++) { for (i = 0; i <= Degree; i++) {
ip++; ip++;
@ -84,7 +84,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree,
for (i = 0; i <= Degree; i++) { for (i = 0; i <= Degree; i++) {
ip++; ip++;
if (ip > PUpper) ip = PLower; if (ip > PUpper) ip = PLower;
pole[1] = w = Weights(ip); pole[1] = w = (*Weights)(ip);
pole[0] = Poles(ip) * w; pole[0] = Poles(ip) * w;
pole += 2; pole += 2;
} }
@ -105,9 +105,9 @@ static void PrepareEval
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
BSplCLib_DataContainer& dc) BSplCLib_DataContainer& dc)
{ {
// Set the Index // Set the Index
@ -115,16 +115,16 @@ static void PrepareEval
// make the knots // make the knots
BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots); BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots);
if (&Mults == NULL) if (Mults == NULL)
index -= Knots.Lower() + Degree; index -= Knots.Lower() + Degree;
else else
index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults); index = BSplCLib::PoleIndex(Degree,index,Periodic,*Mults);
// check truly rational // check truly rational
rational = (&Weights != NULL); rational = (Weights != NULL);
if (rational) { if (rational) {
Standard_Integer WLower = Weights.Lower() + index; Standard_Integer WLower = Weights->Lower() + index;
rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree); rational = BSplCLib::IsRational(*Weights, WLower, WLower + Degree);
} }
// make the poles // make the poles
@ -149,9 +149,9 @@ void BSplCLib::D0
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Standard_Real& P) Standard_Real& P)
{ {
Standard_Integer dim,index = Index; Standard_Integer dim,index = Index;
@ -175,9 +175,9 @@ void BSplCLib::D1
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Standard_Real& P, Standard_Real& P,
Standard_Real& V) Standard_Real& V)
{ {
@ -207,9 +207,9 @@ void BSplCLib::D2
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Standard_Real& P, Standard_Real& P,
Standard_Real& V1, Standard_Real& V1,
Standard_Real& V2) Standard_Real& V2)
@ -242,9 +242,9 @@ void BSplCLib::D3
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Standard_Real& P, Standard_Real& P,
Standard_Real& V1, Standard_Real& V1,
Standard_Real& V2, Standard_Real& V2,
@ -281,9 +281,9 @@ void BSplCLib::DN
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles, const TColStd_Array1OfReal& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Standard_Real& VN) Standard_Real& VN)
{ {
Standard_Integer dim,index = Index; Standard_Integer dim,index = Index;

View File

@ -54,9 +54,9 @@ class BSplCLib_BezierArrays
void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree, void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt& NewPoles, TColgp_Array1OfPnt& NewPoles,
TColStd_Array1OfReal& NewWeights) TColStd_Array1OfReal* NewWeights)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
@ -72,9 +72,9 @@ void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree,
void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree, void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt2d& NewPoles, TColgp_Array1OfPnt2d& NewPoles,
TColStd_Array1OfReal& NewWeights) TColStd_Array1OfReal* NewWeights)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
@ -89,9 +89,9 @@ void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree,
//======================================================================= //=======================================================================
void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt& Poles, void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt& CachePoles, TColgp_Array1OfPnt& CachePoles,
TColStd_Array1OfReal& CacheWeights) TColStd_Array1OfReal* CacheWeights)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
TColStd_Array1OfReal bidflatknots (FlatBezierKnots(deg), 1, 2*(deg+1)); TColStd_Array1OfReal bidflatknots (FlatBezierKnots(deg), 1, 2*(deg+1));
@ -105,9 +105,9 @@ void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt& Poles,
//======================================================================= //=======================================================================
void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt2d& Poles, void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt2d& CachePoles, TColgp_Array1OfPnt2d& CachePoles,
TColStd_Array1OfReal& CacheWeights) TColStd_Array1OfReal* CacheWeights)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
TColStd_Array1OfReal bidflatknots (FlatBezierKnots(deg), 1, 2*(deg+1)); TColStd_Array1OfReal bidflatknots (FlatBezierKnots(deg), 1, 2*(deg+1));
@ -122,12 +122,12 @@ void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt2d& Poles,
void BSplCLib::D0(const Standard_Real U, void BSplCLib::D0(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P) gp_Pnt& P)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D0(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, P); BSplCLib::D0(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults, P);
} }
//======================================================================= //=======================================================================
@ -137,12 +137,12 @@ void BSplCLib::D0(const Standard_Real U,
void BSplCLib::D0(const Standard_Real U, void BSplCLib::D0(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P) gp_Pnt2d& P)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D0(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, P); BSplCLib::D0(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults, P);
} }
//======================================================================= //=======================================================================
@ -152,13 +152,13 @@ void BSplCLib::D0(const Standard_Real U,
void BSplCLib::D1(const Standard_Real U, void BSplCLib::D1(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& V) gp_Vec& V)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D1(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, P, V); BSplCLib::D1(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults, P, V);
} }
//======================================================================= //=======================================================================
@ -168,13 +168,13 @@ void BSplCLib::D1(const Standard_Real U,
void BSplCLib::D1(const Standard_Real U, void BSplCLib::D1(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V) gp_Vec2d& V)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D1(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, P, V); BSplCLib::D1(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults, P, V);
} }
@ -185,14 +185,14 @@ void BSplCLib::D1(const Standard_Real U,
void BSplCLib::D2(const Standard_Real U, void BSplCLib::D2(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& V1, gp_Vec& V1,
gp_Vec& V2) gp_Vec& V2)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D2(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, P, V1, V2); BSplCLib::D2(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults, P, V1, V2);
} }
//======================================================================= //=======================================================================
@ -202,14 +202,14 @@ void BSplCLib::D2(const Standard_Real U,
void BSplCLib::D2(const Standard_Real U, void BSplCLib::D2(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V1, gp_Vec2d& V1,
gp_Vec2d& V2) gp_Vec2d& V2)
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D2(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, P, V1, V2); BSplCLib::D2(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults, P, V1, V2);
} }
@ -220,7 +220,7 @@ void BSplCLib::D2(const Standard_Real U,
void BSplCLib::D3(const Standard_Real U, void BSplCLib::D3(const Standard_Real U,
const TColgp_Array1OfPnt& Poles, const TColgp_Array1OfPnt& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt& P, gp_Pnt& P,
gp_Vec& V1, gp_Vec& V1,
gp_Vec& V2, gp_Vec& V2,
@ -228,7 +228,7 @@ void BSplCLib::D3(const Standard_Real U,
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D3(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, BSplCLib::D3(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults,
P, V1, V2, V3); P, V1, V2, V3);
} }
@ -239,7 +239,7 @@ void BSplCLib::D3(const Standard_Real U,
void BSplCLib::D3(const Standard_Real U, void BSplCLib::D3(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles, const TColgp_Array1OfPnt2d& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P, gp_Pnt2d& P,
gp_Vec2d& V1, gp_Vec2d& V1,
gp_Vec2d& V2, gp_Vec2d& V2,
@ -247,7 +247,7 @@ void BSplCLib::D3(const Standard_Real U,
{ {
Standard_Integer deg = Poles.Length() - 1; Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg); BSplCLib_BezierArrays bzarr(deg);
BSplCLib::D3(U, 1, deg, 0, Poles, Weights, bzarr.knots, bzarr.mults, BSplCLib::D3(U, 1, deg, 0, Poles, Weights, bzarr.knots, &bzarr.mults,
P, V1, V2, V3); P, V1, V2, V3);
} }

View File

@ -45,7 +45,7 @@ BSplCLib_Cache::BSplCLib_Cache(const Standard_Integer& theDegree,
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d, const TColgp_Array1OfPnt2d& thePoles2d,
const TColStd_Array1OfReal& theWeights) const TColStd_Array1OfReal* theWeights)
{ {
Standard_Real aCacheParam = theFlatKnots.Value(theFlatKnots.Lower() + theDegree); Standard_Real aCacheParam = theFlatKnots.Value(theFlatKnots.Lower() + theDegree);
BuildCache(aCacheParam, theDegree, thePeriodic, BuildCache(aCacheParam, theDegree, thePeriodic,
@ -56,7 +56,7 @@ BSplCLib_Cache::BSplCLib_Cache(const Standard_Integer& theDegree,
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt& thePoles, const TColgp_Array1OfPnt& thePoles,
const TColStd_Array1OfReal& theWeights) const TColStd_Array1OfReal* theWeights)
{ {
Standard_Real aCacheParam = theFlatKnots.Value(theFlatKnots.Lower() + theDegree); Standard_Real aCacheParam = theFlatKnots.Value(theFlatKnots.Lower() + theDegree);
BuildCache(aCacheParam, theDegree, thePeriodic, BuildCache(aCacheParam, theDegree, thePeriodic,
@ -99,7 +99,7 @@ void BSplCLib_Cache::BuildCache(const Standard_Real& theParameter,
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d, const TColgp_Array1OfPnt2d& thePoles2d,
const TColStd_Array1OfReal& theWeights) const TColStd_Array1OfReal* theWeights)
{ {
// Normalize theParameter for periodical B-splines // Normalize theParameter for periodical B-splines
Standard_Real aNewParam = theParameter; Standard_Real aNewParam = theParameter;
@ -113,7 +113,7 @@ void BSplCLib_Cache::BuildCache(const Standard_Real& theParameter,
myFlatKnots.Nullify(); myFlatKnots.Nullify();
// Change the size of cached data if needed // Change the size of cached data if needed
myIsRational = (&theWeights != NULL); myIsRational = (theWeights != NULL);
Standard_Integer aPWColNumber = myIsRational ? 3 : 2; Standard_Integer aPWColNumber = myIsRational ? 3 : 2;
if (theDegree > myDegree) if (theDegree > myDegree)
myPolesWeights = new TColStd_HArray2OfReal(1, theDegree + 1, 1, aPWColNumber); myPolesWeights = new TColStd_HArray2OfReal(1, theDegree + 1, 1, aPWColNumber);
@ -137,7 +137,7 @@ void BSplCLib_Cache::BuildCache(const Standard_Real& theParameter,
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt& thePoles, const TColgp_Array1OfPnt& thePoles,
const TColStd_Array1OfReal& theWeights) const TColStd_Array1OfReal* theWeights)
{ {
// Create list of knots with repetitions and normalize theParameter for periodical B-splines // Create list of knots with repetitions and normalize theParameter for periodical B-splines
Standard_Real aNewParam = theParameter; Standard_Real aNewParam = theParameter;
@ -151,7 +151,7 @@ void BSplCLib_Cache::BuildCache(const Standard_Real& theParameter,
myFlatKnots.Nullify(); myFlatKnots.Nullify();
// Change the size of cached data if needed // Change the size of cached data if needed
myIsRational = (&theWeights != NULL); myIsRational = (theWeights != NULL);
Standard_Integer aPWColNumber = myIsRational ? 4 : 3; Standard_Integer aPWColNumber = myIsRational ? 4 : 3;
if (theDegree > myDegree) if (theDegree > myDegree)
myPolesWeights = new TColStd_HArray2OfReal(1, theDegree + 1, 1, aPWColNumber); myPolesWeights = new TColStd_HArray2OfReal(1, theDegree + 1, 1, aPWColNumber);

View File

@ -31,10 +31,6 @@
#include <TColgp_Array1OfPnt.hxx> #include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx> #include <TColgp_Array1OfPnt2d.hxx>
#ifndef NOWEIGHTS_CURVE
#define NOWEIGHTS_CURVE (*((TColStd_Array1OfReal*) NULL))
#endif
//! \brief A cache class for B-spline curves. //! \brief A cache class for B-spline curves.
//! //!
//! Defines all data, that can be cached on a span of B-spline curve. //! Defines all data, that can be cached on a span of B-spline curve.
@ -54,7 +50,7 @@ public:
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d, const TColgp_Array1OfPnt2d& thePoles2d,
const TColStd_Array1OfReal& theWeights = NOWEIGHTS_CURVE); const TColStd_Array1OfReal* theWeights = NULL);
//! Constructor for caching of 3D curves //! Constructor for caching of 3D curves
//! \param theDegree degree of the B-spline //! \param theDegree degree of the B-spline
//! \param thePeriodic identify the B-spline is periodic //! \param thePeriodic identify the B-spline is periodic
@ -65,7 +61,7 @@ public:
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt& thePoles, const TColgp_Array1OfPnt& thePoles,
const TColStd_Array1OfReal& theWeights = NOWEIGHTS_CURVE); const TColStd_Array1OfReal* theWeights = NULL);
//! Verifies validity of the cache using flat parameter of the point //! Verifies validity of the cache using flat parameter of the point
//! \param theParameter parameter of the point placed in the span //! \param theParameter parameter of the point placed in the span
@ -83,7 +79,7 @@ public:
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d, const TColgp_Array1OfPnt2d& thePoles2d,
const TColStd_Array1OfReal& theWeights = NOWEIGHTS_CURVE); const TColStd_Array1OfReal* theWeights = NULL);
//! Recomputes the cache data for 3D curves. Does not verify validity of the cache //! Recomputes the cache data for 3D curves. Does not verify validity of the cache
//! \param theParameter the value on the knot's axis to identify the span //! \param theParameter the value on the knot's axis to identify the span
//! \param theDegree degree of the B-spline //! \param theDegree degree of the B-spline
@ -96,7 +92,7 @@ public:
const Standard_Boolean& thePeriodic, const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt& thePoles, const TColgp_Array1OfPnt& thePoles,
const TColStd_Array1OfReal& theWeights = NOWEIGHTS_CURVE); const TColStd_Array1OfReal* theWeights = NULL);
//! Calculates the point on B-spline in the selected point //! Calculates the point on B-spline in the selected point
//! \param[in] theParameter parameter of calculation of the value //! \param[in] theParameter parameter of calculation of the value

View File

@ -84,16 +84,16 @@ Standard_Boolean BSplCLib::RemoveKnot
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
const Standard_Real Tolerance) const Standard_Real Tolerance)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim; Standard_Integer dim;
dim = Dimension_gen; dim = Dimension_gen;
if (rational) dim++; if (rational) dim++;
@ -101,14 +101,14 @@ Standard_Boolean BSplCLib::RemoveKnot
TColStd_Array1OfReal poles(1,dim*Poles.Length()); TColStd_Array1OfReal poles(1,dim*Poles.Length());
TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length()); TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length());
if (rational) PLib::SetPoles(Poles,Weights,poles); if (rational) PLib::SetPoles(Poles,*Weights,poles);
else PLib::SetPoles(Poles,poles); else PLib::SetPoles(Poles,poles);
if (!RemoveKnot(Index,Mult,Degree,Periodic,dim, if (!RemoveKnot(Index,Mult,Degree,Periodic,dim,
poles,Knots,Mults,newpoles,NewKnots,NewMults,Tolerance)) poles,Knots,Mults,newpoles,NewKnots,NewMults,Tolerance))
return Standard_False; return Standard_False;
if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights); if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles); else PLib::GetPoles(newpoles,NewPoles);
return Standard_True; return Standard_True;
} }
@ -122,19 +122,19 @@ void BSplCLib::InsertKnots
(const Standard_Integer Degree, (const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfReal& AddKnots,
const TColStd_Array1OfInteger& AddMults, const TColStd_Array1OfInteger* AddMults,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
const Standard_Real Epsilon, const Standard_Real Epsilon,
const Standard_Boolean Add) const Standard_Boolean Add)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim; Standard_Integer dim;
dim = Dimension_gen; dim = Dimension_gen;
if (rational) dim++; if (rational) dim++;
@ -142,13 +142,13 @@ void BSplCLib::InsertKnots
TColStd_Array1OfReal poles(1,dim*Poles.Length()); TColStd_Array1OfReal poles(1,dim*Poles.Length());
TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length()); TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length());
if (rational) PLib::SetPoles(Poles,Weights,poles); if (rational) PLib::SetPoles(Poles,*Weights,poles);
else PLib::SetPoles(Poles,poles); else PLib::SetPoles(Poles,poles);
InsertKnots(Degree,Periodic,dim,poles,Knots,Mults, InsertKnots(Degree,Periodic,dim,poles,Knots,Mults,
AddKnots,AddMults,newpoles,NewKnots,NewMults,Epsilon,Add); AddKnots,AddMults,newpoles,NewKnots,NewMults,Epsilon,Add);
if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights); if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles); else PLib::GetPoles(newpoles,NewPoles);
} }
@ -163,11 +163,11 @@ void BSplCLib::InsertKnot(const Standard_Integer ,
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights) TColStd_Array1OfReal* NewWeights)
{ {
TColStd_Array1OfReal k(1,1); TColStd_Array1OfReal k(1,1);
k(1) = U; k(1) = U;
@ -176,7 +176,7 @@ void BSplCLib::InsertKnot(const Standard_Integer ,
TColStd_Array1OfReal nk(1,Knots.Length()+1); TColStd_Array1OfReal nk(1,Knots.Length()+1);
TColStd_Array1OfInteger nm(1,Knots.Length()+1); TColStd_Array1OfInteger nm(1,Knots.Length()+1);
InsertKnots(Degree,Periodic,Poles,Weights,Knots,Mults, InsertKnots(Degree,Periodic,Poles,Weights,Knots,Mults,
k,m,NewPoles,NewWeights,nk,nm,Epsilon(U)); k,&m,NewPoles,NewWeights,nk,nm,Epsilon(U));
} }
//======================================================================= //=======================================================================
@ -189,11 +189,11 @@ void BSplCLib::RaiseMultiplicity(const Standard_Integer KnotIndex,
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights) TColStd_Array1OfReal* NewWeights)
{ {
TColStd_Array1OfReal k(1,1); TColStd_Array1OfReal k(1,1);
k(1) = Knots(KnotIndex); k(1) = Knots(KnotIndex);
@ -202,7 +202,7 @@ void BSplCLib::RaiseMultiplicity(const Standard_Integer KnotIndex,
TColStd_Array1OfReal nk(1,Knots.Length()); TColStd_Array1OfReal nk(1,Knots.Length());
TColStd_Array1OfInteger nm(1,Knots.Length()); TColStd_Array1OfInteger nm(1,Knots.Length());
InsertKnots(Degree,Periodic,Poles,Weights,Knots,Mults, InsertKnots(Degree,Periodic,Poles,Weights,Knots,Mults,
k,m,NewPoles,NewWeights,nk,nm,Epsilon(k(1))); k,&m,NewPoles,NewWeights,nk,nm,Epsilon(k(1)));
} }
//======================================================================= //=======================================================================
@ -215,15 +215,15 @@ void BSplCLib::IncreaseDegree
const Standard_Integer NewDegree, const Standard_Integer NewDegree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights, TColStd_Array1OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults) TColStd_Array1OfInteger& NewMults)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim; Standard_Integer dim;
dim = Dimension_gen; dim = Dimension_gen;
if (rational) dim++; if (rational) dim++;
@ -231,13 +231,13 @@ void BSplCLib::IncreaseDegree
TColStd_Array1OfReal poles(1,dim*Poles.Length()); TColStd_Array1OfReal poles(1,dim*Poles.Length());
TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length()); TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length());
if (rational) PLib::SetPoles(Poles,Weights,poles); if (rational) PLib::SetPoles(Poles,*Weights,poles);
else PLib::SetPoles(Poles,poles); else PLib::SetPoles(Poles,poles);
IncreaseDegree(Degree,NewDegree,Periodic,dim,poles,Knots,Mults, IncreaseDegree(Degree,NewDegree,Periodic,dim,poles,Knots,Mults,
newpoles,NewKnots,NewMults); newpoles,NewKnots,NewMults);
if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights); if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles); else PLib::GetPoles(newpoles,NewPoles);
} }
@ -251,13 +251,13 @@ void BSplCLib::Unperiodize
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights) TColStd_Array1OfReal* NewWeights)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim; Standard_Integer dim;
dim = Dimension_gen; dim = Dimension_gen;
if (rational) dim++; if (rational) dim++;
@ -265,13 +265,13 @@ void BSplCLib::Unperiodize
TColStd_Array1OfReal poles(1,dim*Poles.Length()); TColStd_Array1OfReal poles(1,dim*Poles.Length());
TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length()); TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length());
if (rational) PLib::SetPoles(Poles,Weights,poles); if (rational) PLib::SetPoles(Poles,*Weights,poles);
else PLib::SetPoles(Poles,poles); else PLib::SetPoles(Poles,poles);
Unperiodize(Degree, dim, Mults, Knots, poles, Unperiodize(Degree, dim, Mults, Knots, poles,
NewMults,NewKnots, newpoles); NewMults,NewKnots, newpoles);
if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights); if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles); else PLib::GetPoles(newpoles,NewPoles);
} }
@ -285,15 +285,15 @@ void BSplCLib::Trimming(const Standard_Integer Degree,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const Standard_Real U1, const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
Array1OfPoints& NewPoles, Array1OfPoints& NewPoles,
TColStd_Array1OfReal& NewWeights) TColStd_Array1OfReal* NewWeights)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim; Standard_Integer dim;
dim = Dimension_gen; dim = Dimension_gen;
if (rational) dim++; if (rational) dim++;
@ -301,13 +301,13 @@ void BSplCLib::Trimming(const Standard_Integer Degree,
TColStd_Array1OfReal poles(1,dim*Poles.Length()); TColStd_Array1OfReal poles(1,dim*Poles.Length());
TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length()); TColStd_Array1OfReal newpoles(1,dim*NewPoles.Length());
if (rational) PLib::SetPoles(Poles,Weights,poles); if (rational) PLib::SetPoles(Poles,*Weights,poles);
else PLib::SetPoles(Poles,poles); else PLib::SetPoles(Poles,poles);
Trimming(Degree, Periodic, dim, Knots, Mults, poles, U1, U2, Trimming(Degree, Periodic, dim, Knots, Mults, poles, U1, U2,
NewKnots, NewMults, newpoles); NewKnots, NewMults, newpoles);
if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights); if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles); else PLib::GetPoles(newpoles,NewPoles);
} }
@ -332,7 +332,7 @@ void BSplCLib::Trimming(const Standard_Integer Degree,
void BSplCLib::BuildEval(const Standard_Integer Degree, void BSplCLib::BuildEval(const Standard_Integer Degree,
const Standard_Integer Index, const Standard_Integer Index,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
Standard_Real& LP) Standard_Real& LP)
{ {
Standard_Real w, *pole = &LP; Standard_Real w, *pole = &LP;
@ -340,7 +340,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree,
Standard_Integer PUpper = Poles.Upper(); Standard_Integer PUpper = Poles.Upper();
Standard_Integer i; Standard_Integer i;
Standard_Integer ip = PLower + Index - 1; Standard_Integer ip = PLower + Index - 1;
if (&Weights == NULL) { if (Weights == NULL) {
for (i = 0; i <= Degree; i++) { for (i = 0; i <= Degree; i++) {
ip++; ip++;
if (ip > PUpper) ip = PLower; if (ip > PUpper) ip = PLower;
@ -354,7 +354,7 @@ void BSplCLib::BuildEval(const Standard_Integer Degree,
ip++; ip++;
if (ip > PUpper) ip = PLower; if (ip > PUpper) ip = PLower;
const Point& P = Poles(ip); const Point& P = Poles(ip);
pole[Dimension_gen] = w = Weights(ip); pole[Dimension_gen] = w = (*Weights)(ip);
PointToCoords (pole, P, * w); PointToCoords (pole, P, * w);
pole += Dimension_gen + 1; pole += Dimension_gen + 1;
} }
@ -375,9 +375,9 @@ static void PrepareEval
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
BSplCLib_DataContainer& dc) BSplCLib_DataContainer& dc)
{ {
// Set the Index // Set the Index
@ -385,16 +385,16 @@ static void PrepareEval
// make the knots // make the knots
BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots); BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots);
if (&Mults == NULL) if (Mults == NULL)
index -= Knots.Lower() + Degree; index -= Knots.Lower() + Degree;
else else
index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults); index = BSplCLib::PoleIndex(Degree,index,Periodic,*Mults);
// check truly rational // check truly rational
rational = (&Weights != NULL); rational = (Weights != NULL);
if (rational) { if (rational) {
Standard_Integer WLower = Weights.Lower() + index; Standard_Integer WLower = Weights->Lower() + index;
rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree); rational = BSplCLib::IsRational(*Weights, WLower, WLower + Degree);
} }
// make the poles // make the poles
@ -419,9 +419,9 @@ void BSplCLib::D0
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Point& P) Point& P)
{ {
// Standard_Integer k,dim,index = Index; // Standard_Integer k,dim,index = Index;
@ -451,9 +451,9 @@ void BSplCLib::D1
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Point& P, Point& P,
Vector& V) Vector& V)
{ {
@ -484,9 +484,9 @@ void BSplCLib::D2
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Point& P, Point& P,
Vector& V1, Vector& V1,
Vector& V2) Vector& V2)
@ -522,9 +522,9 @@ void BSplCLib::D3
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Point& P, Point& P,
Vector& V1, Vector& V1,
Vector& V2, Vector& V2,
@ -566,9 +566,9 @@ void BSplCLib::DN
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
Vector& VN) Vector& VN)
{ {
Standard_Integer dim,index = Index; Standard_Integer dim,index = Index;
@ -724,7 +724,7 @@ void BSplCLib::CacheD0(const Standard_Real Parameter,
const Standard_Real CacheParameter, const Standard_Real CacheParameter,
const Standard_Real SpanLenght, const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray, const Array1OfPoints& PolesArray,
const TColStd_Array1OfReal& WeightsArray, const TColStd_Array1OfReal* WeightsArray,
Point& aPoint) Point& aPoint)
{ {
// //
@ -742,9 +742,10 @@ void BSplCLib::CacheD0(const Standard_Real Parameter,
Degree * Dimension_gen, Degree * Dimension_gen,
PArray[0], PArray[0],
myPoint[0]) ; myPoint[0]) ;
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::NoDerivativeEvalPolynomial(NewParameter, PLib::NoDerivativeEvalPolynomial(NewParameter,
Degree, Degree,
1, 1,
@ -767,7 +768,7 @@ void BSplCLib::CacheD1(const Standard_Real Parameter,
const Standard_Real CacheParameter, const Standard_Real CacheParameter,
const Standard_Real SpanLenght, const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray, const Array1OfPoints& PolesArray,
const TColStd_Array1OfReal& WeightsArray, const TColStd_Array1OfReal* WeightsArray,
Point& aPoint, Point& aPoint,
Vector& aVector) Vector& aVector)
{ {
@ -799,9 +800,10 @@ void BSplCLib::CacheD1(const Standard_Real Parameter,
ModifyCoords (LocalPDerivatives + Dimension_gen, /= SpanLenght); ModifyCoords (LocalPDerivatives + Dimension_gen, /= SpanLenght);
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::EvalPolynomial(NewParameter, PLib::EvalPolynomial(NewParameter,
1, 1,
Degree, Degree,
@ -835,7 +837,7 @@ void BSplCLib::CacheD2(const Standard_Real Parameter,
const Standard_Real CacheParameter, const Standard_Real CacheParameter,
const Standard_Real SpanLenght, const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray, const Array1OfPoints& PolesArray,
const TColStd_Array1OfReal& WeightsArray, const TColStd_Array1OfReal* WeightsArray,
Point& aPoint, Point& aPoint,
Vector& aVector1, Vector& aVector1,
Vector& aVector2) Vector& aVector2)
@ -879,9 +881,10 @@ void BSplCLib::CacheD2(const Standard_Real Parameter,
Index += Dimension_gen; Index += Dimension_gen;
} }
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::EvalPolynomial(NewParameter, PLib::EvalPolynomial(NewParameter,
2, 2,
@ -925,7 +928,7 @@ void BSplCLib::CacheD3(const Standard_Real Parameter,
const Standard_Real CacheParameter, const Standard_Real CacheParameter,
const Standard_Real SpanLenght, const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray, const Array1OfPoints& PolesArray,
const TColStd_Array1OfReal& WeightsArray, const TColStd_Array1OfReal* WeightsArray,
Point& aPoint, Point& aPoint,
Vector& aVector1, Vector& aVector1,
Vector& aVector2, Vector& aVector2,
@ -972,9 +975,10 @@ void BSplCLib::CacheD3(const Standard_Real Parameter,
Index += Dimension_gen; Index += Dimension_gen;
} }
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ; WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::EvalPolynomial(NewParameter, PLib::EvalPolynomial(NewParameter,
3, 3,
@ -1023,9 +1027,9 @@ void BSplCLib::BuildCache
const Standard_Integer Degree, const Standard_Integer Degree,
const TColStd_Array1OfReal& FlatKnots, const TColStd_Array1OfReal& FlatKnots,
const Array1OfPoints& Poles, const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
Array1OfPoints& CachePoles, Array1OfPoints& CachePoles,
TColStd_Array1OfReal& CacheWeights) TColStd_Array1OfReal* CacheWeights)
{ {
Standard_Integer ii, Standard_Integer ii,
Dimension, Dimension,
@ -1069,7 +1073,7 @@ void BSplCLib::BuildCache
LocalIndex = Dimension_gen; LocalIndex = Dimension_gen;
LocalValue = 1.0e0 ; LocalValue = 1.0e0 ;
for (ii = 1 ; ii <= Degree + 1 ; ii++) { for (ii = 1 ; ii <= Degree + 1 ; ii++) {
CacheWeights(ii) = dc.poles[LocalIndex] * LocalValue ; (*CacheWeights)(ii) = dc.poles[LocalIndex] * LocalValue ;
LocalIndex += Dimension_gen + 1; LocalIndex += Dimension_gen + 1;
LocalValue *= SpanDomain / (Standard_Real) ii ; LocalValue *= SpanDomain / (Standard_Real) ii ;
} }
@ -1082,10 +1086,10 @@ void BSplCLib::BuildCache
LocalValue *= SpanDomain / (Standard_Real) ii ; LocalValue *= SpanDomain / (Standard_Real) ii ;
} }
if (&Weights != NULL) { if (Weights != NULL) {
for (ii = 1 ; ii <= Degree + 1 ; ii++) for (ii = 1 ; ii <= Degree + 1 ; ii++)
CacheWeights(ii) = 0.0e0 ; (*CacheWeights)(ii) = 0.0e0 ;
CacheWeights(1) = 1.0e0 ; (*CacheWeights)(1) = 1.0e0 ;
} }
} }
} }
@ -1096,7 +1100,7 @@ void BSplCLib::BuildCache(const Standard_Real theParameter,
const Standard_Integer theDegree, const Standard_Integer theDegree,
const TColStd_Array1OfReal& theFlatKnots, const TColStd_Array1OfReal& theFlatKnots,
const Array1OfPoints& thePoles, const Array1OfPoints& thePoles,
const TColStd_Array1OfReal& theWeights, const TColStd_Array1OfReal* theWeights,
TColStd_Array2OfReal& theCacheArray) TColStd_Array2OfReal& theCacheArray)
{ {
Standard_Real aParam = theParameter; Standard_Real aParam = theParameter;
@ -1123,7 +1127,7 @@ void BSplCLib::BuildCache(const Standard_Real theParameter,
// //
Standard_Integer aCacheShift = // helps to store weights when PrepareEval did not found that the curve is locally polynomial Standard_Integer aCacheShift = // helps to store weights when PrepareEval did not found that the curve is locally polynomial
(&theWeights != NULL && !isRational) ? aDimension + 1 : aDimension; (theWeights != NULL && !isRational) ? aDimension + 1 : aDimension;
BSplCLib::Bohm(aParam, theDegree, theDegree, *dc.knots, aDimension, *dc.poles); BSplCLib::Bohm(aParam, theDegree, theDegree, *dc.knots, aDimension, *dc.poles);
@ -1388,7 +1392,7 @@ void BSplCLib::MovePointAndTangent (const Standard_Real U,
//======================================================================= //=======================================================================
void BSplCLib::Resolution(const Array1OfPoints& Poles, void BSplCLib::Resolution(const Array1OfPoints& Poles,
const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal* Weights,
const Standard_Integer NumPoles, const Standard_Integer NumPoles,
const TColStd_Array1OfReal& FlatKnots, const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer Degree, const Standard_Integer Degree,

View File

@ -272,11 +272,11 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
const Standard_Boolean UPer, const Standard_Boolean UPer,
const Standard_Boolean VPer, const Standard_Boolean VPer,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
Standard_Real& u1, // first parameter to use Standard_Real& u1, // first parameter to use
Standard_Real& u2, // second parameter to use Standard_Real& u2, // second parameter to use
Standard_Integer& d1, // first degree Standard_Integer& d1, // first degree
@ -311,15 +311,15 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots1); BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots1);
BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots2); BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots2);
if (&UMults == NULL) if (UMults == NULL)
uindex -= UKLower + UDegree; uindex -= UKLower + UDegree;
else else
uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults); uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,*UMults);
if (&VMults == NULL) if (VMults == NULL)
vindex -= VKLower + VDegree; vindex -= VKLower + VDegree;
else else
vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults); vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,*VMults);
// get the poles // get the poles
Standard_Integer i,j,ip,jp; Standard_Integer i,j,ip,jp;
@ -341,7 +341,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
if(ip < PLowerRow) ip = PUpperRow; if(ip < PLowerRow) ip = PUpperRow;
if(jp < PLowerCol) jp = PUpperCol; if(jp < PLowerCol) jp = PUpperCol;
w = Weights.Value(ip,jp); w = Weights->Value(ip,jp);
Standard_Real eps = Epsilon(w); Standard_Real eps = Epsilon(w);
Standard_Real dw; Standard_Real dw;
@ -354,7 +354,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
for (j = 0; j <= VDegree && !rational; j++) for (j = 0; j <= VDegree && !rational; j++)
{ {
dw = Weights.Value(ip,jp) - w; dw = Weights->Value(ip,jp) - w;
if (dw < 0) if (dw < 0)
dw = - dw; dw = - dw;
@ -392,7 +392,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
for (j = 0; j <= d2; j++) for (j = 0; j <= d2; j++)
{ {
const gp_Pnt& P = Poles .Value(ip,jp); const gp_Pnt& P = Poles .Value(ip,jp);
pole[3] = w = Weights.Value(ip,jp); pole[3] = w = Weights->Value(ip,jp);
pole[0] = P.X() * w; pole[0] = P.X() * w;
pole[1] = P.Y() * w; pole[1] = P.Y() * w;
pole[2] = P.Z() * w; pole[2] = P.Z() * w;
@ -462,15 +462,15 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots2); BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots2);
BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots1); BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots1);
if (&UMults == NULL) if (UMults == NULL)
uindex -= UKLower + UDegree; uindex -= UKLower + UDegree;
else else
uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults); uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,*UMults);
if (&VMults == NULL) if (VMults == NULL)
vindex -= VKLower + VDegree; vindex -= VKLower + VDegree;
else else
vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults); vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,*VMults);
// get the poles // get the poles
Standard_Integer i,j,ip,jp; Standard_Integer i,j,ip,jp;
@ -495,7 +495,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
if(jp < PLowerCol) if(jp < PLowerCol)
jp = PUpperCol; jp = PUpperCol;
w = Weights.Value(ip,jp); w = Weights->Value(ip,jp);
Standard_Real eps = Epsilon(w); Standard_Real eps = Epsilon(w);
Standard_Real dw; Standard_Real dw;
@ -508,7 +508,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
for (j = 0; j <= VDegree && !rational; j++) for (j = 0; j <= VDegree && !rational; j++)
{ {
dw = Weights.Value(ip,jp) - w; dw = Weights->Value(ip,jp) - w;
if (dw < 0) dw = - dw; if (dw < 0) dw = - dw;
rational = dw > eps; rational = dw > eps;
@ -544,7 +544,7 @@ static Standard_Boolean PrepareEval (const Standard_Real U,
for (j = 0; j <= d2; j++) for (j = 0; j <= d2; j++)
{ {
const gp_Pnt& P = Poles.Value(ip,jp); const gp_Pnt& P = Poles.Value(ip,jp);
pole[3] = w = Weights.Value(ip,jp); pole[3] = w = Weights->Value(ip,jp);
pole[0] = P.X() * w; pole[0] = P.X() * w;
pole[1] = P.Y() * w; pole[1] = P.Y() * w;
pole[2] = P.Z() * w; pole[2] = P.Z() * w;
@ -611,11 +611,11 @@ void BSplSLib::D0
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -660,11 +660,11 @@ void BSplSLib::HomogeneousD0
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -715,11 +715,11 @@ void BSplSLib::D1
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -813,11 +813,11 @@ void BSplSLib::HomogeneousD1
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -886,11 +886,11 @@ void BSplSLib::D2
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -1020,11 +1020,11 @@ void BSplSLib::D3
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -1221,11 +1221,11 @@ void BSplSLib::DN
const Standard_Integer UIndex, const Standard_Integer UIndex,
const Standard_Integer VIndex, const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger* UMults,
const TColStd_Array1OfInteger& VMults, const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree, const Standard_Integer UDegree,
const Standard_Integer VDegree, const Standard_Integer VDegree,
const Standard_Boolean URat, const Standard_Boolean URat,
@ -1294,17 +1294,17 @@ void BSplSLib::DN
void BSplSLib::Iso(const Standard_Real Param, void BSplSLib::Iso(const Standard_Real Param,
const Standard_Boolean IsU, const Standard_Boolean IsU,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger* Mults,
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
TColgp_Array1OfPnt& CPoles, TColgp_Array1OfPnt& CPoles,
TColStd_Array1OfReal& CWeights) TColStd_Array1OfReal* CWeights)
{ {
Standard_Integer index = 0; Standard_Integer index = 0;
Standard_Real u = Param; Standard_Real u = Param;
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = rational ? 4 : 3; Standard_Integer dim = rational ? 4 : 3;
// compute local knots // compute local knots
@ -1312,10 +1312,10 @@ void BSplSLib::Iso(const Standard_Real Param,
NCollection_LocalArray<Standard_Real> locknots1 (2*Degree); NCollection_LocalArray<Standard_Real> locknots1 (2*Degree);
BSplCLib::LocateParameter(Degree,Knots,Mults,u,Periodic,index,u); BSplCLib::LocateParameter(Degree,Knots,Mults,u,Periodic,index,u);
BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*locknots1); BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*locknots1);
if (&Mults == NULL) if (Mults == NULL)
index -= Knots.Lower() + Degree; index -= Knots.Lower() + Degree;
else else
index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults); index = BSplCLib::PoleIndex(Degree,index,Periodic,*Mults);
// copy the local poles // copy the local poles
@ -1347,7 +1347,7 @@ void BSplSLib::Iso(const Standard_Real Param,
const gp_Pnt& P = IsU ? Poles(index,j) : Poles(j,index); const gp_Pnt& P = IsU ? Poles(index,j) : Poles(j,index);
if (rational) { if (rational) {
pole[3] = w = IsU ? Weights(index,j) : Weights(j,index); pole[3] = w = IsU ? (*Weights)(index,j) : (*Weights)(j,index);
pole[0] = P.X() * w; pole[0] = P.X() * w;
pole[1] = P.Y() * w; pole[1] = P.Y() * w;
pole[2] = P.Z() * w; pole[2] = P.Z() * w;
@ -1372,7 +1372,7 @@ void BSplSLib::Iso(const Standard_Real Param,
for (i = CPoles.Lower(); i <= CPoles.Upper(); i++) { for (i = CPoles.Lower(); i <= CPoles.Upper(); i++) {
gp_Pnt& P = CPoles(i); gp_Pnt& P = CPoles(i);
if (rational) { if (rational) {
CWeights(i) = w = pole[3]; (*CWeights)(i) = w = pole[3];
P.SetX( pole[0] / w); P.SetX( pole[0] / w);
P.SetY( pole[1] / w); P.SetY( pole[1] / w);
P.SetZ( pole[2] / w); P.SetZ( pole[2] / w);
@ -1386,10 +1386,10 @@ void BSplSLib::Iso(const Standard_Real Param,
} }
// if the input is not rational but weights are wanted // if the input is not rational but weights are wanted
if (!rational && (&CWeights != NULL)) { if (!rational && (CWeights != NULL)) {
for (i = CWeights.Lower(); i <= CWeights.Upper(); i++) for (i = CWeights->Lower(); i <= CWeights->Upper(); i++)
CWeights(i) = 1.; (*CWeights)(i) = 1.;
} }
} }
@ -1734,19 +1734,19 @@ void BSplSLib::InsertKnots(const Standard_Boolean UDirection,
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots, const TColStd_Array1OfReal& AddKnots,
const TColStd_Array1OfInteger& AddMults, const TColStd_Array1OfInteger* AddMults,
TColgp_Array2OfPnt& NewPoles, TColgp_Array2OfPnt& NewPoles,
TColStd_Array2OfReal& NewWeights, TColStd_Array2OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
const Standard_Real Epsilon, const Standard_Real Epsilon,
const Standard_Boolean Add ) const Standard_Boolean Add )
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3; Standard_Integer dim = 3;
if (rational) dim++; if (rational) dim++;
@ -1754,7 +1754,7 @@ void BSplSLib::InsertKnots(const Standard_Boolean UDirection,
TColStd_Array1OfReal TColStd_Array1OfReal
newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength()); newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength());
if (rational) SetPoles(Poles,Weights,poles,UDirection); if (rational) SetPoles(Poles,*Weights,poles,UDirection);
else SetPoles(Poles,poles,UDirection); else SetPoles(Poles,poles,UDirection);
if (UDirection) { if (UDirection) {
@ -1767,7 +1767,7 @@ void BSplSLib::InsertKnots(const Standard_Boolean UDirection,
AddKnots,AddMults,newpoles,NewKnots,NewMults, AddKnots,AddMults,newpoles,NewKnots,NewMults,
Epsilon,Add); Epsilon,Add);
if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection); if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection); else GetPoles(newpoles,NewPoles,UDirection);
} }
@ -1783,16 +1783,16 @@ Standard_Boolean BSplSLib::RemoveKnot
const Standard_Integer Degree, const Standard_Integer Degree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
TColgp_Array2OfPnt& NewPoles, TColgp_Array2OfPnt& NewPoles,
TColStd_Array2OfReal& NewWeights, TColStd_Array2OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
const Standard_Real Tolerance) const Standard_Real Tolerance)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3; Standard_Integer dim = 3;
if (rational) dim++; if (rational) dim++;
@ -1800,7 +1800,7 @@ Standard_Boolean BSplSLib::RemoveKnot
TColStd_Array1OfReal TColStd_Array1OfReal
newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength()); newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength());
if (rational) SetPoles(Poles,Weights,poles,UDirection); if (rational) SetPoles(Poles,*Weights,poles,UDirection);
else SetPoles(Poles,poles,UDirection); else SetPoles(Poles,poles,UDirection);
if (UDirection) { if (UDirection) {
@ -1815,7 +1815,7 @@ Standard_Boolean BSplSLib::RemoveKnot
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection); if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection); else GetPoles(newpoles,NewPoles,UDirection);
return Standard_True; return Standard_True;
} }
@ -1831,15 +1831,15 @@ void BSplSLib::IncreaseDegree
const Standard_Integer NewDegree, const Standard_Integer NewDegree,
const Standard_Boolean Periodic, const Standard_Boolean Periodic,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
TColgp_Array2OfPnt& NewPoles, TColgp_Array2OfPnt& NewPoles,
TColStd_Array2OfReal& NewWeights, TColStd_Array2OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults) TColStd_Array1OfInteger& NewMults)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3; Standard_Integer dim = 3;
if (rational) dim++; if (rational) dim++;
@ -1847,7 +1847,7 @@ void BSplSLib::IncreaseDegree
TColStd_Array1OfReal TColStd_Array1OfReal
newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength()); newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength());
if (rational) SetPoles(Poles,Weights,poles,UDirection); if (rational) SetPoles(Poles,*Weights,poles,UDirection);
else SetPoles(Poles,poles,UDirection); else SetPoles(Poles,poles,UDirection);
if (UDirection) { if (UDirection) {
@ -1860,7 +1860,7 @@ void BSplSLib::IncreaseDegree
BSplCLib::IncreaseDegree(Degree,NewDegree,Periodic,dim,poles,Knots,Mults, BSplCLib::IncreaseDegree(Degree,NewDegree,Periodic,dim,poles,Knots,Mults,
newpoles,NewKnots,NewMults); newpoles,NewKnots,NewMults);
if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection); if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection); else GetPoles(newpoles,NewPoles,UDirection);
} }
@ -1875,13 +1875,13 @@ void BSplSLib::Unperiodize
const TColStd_Array1OfInteger& Mults, const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& Knots, const TColStd_Array1OfReal& Knots,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
TColStd_Array1OfInteger& NewMults, TColStd_Array1OfInteger& NewMults,
TColStd_Array1OfReal& NewKnots, TColStd_Array1OfReal& NewKnots,
TColgp_Array2OfPnt& NewPoles, TColgp_Array2OfPnt& NewPoles,
TColStd_Array2OfReal& NewWeights) TColStd_Array2OfReal* NewWeights)
{ {
Standard_Boolean rational = &Weights != NULL; Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3; Standard_Integer dim = 3;
if (rational) dim++; if (rational) dim++;
@ -1889,7 +1889,7 @@ void BSplSLib::Unperiodize
TColStd_Array1OfReal TColStd_Array1OfReal
newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength()); newpoles( 1, dim*NewPoles.RowLength()*NewPoles.ColLength());
if (rational) SetPoles(Poles,Weights,poles,UDirection); if (rational) SetPoles(Poles,*Weights,poles,UDirection);
else SetPoles(Poles,poles,UDirection); else SetPoles(Poles,poles,UDirection);
if (UDirection) { if (UDirection) {
@ -1902,7 +1902,7 @@ void BSplSLib::Unperiodize
BSplCLib::Unperiodize(Degree, dim, Mults, Knots, poles, BSplCLib::Unperiodize(Degree, dim, Mults, Knots, poles,
NewMults, NewKnots, newpoles); NewMults, NewKnots, newpoles);
if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection); if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection); else GetPoles(newpoles,NewPoles,UDirection);
} }
@ -1927,14 +1927,14 @@ void BSplSLib::BuildCache
const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& UFlatKnots,
const TColStd_Array1OfReal& VFlatKnots, const TColStd_Array1OfReal& VFlatKnots,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
TColgp_Array2OfPnt& CachePoles, TColgp_Array2OfPnt& CachePoles,
TColStd_Array2OfReal& CacheWeights) TColStd_Array2OfReal* CacheWeights)
{ {
Standard_Boolean rational,rational_u,rational_v,flag_u_or_v; Standard_Boolean rational,rational_u,rational_v,flag_u_or_v;
Standard_Integer kk,d1,d1p1,d2,d2p1,ii,jj,iii,jjj,Index; Standard_Integer kk,d1,d1p1,d2,d2p1,ii,jj,iii,jjj,Index;
Standard_Real u1,min_degree_domain,max_degree_domain,f,factor[2],u2; Standard_Real u1,min_degree_domain,max_degree_domain,f,factor[2],u2;
if (&Weights != NULL) if (Weights != NULL)
rational_u = rational_v = Standard_True; rational_u = rational_v = Standard_True;
else else
rational_u = rational_v = Standard_False; rational_u = rational_v = Standard_False;
@ -1992,7 +1992,7 @@ void BSplSLib::BuildCache
P.SetX( f * dc.poles[Index]); Index++; P.SetX( f * dc.poles[Index]); Index++;
P.SetY( f * dc.poles[Index]); Index++; P.SetY( f * dc.poles[Index]); Index++;
P.SetZ( f * dc.poles[Index]); Index++; P.SetZ( f * dc.poles[Index]); Index++;
CacheWeights(iii ,jjj) = f * dc.poles[Index] ; (*CacheWeights)(iii ,jjj) = f * dc.poles[Index] ;
factor[1] *= min_degree_domain / (Standard_Real) (jjj) ; factor[1] *= min_degree_domain / (Standard_Real) (jjj) ;
} }
factor[0] *= max_degree_domain / (Standard_Real) (iii) ; factor[0] *= max_degree_domain / (Standard_Real) (iii) ;
@ -2030,7 +2030,7 @@ void BSplSLib::BuildCache
} }
factor[0] *= max_degree_domain / (Standard_Real) (iii) ; factor[0] *= max_degree_domain / (Standard_Real) (iii) ;
} }
if (&Weights != NULL) { if (Weights != NULL) {
// //
// means that PrepareEval did found out that the surface was // means that PrepareEval did found out that the surface was
// locally polynomial but since the surface is constructed // locally polynomial but since the surface is constructed
@ -2040,10 +2040,10 @@ void BSplSLib::BuildCache
for (ii = 1 ; ii <= d2p1 ; ii++) { for (ii = 1 ; ii <= d2p1 ; ii++) {
for (jj = 1 ; jj <= d1p1 ; jj++) { for (jj = 1 ; jj <= d1p1 ; jj++) {
CacheWeights(ii,jj) = 0.0e0 ; (*CacheWeights)(ii,jj) = 0.0e0 ;
} }
} }
CacheWeights(1,1) = 1.0e0 ; (*CacheWeights)(1,1) = 1.0e0 ;
} }
} }
} }
@ -2061,13 +2061,13 @@ void BSplSLib::BuildCache(const Standard_Real theU,
const TColStd_Array1OfReal& theUFlatKnots, const TColStd_Array1OfReal& theUFlatKnots,
const TColStd_Array1OfReal& theVFlatKnots, const TColStd_Array1OfReal& theVFlatKnots,
const TColgp_Array2OfPnt& thePoles, const TColgp_Array2OfPnt& thePoles,
const TColStd_Array2OfReal& theWeights, const TColStd_Array2OfReal* theWeights,
TColStd_Array2OfReal& theCacheArray) TColStd_Array2OfReal& theCacheArray)
{ {
Standard_Boolean flag_u_or_v; Standard_Boolean flag_u_or_v;
Standard_Integer d1, d2; Standard_Integer d1, d2;
Standard_Real u1, u2; Standard_Real u1, u2;
Standard_Boolean isRationalOnParam = (&theWeights != NULL); Standard_Boolean isRationalOnParam = (theWeights != NULL);
Standard_Boolean isRational; Standard_Boolean isRational;
BSplSLib_DataContainer dc(theUDegree, theVDegree); BSplSLib_DataContainer dc(theUDegree, theVDegree);
@ -2158,7 +2158,7 @@ void BSplSLib::CacheD0(const Standard_Real UParameter,
const Standard_Real USpanLenght, const Standard_Real USpanLenght,
const Standard_Real VSpanLenght, const Standard_Real VSpanLenght,
const TColgp_Array2OfPnt& PolesArray, const TColgp_Array2OfPnt& PolesArray,
const TColStd_Array2OfReal& WeightsArray, const TColStd_Array2OfReal* WeightsArray,
gp_Pnt& aPoint) gp_Pnt& aPoint)
{ {
// //
@ -2210,11 +2210,12 @@ void BSplSLib::CacheD0(const Standard_Real UParameter,
(min_degree << 1) + min_degree, (min_degree << 1) + min_degree,
locpoles[0], locpoles[0],
myPoint[0]) ; myPoint[0]) ;
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
dimension = min_degree + 1 ; dimension = min_degree + 1 ;
const TColStd_Array2OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) WArray = (Standard_Real *)
&WeightsArray(WeightsArray.LowerCol(),WeightsArray.LowerRow()) ; &refWeights(refWeights.LowerCol(),refWeights.LowerRow()) ;
PLib::NoDerivativeEvalPolynomial(new_parameter[0], PLib::NoDerivativeEvalPolynomial(new_parameter[0],
max_degree, max_degree,
dimension, dimension,
@ -2251,7 +2252,7 @@ void BSplSLib::CacheD1(const Standard_Real UParameter,
const Standard_Real USpanLenght, const Standard_Real USpanLenght,
const Standard_Real VSpanLenght, const Standard_Real VSpanLenght,
const TColgp_Array2OfPnt& PolesArray, const TColgp_Array2OfPnt& PolesArray,
const TColStd_Array2OfReal& WeightsArray, const TColStd_Array2OfReal* WeightsArray,
gp_Pnt& aPoint, gp_Pnt& aPoint,
gp_Vec& aVecU, gp_Vec& aVecU,
gp_Vec& aVecV) gp_Vec& aVecV)
@ -2290,7 +2291,7 @@ void BSplSLib::CacheD1(const Standard_Real UParameter,
// the coefficients // the coefficients
// //
// //
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
local_poles_array [0][0][0] = 0.0e0 ; local_poles_array [0][0][0] = 0.0e0 ;
local_poles_array [0][0][1] = 0.0e0 ; local_poles_array [0][0][1] = 0.0e0 ;
@ -2375,11 +2376,12 @@ void BSplSLib::CacheD1(const Standard_Real UParameter,
locpoles[dimension], locpoles[dimension],
local_poles_array[1][0][0]) ; local_poles_array[1][0][0]) ;
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
dimension = min_degree + 1 ; dimension = min_degree + 1 ;
const TColStd_Array2OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) WArray = (Standard_Real *)
&WeightsArray(WeightsArray.LowerCol(),WeightsArray.LowerRow()) ; &refWeights(refWeights.LowerCol(),refWeights.LowerRow()) ;
PLib::EvalPolynomial(new_parameter[0], PLib::EvalPolynomial(new_parameter[0],
1, 1,
max_degree, max_degree,
@ -2456,7 +2458,7 @@ void BSplSLib::CacheD2(const Standard_Real UParameter,
const Standard_Real USpanLenght, const Standard_Real USpanLenght,
const Standard_Real VSpanLenght, const Standard_Real VSpanLenght,
const TColgp_Array2OfPnt& PolesArray, const TColgp_Array2OfPnt& PolesArray,
const TColStd_Array2OfReal& WeightsArray, const TColStd_Array2OfReal* WeightsArray,
gp_Pnt& aPoint, gp_Pnt& aPoint,
gp_Vec& aVecU, gp_Vec& aVecU,
gp_Vec& aVecV, gp_Vec& aVecV,
@ -2535,7 +2537,7 @@ void BSplSLib::CacheD2(const Standard_Real UParameter,
// the coefficients // the coefficients
// //
// //
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
local_poles_and_weights_array[0][0][0] = 0.0e0 ; local_poles_and_weights_array[0][0][0] = 0.0e0 ;
local_poles_and_weights_array[0][0][1] = 0.0e0 ; local_poles_and_weights_array[0][0][1] = 0.0e0 ;
@ -2664,11 +2666,12 @@ void BSplSLib::CacheD2(const Standard_Real UParameter,
locpoles[dimension + dimension], locpoles[dimension + dimension],
local_poles_array[2][0][0]) ; local_poles_array[2][0][0]) ;
if (&WeightsArray != NULL) { if (WeightsArray != NULL) {
dimension = min_degree + 1 ; dimension = min_degree + 1 ;
const TColStd_Array2OfReal& refWeights = *WeightsArray;
Standard_Real * Standard_Real *
WArray = (Standard_Real *) WArray = (Standard_Real *)
&WeightsArray(WeightsArray.LowerCol(),WeightsArray.LowerRow()) ; &refWeights(refWeights.LowerCol(),refWeights.LowerRow()) ;
PLib::EvalPolynomial(new_parameter[0], PLib::EvalPolynomial(new_parameter[0],
MinIndMax, MinIndMax,
max_degree, max_degree,
@ -3004,7 +3007,7 @@ void BSplSLib::MovePoint (const Standard_Real U,
//======================================================================= //=======================================================================
void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles, void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots, const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults, const TColStd_Array1OfInteger& UMults,
@ -3056,7 +3059,8 @@ void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles,
PColLength = Poles.ColLength(); PColLength = Poles.ColLength();
if (URational || VRational) { if (URational || VRational) {
Standard_Integer Wsize = PRowLength * PColLength; Standard_Integer Wsize = PRowLength * PColLength;
const Standard_Real * WG = &Weights(Weights.LowerRow(),Weights.LowerCol()); const TColStd_Array2OfReal& refWights = *Weights;
const Standard_Real * WG = &refWights(refWights.LowerRow(), refWights.LowerCol());
min_weights = WG[0]; min_weights = WG[0];
for (ii = 1 ; ii < Wsize ; ii++) { for (ii = 1 ; ii < Wsize ; ii++) {
@ -3091,9 +3095,9 @@ void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles,
upper[1] = jj + VD2 + 1; upper[1] = jj + VD2 + 1;
if (upper[1] > num_poles[1]) upper[1] = num_poles[1]; if (upper[1] > num_poles[1]) upper[1] = num_poles[1];
const gp_Pnt& Pij = Poles .Value(ii_index,jj_index); const gp_Pnt& Pij = Poles .Value(ii_index,jj_index);
Wij = Weights.Value(ii_index,jj_index); Wij = Weights->Value(ii_index,jj_index);
const gp_Pnt& Pmj = Poles .Value(ii_minus,jj_index); const gp_Pnt& Pmj = Poles .Value(ii_minus,jj_index);
Wmj = Weights.Value(ii_minus,jj_index); Wmj = Weights->Value(ii_minus,jj_index);
Xij = Pij.X(); Xij = Pij.X();
Yij = Pij.Y(); Yij = Pij.Y();
Zij = Pij.Z(); Zij = Pij.Z();
@ -3180,9 +3184,9 @@ void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles,
upper[1] = jj + UD2 + 1; upper[1] = jj + UD2 + 1;
if (upper[1] > num_poles[0]) upper[1] = num_poles[0]; if (upper[1] > num_poles[0]) upper[1] = num_poles[0];
const gp_Pnt& Pji = Poles .Value(jj_index,ii_index); const gp_Pnt& Pji = Poles .Value(jj_index,ii_index);
Wji = Weights.Value(jj_index,ii_index); Wji = Weights->Value(jj_index,ii_index);
const gp_Pnt& Pjm = Poles .Value(jj_index,ii_minus); const gp_Pnt& Pjm = Poles .Value(jj_index,ii_minus);
Wjm = Weights.Value(jj_index,ii_minus); Wjm = Weights->Value(jj_index,ii_minus);
Xji = Pji.X(); Xji = Pji.X();
Yji = Pji.Y(); Yji = Pji.Y();
Zji = Pji.Z(); Zji = Pji.Z();
@ -3449,10 +3453,10 @@ void BSplSLib::FunctionMultiply
const Standard_Integer VBSplineDegree, const Standard_Integer VBSplineDegree,
const TColStd_Array1OfReal& UBSplineKnots, const TColStd_Array1OfReal& UBSplineKnots,
const TColStd_Array1OfReal& VBSplineKnots, const TColStd_Array1OfReal& VBSplineKnots,
const TColStd_Array1OfInteger & UMults, const TColStd_Array1OfInteger * UMults,
const TColStd_Array1OfInteger & VMults, const TColStd_Array1OfInteger * VMults,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UFlatKnots, const TColStd_Array1OfReal& UFlatKnots,
const TColStd_Array1OfReal& VFlatKnots, const TColStd_Array1OfReal& VFlatKnots,
const Standard_Integer UNewDegree, const Standard_Integer UNewDegree,

View File

@ -71,6 +71,10 @@ class gp_Vec;
//! parametric U direction and the columns indice corresponds //! parametric U direction and the columns indice corresponds
//! to the parametric V direction. //! to the parametric V direction.
//! //!
//! Note: weight and multiplicity arrays can be passed by pointer for
//! some functions so that NULL pointer is valid.
//! That means no weights/no multiplicities passed.
//!
//! KeyWords : //! KeyWords :
//! B-spline surface, Functions, Library //! B-spline surface, Functions, Library
//! //!
@ -177,20 +181,20 @@ public:
//! Warning: <RDers> must be dimensionned properly. //! Warning: <RDers> must be dimensionned properly.
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); 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);
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); 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);
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); 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);
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); 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);
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); 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);
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); 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);
//! Computes the poles and weights of an isoparametric //! Computes the poles and weights of an isoparametric
//! curve at parameter <Param> (UIso if <IsU> is True, //! curve at parameter <Param> (UIso if <IsU> is True,
//! VIso else). //! VIso else).
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); 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);
//! Reverses the array of poles. Last is the Index of //! Reverses the array of poles. Last is the Index of
//! the new first Row( Col) of Poles. //! the new first Row( Col) of Poles.
@ -207,13 +211,13 @@ public:
//! any and returns in P the Numerator value and //! any and returns in P the Numerator value and
//! in W the Denominator value if Weights are present //! in W the Denominator value if Weights are present
//! otherwise returns 1.0e0 //! otherwise returns 1.0e0
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); 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);
//! Makes an homogeneous evaluation of Poles and Weights //! Makes an homogeneous evaluation of Poles and Weights
//! any and returns in P the Numerator value and //! any and returns in P the Numerator value and
//! in W the Denominator value if Weights are present //! in W the Denominator value if Weights are present
//! otherwise returns 1.0e0 //! otherwise returns 1.0e0
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); 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);
//! Reverses the array of weights. //! Reverses the array of weights.
Standard_EXPORT static void Reverse (TColStd_Array2OfReal& Weights, const Standard_Integer Last, const Standard_Boolean UDirection); Standard_EXPORT static void Reverse (TColStd_Array2OfReal& Weights, const Standard_Integer Last, const Standard_Boolean UDirection);
@ -252,27 +256,27 @@ public:
//! VFirstIndex, VLastIndex = 0 //! VFirstIndex, VLastIndex = 0
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); 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);
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); 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);
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); 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);
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); 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);
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); 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);
//! Used as argument for a non rational curve. //! Used as argument for a non rational curve.
static TColStd_Array2OfReal& NoWeights(); static TColStd_Array2OfReal* NoWeights();
//! Perform the evaluation of the Taylor expansion //! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1. //! of the Bspline normalized between 0 and 1.
//! If rational computes the homogeneous Taylor expension //! If rational computes the homogeneous Taylor expension
//! for the numerator and stores it in CachePoles //! for the numerator and stores it in CachePoles
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); 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);
//! Perform the evaluation of the Taylor expansion //! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1. //! of the Bspline normalized between 0 and 1.
//! Structure of result optimized for BSplSLib_Cache. //! Structure of result optimized for BSplSLib_Cache.
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); 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);
//! Perform the evaluation of the of the cache //! Perform the evaluation of the of the cache
//! the parameter must be normalized between //! the parameter must be normalized between
@ -285,12 +289,12 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
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); 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);
//! Calls CacheD0 for Bezier Surfaces Arrays computed with //! Calls CacheD0 for Bezier Surfaces Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for BezierSurfaces ONLY!!! //! Warning: To be used for BezierSurfaces ONLY!!!
static void CoefsD0 (const Standard_Real U, const Standard_Real V, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal& Weights, gp_Pnt& Point); static void CoefsD0 (const Standard_Real U, const Standard_Real V, const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, gp_Pnt& Point);
//! Perform the evaluation of the of the cache //! Perform the evaluation of the of the cache
//! the parameter must be normalized between //! the parameter must be normalized between
@ -303,12 +307,12 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
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); 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);
//! Calls CacheD0 for Bezier Surfaces Arrays computed with //! Calls CacheD0 for Bezier Surfaces Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for BezierSurfaces ONLY!!! //! Warning: To be used for BezierSurfaces ONLY!!!
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); 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);
//! Perform the evaluation of the of the cache //! Perform the evaluation of the of the cache
//! the parameter must be normalized between //! the parameter must be normalized between
@ -321,12 +325,12 @@ public:
//! constructed the SpanLength is to normalize //! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning //! the polynomial in the cache to avoid bad conditioning
//! effects //! effects
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); 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);
//! Calls CacheD0 for Bezier Surfaces Arrays computed with //! Calls CacheD0 for Bezier Surfaces Arrays computed with
//! the method PolesCoefficients. //! the method PolesCoefficients.
//! Warning: To be used for BezierSurfaces ONLY!!! //! Warning: To be used for BezierSurfaces ONLY!!!
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); 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);
//! Warning! To be used for BezierSurfaces ONLY!!! //! Warning! To be used for BezierSurfaces ONLY!!!
static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, TColgp_Array2OfPnt& CachePoles); static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, TColgp_Array2OfPnt& CachePoles);
@ -335,7 +339,7 @@ public:
//! evaluation of the Taylor expansion for beziersurfaces //! evaluation of the Taylor expansion for beziersurfaces
//! at parameters 0.,0.; //! at parameters 0.,0.;
//! Warning: To be used for BezierSurfaces ONLY!!! //! Warning: To be used for BezierSurfaces ONLY!!!
Standard_EXPORT static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal& Weights, TColgp_Array2OfPnt& CachePoles, TColStd_Array2OfReal& CacheWeights); Standard_EXPORT static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, const TColStd_Array2OfReal* Weights, TColgp_Array2OfPnt& CachePoles, TColStd_Array2OfReal* CacheWeights);
//! Given a tolerance in 3D space returns two //! Given a tolerance in 3D space returns two
//! tolerances, one in U one in V such that for //! tolerances, one in U one in V such that for
@ -344,7 +348,7 @@ public:
//! | u1 - u0 | < UTolerance and //! | u1 - u0 | < UTolerance and
//! | v1 - v0 | < VTolerance //! | v1 - v0 | < VTolerance
//! we have |f (u1,v1) - f (u0,v0)| < Tolerance3D //! we have |f (u1,v1) - f (u0,v0)| < Tolerance3D
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); 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);
//! Performs the interpolation of the data points given in //! Performs the interpolation of the data points given in
//! the Poles array in the form //! the Poles array in the form
@ -408,7 +412,7 @@ public:
//! BSpline : the method used is interpolation at Schoenenberg //! BSpline : the method used is interpolation at Schoenenberg
//! points of a(u,v)*F(u,v) //! points of a(u,v)*F(u,v)
//! -- //! --
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& Status); 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& Status);

View File

@ -26,7 +26,7 @@
inline void BSplSLib::CoefsD0(const Standard_Real U, inline void BSplSLib::CoefsD0(const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
gp_Pnt& Point) gp_Pnt& Point)
{ {
BSplSLib::CacheD0(U, V, BSplSLib::CacheD0(U, V,
@ -43,7 +43,7 @@ inline void BSplSLib::CoefsD0(const Standard_Real U,
inline void BSplSLib::CoefsD1(const Standard_Real U, inline void BSplSLib::CoefsD1(const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
gp_Pnt& Point, gp_Pnt& Point,
gp_Vec& VecU, gp_Vec& VecU,
gp_Vec& VecV) gp_Vec& VecV)
@ -62,7 +62,7 @@ inline void BSplSLib::CoefsD1(const Standard_Real U,
inline void BSplSLib::CoefsD2(const Standard_Real U, inline void BSplSLib::CoefsD2(const Standard_Real U,
const Standard_Real V, const Standard_Real V,
const TColgp_Array2OfPnt& Poles, const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
gp_Pnt& Point, gp_Pnt& Point,
gp_Vec& VecU, gp_Vec& VecU,
gp_Vec& VecV, gp_Vec& VecV,
@ -95,8 +95,8 @@ inline void BSplSLib::PolesCoefficients(const TColgp_Array2OfPnt& Poles,
//purpose : //purpose :
//======================================================================= //=======================================================================
inline TColStd_Array2OfReal& BSplSLib::NoWeights() inline TColStd_Array2OfReal* BSplSLib::NoWeights()
{ {
return (*((TColStd_Array2OfReal*) NULL)); return NULL;
} }

View File

@ -30,9 +30,9 @@
//======================================================================= //=======================================================================
void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles, void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles,
const TColStd_Array2OfReal& Weights, const TColStd_Array2OfReal* Weights,
TColgp_Array2OfPnt& CachePoles, TColgp_Array2OfPnt& CachePoles,
TColStd_Array2OfReal& CacheWeights) TColStd_Array2OfReal* CacheWeights)
{ {
Standard_Integer i; Standard_Integer i;
Standard_Integer uclas = Poles.ColLength(); Standard_Integer uclas = Poles.ColLength();
@ -67,8 +67,8 @@ void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles,
uclas - 1,vclas - 1,0,0, uclas - 1,vclas - 1,0,0,
biduflatknots,bidvflatknots, biduflatknots,bidvflatknots,
Poles,Weights, Poles,Weights,
CPoles,CWeights); CPoles,&CWeights);
if (&Weights == NULL) { if (Weights == NULL) {
for (ii = 1; ii <= uclas; ii++) { for (ii = 1; ii <= uclas; ii++) {
@ -83,7 +83,7 @@ void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles,
for (jj = 1; jj <= vclas; jj++) { for (jj = 1; jj <= vclas; jj++) {
CachePoles (ii, jj) = CPoles (jj, ii); CachePoles (ii, jj) = CPoles (jj, ii);
CacheWeights(ii, jj) = CWeights(jj, ii); (*CacheWeights)(ii, jj) = CWeights(jj, ii);
} }
} }
} }

View File

@ -49,7 +49,7 @@ BSplSLib_Cache::BSplSLib_Cache(const Standard_Integer& theDegreeU,
const Standard_Boolean& thePeriodicV, const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV, const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles, const TColgp_Array2OfPnt& thePoles,
const TColStd_Array2OfReal& theWeights) const TColStd_Array2OfReal* theWeights)
{ {
Standard_Real aU = theFlatKnotsU.Value(theFlatKnotsU.Lower() + theDegreeU); Standard_Real aU = theFlatKnotsU.Value(theFlatKnotsU.Lower() + theDegreeU);
Standard_Real aV = theFlatKnotsV.Value(theFlatKnotsV.Lower() + theDegreeV); Standard_Real aV = theFlatKnotsV.Value(theFlatKnotsV.Lower() + theDegreeV);
@ -107,7 +107,7 @@ void BSplSLib_Cache::BuildCache(const Standard_Real& theParameterU,
const Standard_Boolean& thePeriodicV, const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV, const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles, const TColgp_Array2OfPnt& thePoles,
const TColStd_Array2OfReal& theWeights) const TColStd_Array2OfReal* theWeights)
{ {
// Normalize the parameters for periodical B-splines // Normalize the parameters for periodical B-splines
Standard_Real aNewParamU = theParameterU; Standard_Real aNewParamU = theParameterU;
@ -134,7 +134,7 @@ void BSplSLib_Cache::BuildCache(const Standard_Real& theParameterU,
Standard_Integer aMaxDegree = Max(theDegreeU, theDegreeV); Standard_Integer aMaxDegree = Max(theDegreeU, theDegreeV);
// Change the size of cached data if needed // Change the size of cached data if needed
myIsRational = (&theWeights != NULL); myIsRational = (theWeights != NULL);
Standard_Integer aPWColNumber = myIsRational ? 4 : 3; Standard_Integer aPWColNumber = myIsRational ? 4 : 3;
if (theDegreeU > myDegree[0] || theDegreeV > myDegree[1]) if (theDegreeU > myDegree[0] || theDegreeV > myDegree[1])
myPolesWeights = new TColStd_HArray2OfReal(1, aMaxDegree + 1, 1, aPWColNumber * (aMinDegree + 1)); myPolesWeights = new TColStd_HArray2OfReal(1, aMaxDegree + 1, 1, aPWColNumber * (aMinDegree + 1));

View File

@ -29,10 +29,6 @@
#include <TColStd_Array1OfReal.hxx> #include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx> #include <TColStd_Array2OfReal.hxx>
#ifndef NOWEIGHTS_SURF
#define NOWEIGHTS_SURF (*((TColStd_Array2OfReal*) NULL))
#endif
//! \brief A cache class for B-spline surfaces. //! \brief A cache class for B-spline surfaces.
//! //!
//! Defines all data, that can be cached on a span of B-spline surface. //! Defines all data, that can be cached on a span of B-spline surface.
@ -58,7 +54,7 @@ public:
const Standard_Boolean& thePeriodicV, const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV, const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles, const TColgp_Array2OfPnt& thePoles,
const TColStd_Array2OfReal& theWeights = NOWEIGHTS_SURF); const TColStd_Array2OfReal* theWeights = NULL);
//! Verifies validity of the cache using parameters of the point //! Verifies validity of the cache using parameters of the point
//! \param theParameterU first parameter of the point placed in the span //! \param theParameterU first parameter of the point placed in the span
@ -86,7 +82,7 @@ public:
const Standard_Boolean& thePeriodicV, const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV, const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles, const TColgp_Array2OfPnt& thePoles,
const TColStd_Array2OfReal& theWeights = NOWEIGHTS_SURF); const TColStd_Array2OfReal* theWeights = NULL);
//! Calculates the point on B-spline for specified parameters //! Calculates the point on B-spline for specified parameters
//! \param[in] theU first parameter for calculation of the value //! \param[in] theU first parameter for calculation of the value

View File

@ -173,8 +173,8 @@ void Convert_CompBezierCurves2dToBSplineCurve2d::Perform()
Inc = myDegree - Deg; Inc = myDegree - Deg;
if ( Inc > 0) { if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree, BSplCLib::IncreaseDegree(myDegree,
mySequence(i)->Array1(), PLib::NoWeights(), mySequence(i)->Array1(), BSplCLib::NoWeights(),
Points, PLib::NoWeights()); Points, BSplCLib::NoWeights());
} }
else { else {
Points = mySequence(i)->Array1(); Points = mySequence(i)->Array1();

View File

@ -169,8 +169,8 @@ void Convert_CompBezierCurvesToBSplineCurve::Perform()
Inc = myDegree - Deg; Inc = myDegree - Deg;
if ( Inc > 0) { if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree, BSplCLib::IncreaseDegree(myDegree,
mySequence(i)->Array1(), PLib::NoWeights(), mySequence(i)->Array1(), BSplCLib::NoWeights(),
Points, PLib::NoWeights()); Points, BSplCLib::NoWeights());
} }
else { else {
Points = mySequence(i)->Array1(); Points = mySequence(i)->Array1();

View File

@ -176,7 +176,7 @@ void CosAndSinRationalC1(Standard_Real Parameter,
const Standard_Integer EvalDegree, const Standard_Integer EvalDegree,
const TColgp_Array1OfPnt2d& EvalPoles, const TColgp_Array1OfPnt2d& EvalPoles,
const TColStd_Array1OfReal& EvalKnots, const TColStd_Array1OfReal& EvalKnots,
const TColStd_Array1OfInteger& EvalMults, const TColStd_Array1OfInteger* EvalMults,
Standard_Real Result[2]) Standard_Real Result[2])
{ {
gp_Pnt2d a_point ; gp_Pnt2d a_point ;
@ -216,7 +216,7 @@ void CosAndSinQuasiAngular(Standard_Real Parameter,
// const TColStd_Array1OfReal& EvalKnots, // const TColStd_Array1OfReal& EvalKnots,
const TColStd_Array1OfReal& , const TColStd_Array1OfReal& ,
// const TColStd_Array1OfInteger& EvalMults, // const TColStd_Array1OfInteger& EvalMults,
const TColStd_Array1OfInteger& , const TColStd_Array1OfInteger* ,
Standard_Real Result[2]) Standard_Real Result[2])
{ {
Standard_Real Standard_Real
@ -249,7 +249,7 @@ void AlgorithmicCosAndSin(Standard_Integer Degree,
const Standard_Integer EvalDegree, const Standard_Integer EvalDegree,
const TColgp_Array1OfPnt2d& EvalPoles, const TColgp_Array1OfPnt2d& EvalPoles,
const TColStd_Array1OfReal& EvalKnots, const TColStd_Array1OfReal& EvalKnots,
const TColStd_Array1OfInteger& EvalMults, const TColStd_Array1OfInteger* EvalMults,
Convert_CosAndSinEvalFunction Evaluator, Convert_CosAndSinEvalFunction Evaluator,
TColStd_Array1OfReal& CosNumerator, TColStd_Array1OfReal& CosNumerator,
TColStd_Array1OfReal& SinNumerator, TColStd_Array1OfReal& SinNumerator,
@ -571,7 +571,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
temp_degree, temp_degree,
temp_poles, temp_poles,
temp_knots, temp_knots,
temp_mults, &temp_mults,
*EvaluatorPtr, *EvaluatorPtr,
CosNumeratorPtr->ChangeArray1(), CosNumeratorPtr->ChangeArray1(),
SinNumeratorPtr->ChangeArray1(), SinNumeratorPtr->ChangeArray1(),
@ -744,9 +744,9 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
temp_degree, temp_degree,
Standard_False, Standard_False,
temp_cos_ptr->Array1(), temp_cos_ptr->Array1(),
temp_denominator_ptr->Array1(), &temp_denominator_ptr->Array1(),
temp_knots_ptr->Array1(), temp_knots_ptr->Array1(),
temp_mults_ptr->Array1(), &temp_mults_ptr->Array1(),
value1) ; value1) ;
BSplCLib::D0(param, BSplCLib::D0(param,
@ -754,9 +754,9 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
temp_degree, temp_degree,
Standard_False, Standard_False,
temp_sin_ptr->Array1(), temp_sin_ptr->Array1(),
temp_denominator_ptr->Array1(), &temp_denominator_ptr->Array1(),
temp_knots_ptr->Array1(), temp_knots_ptr->Array1(),
temp_mults_ptr->Array1(), &temp_mults_ptr->Array1(),
value2) ; value2) ;
BSplCLib::D0(param, BSplCLib::D0(param,
0, 0,
@ -765,7 +765,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin(
temp_denominator_ptr->Array1(), temp_denominator_ptr->Array1(),
BSplCLib::NoWeights(), BSplCLib::NoWeights(),
temp_knots_ptr->Array1(), temp_knots_ptr->Array1(),
temp_mults_ptr->Array1(), &temp_mults_ptr->Array1(),
value3) ; value3) ;
contact_order_array(ii) = 0 ; contact_order_array(ii) = 0 ;

View File

@ -25,7 +25,7 @@ typedef void Convert_CosAndSinEvalFunction(Standard_Real,
const Standard_Integer, const Standard_Integer,
const TColgp_Array1OfPnt2d&, const TColgp_Array1OfPnt2d&,
const TColStd_Array1OfReal&, const TColStd_Array1OfReal&,
const TColStd_Array1OfInteger&, const TColStd_Array1OfInteger*,
Standard_Real Result[2]) ; Standard_Real Result[2]) ;
#endif #endif

View File

@ -96,7 +96,7 @@ FairCurve_Batten::FairCurve_Batten(const gp_Pnt2d& P1,
Iknots->Array1(), Iknots->Array1(),
Imults->Array1(), Imults->Array1(),
Npoles->ChangeArray1(), Npoles->ChangeArray1(),
Nweight->ChangeArray1(), &Nweight->ChangeArray1(),
Nknots->ChangeArray1(), Nknots->ChangeArray1(),
Nmults->ChangeArray1() ); Nmults->ChangeArray1() );

View File

@ -262,9 +262,9 @@ void Geom_BSplineCurve::IncreaseDegree (const Standard_Integer Degree)
BSplCLib::IncreaseDegree BSplCLib::IncreaseDegree
(deg,Degree, periodic, (deg,Degree, periodic,
poles->Array1(),weights->Array1(), poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(),nweights->ChangeArray1(), npoles->ChangeArray1(),&nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
else { else {
@ -273,7 +273,7 @@ void Geom_BSplineCurve::IncreaseDegree (const Standard_Integer Degree)
poles->Array1(),BSplCLib::NoWeights(), poles->Array1(),BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
@ -369,7 +369,7 @@ void Geom_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots,
if (!BSplCLib::PrepareInsertKnots(deg,periodic, if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
Knots,Mults,nbpoles,nbknots,Epsilon,Add)) Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
Standard_ConstructionError::Raise("Geom_BSplineCurve::InsertKnots"); Standard_ConstructionError::Raise("Geom_BSplineCurve::InsertKnots");
if (nbpoles == poles->Length()) return; if (nbpoles == poles->Length()) return;
@ -387,10 +387,10 @@ void Geom_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots,
Handle(TColStd_HArray1OfReal) nweights = Handle(TColStd_HArray1OfReal) nweights =
new TColStd_HArray1OfReal(1,nbpoles); new TColStd_HArray1OfReal(1,nbpoles);
BSplCLib::InsertKnots(deg,periodic, BSplCLib::InsertKnots(deg,periodic,
poles->Array1(), weights->Array1(), poles->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), mults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray1(), nweights->ChangeArray1(), npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add); Epsilon, Add);
weights = nweights; weights = nweights;
@ -399,9 +399,9 @@ void Geom_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots,
BSplCLib::InsertKnots(deg,periodic, BSplCLib::InsertKnots(deg,periodic,
poles->Array1(), BSplCLib::NoWeights(), poles->Array1(), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), mults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add); Epsilon, Add);
} }
@ -455,9 +455,9 @@ Standard_Boolean Geom_BSplineCurve::RemoveKnot(const Standard_Integer Index,
new TColStd_HArray1OfReal(1,npoles->Length()); new TColStd_HArray1OfReal(1,npoles->Length());
if (!BSplCLib::RemoveKnot if (!BSplCLib::RemoveKnot
(Index, M, deg, periodic, (Index, M, deg, periodic,
poles->Array1(),weights->Array1(), poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(), nweights->ChangeArray1(), npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -469,7 +469,7 @@ Standard_Boolean Geom_BSplineCurve::RemoveKnot(const Standard_Integer Index,
poles->Array1(), BSplCLib::NoWeights(), poles->Array1(), BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -936,9 +936,9 @@ void Geom_BSplineCurve::SetNotPeriodic ()
BSplCLib::Unperiodize BSplCLib::Unperiodize
(deg,mults->Array1(),knots->Array1(),poles->Array1(), (deg,mults->Array1(),knots->Array1(),poles->Array1(),
weights->Array1(),nmults->ChangeArray1(), &weights->Array1(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(), nknots->ChangeArray1(),npoles->ChangeArray1(),
nweights->ChangeArray1()); &nweights->ChangeArray1());
} }
else { else {
@ -947,7 +947,7 @@ void Geom_BSplineCurve::SetNotPeriodic ()
(deg,mults->Array1(),knots->Array1(),poles->Array1(), (deg,mults->Array1(),knots->Array1(),poles->Array1(),
BSplCLib::NoWeights(),nmults->ChangeArray1(), BSplCLib::NoWeights(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(), nknots->ChangeArray1(),npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL)); BSplCLib::NoWeights());
} }
poles = npoles; poles = npoles;

View File

@ -770,7 +770,7 @@ public:
Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const; Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const;
//! Returns the weights of the B-spline curve; //! Returns the weights of the B-spline curve;
Standard_EXPORT const TColStd_Array1OfReal& Weights() const; Standard_EXPORT const TColStd_Array1OfReal* Weights() const;
//! Applies the transformation T to this BSpline curve. //! Applies the transformation T to this BSpline curve.
Standard_EXPORT void Transform (const gp_Trsf& T); Standard_EXPORT void Transform (const gp_Trsf& T);

View File

@ -189,21 +189,21 @@ void Geom_BSplineCurve::D0(const Standard_Real U, gp_Pnt& P) const
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P); P);
} }
else else
{ {
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P); P);
} }
} }
@ -220,21 +220,21 @@ void Geom_BSplineCurve::D1 (const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1); P, V1);
} }
else else
{ {
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1); P, V1);
} }
} }
@ -252,21 +252,21 @@ void Geom_BSplineCurve::D2(const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2); P, V1, V2);
} }
else else
{ {
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2); P, V1, V2);
} }
} }
@ -285,21 +285,21 @@ void Geom_BSplineCurve::D3(const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2, V3); P, V1, V2, V3);
} }
else else
{ {
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2, V3); P, V1, V2, V3);
} }
} }
@ -315,12 +315,12 @@ gp_Vec Geom_BSplineCurve::DN(const Standard_Real U,
gp_Vec V; gp_Vec V;
if (rational) { if (rational) {
BSplCLib::DN(U,N,0,deg,periodic,POLES, BSplCLib::DN(U,N,0,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
else { else {
BSplCLib::DN(U,N,0,deg,periodic,POLES, BSplCLib::DN(U,N,0,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
return V; return V;
@ -476,12 +476,12 @@ void Geom_BSplineCurve::LocalD0
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D0(u,index,deg,periodic,POLES, BSplCLib::D0(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P); FKNOTS,FMULTS,P);
} }
else { else {
BSplCLib::D0(u,index,deg,periodic,POLES, BSplCLib::D0(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P); FKNOTS,FMULTS,P);
} }
} }
@ -506,12 +506,12 @@ void Geom_BSplineCurve::LocalD1 (const Standard_Real U,
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D1(u,index,deg,periodic,POLES, BSplCLib::D1(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P,V1); FKNOTS,FMULTS,P,V1);
} }
else { else {
BSplCLib::D1(u,index,deg,periodic,POLES, BSplCLib::D1(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1); FKNOTS,FMULTS,P,V1);
} }
} }
@ -538,12 +538,12 @@ void Geom_BSplineCurve::LocalD2
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D2(u,index,deg,periodic,POLES, BSplCLib::D2(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2); FKNOTS,FMULTS,P,V1,V2);
} }
else { else {
BSplCLib::D2(u,index,deg,periodic,POLES, BSplCLib::D2(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2); FKNOTS,FMULTS,P,V1,V2);
} }
} }
@ -571,12 +571,12 @@ void Geom_BSplineCurve::LocalD3
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D3(u,index,deg,periodic,POLES, BSplCLib::D3(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2,V3); FKNOTS,FMULTS,P,V1,V2,V3);
} }
else { else {
BSplCLib::D3(u,index,deg,periodic,POLES, BSplCLib::D3(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2,V3); FKNOTS,FMULTS,P,V1,V2,V3);
} }
} }
@ -603,12 +603,12 @@ gp_Vec Geom_BSplineCurve::LocalDN
gp_Vec V; gp_Vec V;
if (rational) { if (rational) {
BSplCLib::DN(u,N,index,deg,periodic,POLES, BSplCLib::DN(u,N,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
else { else {
BSplCLib::DN(u,N,index,deg,periodic,POLES, BSplCLib::DN(u,N,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
return V; return V;
@ -738,10 +738,10 @@ void Geom_BSplineCurve::Weights
} }
} }
const TColStd_Array1OfReal& Geom_BSplineCurve::Weights() const const TColStd_Array1OfReal* Geom_BSplineCurve::Weights() const
{ {
if (IsRational()) if (IsRational())
return weights->Array1(); return &weights->Array1();
return BSplCLib::NoWeights(); return BSplCLib::NoWeights();
} }
@ -845,7 +845,7 @@ void Geom_BSplineCurve::Resolution(const Standard_Real Tolerance3D,
new_weights(ii) = weights->Array1()((ii-1) % poles->Length() + 1) ; new_weights(ii) = weights->Array1()((ii-1) % poles->Length() + 1) ;
} }
BSplCLib::Resolution(new_poles, BSplCLib::Resolution(new_poles,
new_weights, &new_weights,
new_poles.Length(), new_poles.Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,
@ -854,7 +854,7 @@ void Geom_BSplineCurve::Resolution(const Standard_Real Tolerance3D,
} }
else { else {
BSplCLib::Resolution(new_poles, BSplCLib::Resolution(new_poles,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
new_poles.Length(), new_poles.Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,
@ -866,7 +866,7 @@ void Geom_BSplineCurve::Resolution(const Standard_Real Tolerance3D,
else { else {
if (rational) { if (rational) {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
weights->Array1(), &weights->Array1(),
poles->Length(), poles->Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,
@ -875,7 +875,7 @@ void Geom_BSplineCurve::Resolution(const Standard_Real Tolerance3D,
} }
else { else {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
poles->Length(), poles->Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,

View File

@ -383,9 +383,9 @@ void Geom_BSplineSurface::IncreaseDegree (const Standard_Integer UDegree,
BSplSLib::IncreaseDegree BSplSLib::IncreaseDegree
(Standard_True, udeg, UDegree, uperiodic, (Standard_True, udeg, UDegree, uperiodic,
poles->Array2(),weights->Array2(), poles->Array2(),&weights->Array2(),
uknots->Array1(),umults->Array1(), uknots->Array1(),umults->Array1(),
npoles->ChangeArray2(),nweights->ChangeArray2(), npoles->ChangeArray2(),&nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
else { else {
@ -394,7 +394,7 @@ void Geom_BSplineSurface::IncreaseDegree (const Standard_Integer UDegree,
(Standard_True, udeg, UDegree, uperiodic, (Standard_True, udeg, UDegree, uperiodic,
poles->Array2(),BSplSLib::NoWeights(), poles->Array2(),BSplSLib::NoWeights(),
uknots->Array1(),umults->Array1(), uknots->Array1(),umults->Array1(),
npoles->ChangeArray2(),*((TColStd_Array2OfReal*) NULL), npoles->ChangeArray2(),BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
udeg = UDegree; udeg = UDegree;
@ -435,9 +435,9 @@ void Geom_BSplineSurface::IncreaseDegree (const Standard_Integer UDegree,
BSplSLib::IncreaseDegree BSplSLib::IncreaseDegree
(Standard_False, vdeg, VDegree, vperiodic, (Standard_False, vdeg, VDegree, vperiodic,
poles->Array2(),weights->Array2(), poles->Array2(),&weights->Array2(),
vknots->Array1(),vmults->Array1(), vknots->Array1(),vmults->Array1(),
npoles->ChangeArray2(),nweights->ChangeArray2(), npoles->ChangeArray2(),&nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
else { else {
@ -446,7 +446,7 @@ void Geom_BSplineSurface::IncreaseDegree (const Standard_Integer UDegree,
(Standard_False, vdeg, VDegree, vperiodic, (Standard_False, vdeg, VDegree, vperiodic,
poles->Array2(),BSplSLib::NoWeights(), poles->Array2(),BSplSLib::NoWeights(),
vknots->Array1(),vmults->Array1(), vknots->Array1(),vmults->Array1(),
npoles->ChangeArray2(),*((TColStd_Array2OfReal*) NULL), npoles->ChangeArray2(),BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
vdeg = VDegree; vdeg = VDegree;

View File

@ -991,7 +991,7 @@ public:
//! Returns the weights of the B-spline surface. //! Returns the weights of the B-spline surface.
//! value and derivatives computation //! value and derivatives computation
Standard_EXPORT const TColStd_Array2OfReal& Weights() const; Standard_EXPORT const TColStd_Array2OfReal* Weights() const;
Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const; Standard_EXPORT void D0 (const Standard_Real U, const Standard_Real V, gp_Pnt& P) const;

View File

@ -119,7 +119,7 @@ void Geom_BSplineSurface::D0(const Standard_Real U,
Standard_Real aNewV = V; Standard_Real aNewV = V;
PeriodicNormalization(aNewU, aNewV); PeriodicNormalization(aNewU, aNewV);
BSplSLib::D0(aNewU,aNewV,0,0,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D0(aNewU,aNewV,0,0,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P); P);
} }
@ -141,13 +141,13 @@ void Geom_BSplineSurface::D1(const Standard_Real U,
Standard_Integer uindex = 0, vindex = 0; Standard_Integer uindex = 0, vindex = 0;
BSplCLib::LocateParameter(udeg, uknots->Array1(), umults->Array1(), U, uperiodic, uindex, aNewU); BSplCLib::LocateParameter(udeg, uknots->Array1(), &umults->Array1(), U, uperiodic, uindex, aNewU);
uindex = BSplCLib::FlatIndex(udeg, uindex, umults->Array1(), uperiodic); uindex = BSplCLib::FlatIndex(udeg, uindex, umults->Array1(), uperiodic);
BSplCLib::LocateParameter(vdeg, vknots->Array1(), vmults->Array1(), V, vperiodic, vindex, aNewV); BSplCLib::LocateParameter(vdeg, vknots->Array1(), &vmults->Array1(), V, vperiodic, vindex, aNewV);
vindex = BSplCLib::FlatIndex(vdeg, vindex, vmults->Array1(), vperiodic); vindex = BSplCLib::FlatIndex(vdeg, vindex, vmults->Array1(), vperiodic);
BSplSLib::D1(aNewU,aNewV,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D1(aNewU,aNewV,uindex,vindex,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P, D1U, D1V); P, D1U, D1V);
} }
@ -172,13 +172,13 @@ void Geom_BSplineSurface::D2 (const Standard_Real U,
Standard_Integer uindex = 0, vindex = 0; Standard_Integer uindex = 0, vindex = 0;
BSplCLib::LocateParameter(udeg, uknots->Array1(), umults->Array1(), U, uperiodic, uindex, aNewU); BSplCLib::LocateParameter(udeg, uknots->Array1(), &umults->Array1(), U, uperiodic, uindex, aNewU);
uindex = BSplCLib::FlatIndex(udeg, uindex, umults->Array1(), uperiodic); uindex = BSplCLib::FlatIndex(udeg, uindex, umults->Array1(), uperiodic);
BSplCLib::LocateParameter(vdeg, vknots->Array1(), vmults->Array1(), V, vperiodic, vindex, aNewV); BSplCLib::LocateParameter(vdeg, vknots->Array1(), &vmults->Array1(), V, vperiodic, vindex, aNewV);
vindex = BSplCLib::FlatIndex(vdeg, vindex, vmults->Array1(), vperiodic); vindex = BSplCLib::FlatIndex(vdeg, vindex, vmults->Array1(), vperiodic);
BSplSLib::D2(aNewU,aNewV,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D2(aNewU,aNewV,uindex,vindex,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P, D1U, D1V, D2U, D2V, D2UV); P, D1U, D1V, D2U, D2V, D2UV);
} }
@ -201,7 +201,7 @@ void Geom_BSplineSurface::D3 (const Standard_Real U,
gp_Vec& D3UUV, gp_Vec& D3UUV,
gp_Vec& D3UVV) const gp_Vec& D3UVV) const
{ {
BSplSLib::D3(U,V,0,0,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D3(U,V,0,0,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV); P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
} }
@ -217,7 +217,7 @@ gp_Vec Geom_BSplineSurface::DN (const Standard_Real U,
const Standard_Integer Nv ) const const Standard_Integer Nv ) const
{ {
gp_Vec Vn; gp_Vec Vn;
BSplSLib::DN(U,V,Nu,Nv,0,0,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::DN(U,V,Nu,Nv,0,0,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
Vn); Vn);
return Vn; return Vn;
@ -268,7 +268,7 @@ void Geom_BSplineSurface::LocalD0 (const Standard_Real U,
vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic); vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic);
// BSplSLib::D0(U,V,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, // BSplSLib::D0(U,V,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
BSplSLib::D0(u,v,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D0(u,v,uindex,vindex,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P); P);
} }
@ -302,7 +302,7 @@ void Geom_BSplineSurface::LocalD1 (const Standard_Real U,
vindex,v); vindex,v);
vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic); vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic);
BSplSLib::D1(u,v,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D1(u,v,uindex,vindex,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P,D1U,D1V); P,D1U,D1V);
} }
@ -339,7 +339,7 @@ void Geom_BSplineSurface::LocalD2 (const Standard_Real U,
vindex,v); vindex,v);
vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic); vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic);
BSplSLib::D2(u,v,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D2(u,v,uindex,vindex,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P,D1U,D1V,D2U,D2V,D2UV); P,D1U,D1V,D2U,D2V,D2UV);
} }
@ -380,7 +380,7 @@ void Geom_BSplineSurface::LocalD3 (const Standard_Real U,
vindex,v); vindex,v);
vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic); vindex = BSplCLib::FlatIndex(vdeg,vindex,vmults->Array1(),vperiodic);
BSplSLib::D3(u,v,uindex,vindex,POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, BSplSLib::D3(u,v,uindex,vindex,POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV); P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
} }
@ -415,7 +415,7 @@ gp_Vec Geom_BSplineSurface::LocalDN (const Standard_Real U,
gp_Vec Vn; gp_Vec Vn;
BSplSLib::DN(u,v,Nu,Nv,uindex,vindex, BSplSLib::DN(u,v,Nu,Nv,uindex,vindex,
POLES,WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS, POLES,&WEIGHTS,UFKNOTS,VFKNOTS,FMULTS,FMULTS,
udeg,vdeg,urational,vrational,uperiodic,vperiodic, udeg,vdeg,urational,vrational,uperiodic,vperiodic,
Vn); Vn);
return Vn; return Vn;
@ -466,8 +466,8 @@ Handle(Geom_Curve) Geom_BSplineSurface::UIso (const Standard_Real U) const
Handle(Geom_BSplineCurve) C; Handle(Geom_BSplineCurve) C;
if ( urational || vrational) { if ( urational || vrational) {
BSplSLib::Iso(U,Standard_True,POLES,WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic, BSplSLib::Iso(U,Standard_True,POLES,&WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights, C = new Geom_BSplineCurve(cpoles,cweights,
vknots->Array1(), vknots->Array1(),
vmults->Array1(), vmults->Array1(),
@ -475,9 +475,9 @@ Handle(Geom_Curve) Geom_BSplineSurface::UIso (const Standard_Real U) const
} }
else { else {
BSplSLib::Iso(U,Standard_True,POLES, BSplSLib::Iso(U,Standard_True,POLES,
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
UFKNOTS,FMULTS,udeg,uperiodic, UFKNOTS,FMULTS,udeg,uperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles, C = new Geom_BSplineCurve(cpoles,
vknots->Array1(), vknots->Array1(),
vmults->Array1(), vmults->Array1(),
@ -501,8 +501,8 @@ Handle(Geom_Curve) Geom_BSplineSurface::UIso (const Standard_Real U,
Handle(Geom_BSplineCurve) C; Handle(Geom_BSplineCurve) C;
if ( urational || vrational) { if ( urational || vrational) {
BSplSLib::Iso(U,Standard_True,POLES,WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic, BSplSLib::Iso(U,Standard_True,POLES,&WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights, C = new Geom_BSplineCurve(cpoles,cweights,
vknots->Array1(), vknots->Array1(),
vmults->Array1(), vmults->Array1(),
@ -511,9 +511,9 @@ Handle(Geom_Curve) Geom_BSplineSurface::UIso (const Standard_Real U,
} }
else { else {
BSplSLib::Iso(U,Standard_True,POLES, BSplSLib::Iso(U,Standard_True,POLES,
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
UFKNOTS,FMULTS,udeg,uperiodic, UFKNOTS,FMULTS,udeg,uperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles, C = new Geom_BSplineCurve(cpoles,
vknots->Array1(), vknots->Array1(),
vmults->Array1(), vmults->Array1(),
@ -651,9 +651,9 @@ Handle(Geom_Curve) Geom_BSplineSurface::VIso (const Standard_Real V) const
if ( urational || vrational) { if ( urational || vrational) {
BSplSLib::Iso(V,Standard_False,POLES, BSplSLib::Iso(V,Standard_False,POLES,
WEIGHTS, &WEIGHTS,
VFKNOTS,FMULTS,vdeg,vperiodic, VFKNOTS,FMULTS,vdeg,vperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights, C = new Geom_BSplineCurve(cpoles,cweights,
uknots->Array1(), uknots->Array1(),
umults->Array1(), umults->Array1(),
@ -661,9 +661,9 @@ Handle(Geom_Curve) Geom_BSplineSurface::VIso (const Standard_Real V) const
} }
else { else {
BSplSLib::Iso(V,Standard_False,POLES, BSplSLib::Iso(V,Standard_False,POLES,
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
VFKNOTS,FMULTS,vdeg,vperiodic, VFKNOTS,FMULTS,vdeg,vperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles, C = new Geom_BSplineCurve(cpoles,
uknots->Array1(), uknots->Array1(),
umults->Array1(), umults->Array1(),
@ -688,9 +688,9 @@ Handle(Geom_Curve) Geom_BSplineSurface::VIso (const Standard_Real V,
if ( urational || vrational) { if ( urational || vrational) {
BSplSLib::Iso(V,Standard_False,POLES, BSplSLib::Iso(V,Standard_False,POLES,
WEIGHTS, &WEIGHTS,
VFKNOTS,FMULTS,vdeg,vperiodic, VFKNOTS,FMULTS,vdeg,vperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights, C = new Geom_BSplineCurve(cpoles,cweights,
uknots->Array1(), uknots->Array1(),
umults->Array1(), umults->Array1(),
@ -699,9 +699,9 @@ Handle(Geom_Curve) Geom_BSplineSurface::VIso (const Standard_Real V,
} }
else { else {
BSplSLib::Iso(V,Standard_False,POLES, BSplSLib::Iso(V,Standard_False,POLES,
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
VFKNOTS,FMULTS,vdeg,vperiodic, VFKNOTS,FMULTS,vdeg,vperiodic,
cpoles,cweights); cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles, C = new Geom_BSplineCurve(cpoles,
uknots->Array1(), uknots->Array1(),
umults->Array1(), umults->Array1(),
@ -767,10 +767,10 @@ void Geom_BSplineSurface::Weights (TColStd_Array2OfReal& W) const
W = weights->Array2(); W = weights->Array2();
} }
const TColStd_Array2OfReal& Geom_BSplineSurface::Weights() const const TColStd_Array2OfReal* Geom_BSplineSurface::Weights() const
{ {
if (urational || vrational) if (urational || vrational)
return weights->Array2(); return &weights->Array2();
return BSplSLib::NoWeights(); return BSplSLib::NoWeights();
} }
@ -1136,10 +1136,10 @@ void Geom_BSplineSurface::SetUNotPeriodic ()
BSplSLib::Unperiodize(Standard_True , udeg, BSplSLib::Unperiodize(Standard_True , udeg,
umults->Array1() , uknots->Array1(), umults->Array1() , uknots->Array1(),
poles->Array2() , weights->Array2(), poles->Array2() , &weights->Array2(),
nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2()); &nweights->ChangeArray2());
} }
else { else {
@ -1148,7 +1148,7 @@ void Geom_BSplineSurface::SetUNotPeriodic ()
poles->Array2() , BSplSLib::NoWeights(), poles->Array2() , BSplSLib::NoWeights(),
nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL)); BSplSLib::NoWeights());
} }
poles = npoles; poles = npoles;
weights = nweights; weights = nweights;
@ -1188,10 +1188,10 @@ void Geom_BSplineSurface::SetVNotPeriodic ()
BSplSLib::Unperiodize(Standard_False , vdeg, BSplSLib::Unperiodize(Standard_False , vdeg,
vmults->Array1() , vknots->Array1(), vmults->Array1() , vknots->Array1(),
poles->Array2() , weights->Array2(), poles->Array2() , &weights->Array2(),
nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2()); &nweights->ChangeArray2());
} }
else { else {
@ -1200,7 +1200,7 @@ void Geom_BSplineSurface::SetVNotPeriodic ()
poles->Array2() , BSplSLib::NoWeights(), poles->Array2() , BSplSLib::NoWeights(),
nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL)); BSplSLib::NoWeights());
} }
poles = npoles; poles = npoles;
weights = nweights; weights = nweights;
@ -1772,7 +1772,7 @@ void Geom_BSplineSurface::InsertUKnots
if ( !BSplCLib::PrepareInsertKnots(udeg,uperiodic, if ( !BSplCLib::PrepareInsertKnots(udeg,uperiodic,
uknots->Array1(),umults->Array1(), uknots->Array1(),umults->Array1(),
Knots,Mults,nbpoles,nbknots, Knots,&Mults,nbpoles,nbknots,
ParametricTolerance,Add)) ParametricTolerance,Add))
Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertUKnots"); Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertUKnots");
@ -1795,11 +1795,11 @@ void Geom_BSplineSurface::InsertUKnots
if ( urational || vrational) { if ( urational || vrational) {
BSplSLib::InsertKnots(Standard_True, BSplSLib::InsertKnots(Standard_True,
udeg, uperiodic, udeg, uperiodic,
poles->Array2() , weights->Array2(), poles->Array2() , &weights->Array2(),
uknots->Array1(), umults->Array1(), uknots->Array1(), umults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2(), &nweights->ChangeArray2(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add); ParametricTolerance, Add);
} }
@ -1808,9 +1808,9 @@ void Geom_BSplineSurface::InsertUKnots
udeg, uperiodic, udeg, uperiodic,
poles->Array2() , BSplSLib::NoWeights(), poles->Array2() , BSplSLib::NoWeights(),
uknots->Array1(), umults->Array1(), uknots->Array1(), umults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add); ParametricTolerance, Add);
} }
@ -1839,7 +1839,7 @@ void Geom_BSplineSurface::InsertVKnots
if ( !BSplCLib::PrepareInsertKnots(vdeg,vperiodic, if ( !BSplCLib::PrepareInsertKnots(vdeg,vperiodic,
vknots->Array1(),vmults->Array1(), vknots->Array1(),vmults->Array1(),
Knots,Mults,nbpoles,nbknots, Knots,&Mults,nbpoles,nbknots,
ParametricTolerance, Add)) ParametricTolerance, Add))
Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertVKnots"); Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertVKnots");
@ -1862,11 +1862,11 @@ void Geom_BSplineSurface::InsertVKnots
if ( urational || vrational) { if ( urational || vrational) {
BSplSLib::InsertKnots(Standard_False, BSplSLib::InsertKnots(Standard_False,
vdeg, vperiodic, vdeg, vperiodic,
poles->Array2() , weights->Array2(), poles->Array2() , &weights->Array2(),
vknots->Array1(), vmults->Array1(), vknots->Array1(), vmults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2(), &nweights->ChangeArray2(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add); ParametricTolerance, Add);
} }
@ -1875,9 +1875,9 @@ void Geom_BSplineSurface::InsertVKnots
vdeg, vperiodic, vdeg, vperiodic,
poles->Array2() , BSplSLib::NoWeights(), poles->Array2() , BSplSLib::NoWeights(),
vknots->Array1(), vmults->Array1(), vknots->Array1(), vmults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add); ParametricTolerance, Add);
} }
@ -1934,10 +1934,10 @@ Standard_Boolean Geom_BSplineSurface::RemoveUKnot
1, npoles->RowLength()); 1, npoles->RowLength());
if (!BSplSLib::RemoveKnot(Standard_True, if (!BSplSLib::RemoveKnot(Standard_True,
Index,M,udeg,uperiodic, Index,M,udeg,uperiodic,
poles->Array2(),weights->Array2(), poles->Array2(),&weights->Array2(),
uknots->Array1(),umults->Array1(), uknots->Array1(),umults->Array1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2(), &nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -1955,7 +1955,7 @@ Standard_Boolean Geom_BSplineSurface::RemoveUKnot
poles->Array2(),BSplSLib::NoWeights(), poles->Array2(),BSplSLib::NoWeights(),
uknots->Array1(),umults->Array1(), uknots->Array1(),umults->Array1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -2017,10 +2017,10 @@ Standard_Boolean Geom_BSplineSurface::RemoveVKnot
if (!BSplSLib::RemoveKnot(Standard_False, if (!BSplSLib::RemoveKnot(Standard_False,
Index,M,vdeg,vperiodic, Index,M,vdeg,vperiodic,
poles->Array2(),weights->Array2(), poles->Array2(),&weights->Array2(),
vknots->Array1(),vmults->Array1(), vknots->Array1(),vmults->Array1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2(), &nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -2038,7 +2038,7 @@ Standard_Boolean Geom_BSplineSurface::RemoveVKnot
poles->Array2(),BSplSLib::NoWeights(), poles->Array2(),BSplSLib::NoWeights(),
vknots->Array1(),vmults->Array1(), vknots->Array1(),vmults->Array1(),
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -2064,7 +2064,7 @@ void Geom_BSplineSurface::Resolution( const Standard_Real Tolerance3D,
{ {
if(!maxderivinvok){ if(!maxderivinvok){
BSplSLib::Resolution(poles ->Array2(), BSplSLib::Resolution(poles ->Array2(),
weights->Array2(), &weights->Array2(),
uknots ->Array1(), uknots ->Array1(),
vknots ->Array1(), vknots ->Array1(),
umults ->Array1(), umults ->Array1(),

View File

@ -152,19 +152,19 @@ void Geom_BezierCurve::Increase (const Standard_Integer Deg)
nweights = new TColStd_HArray1OfReal(1,Deg+1); nweights = new TColStd_HArray1OfReal(1,Deg+1);
BSplCLib::IncreaseDegree(Degree(), Deg, 0, BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(), poles->Array1(),
weights->Array1(), &weights->Array1(),
bidknots, bidmults, bidknots, bidmults,
npoles->ChangeArray1(), npoles->ChangeArray1(),
nweights->ChangeArray1(), &nweights->ChangeArray1(),
bidknots, bidmults); bidknots, bidmults);
} }
else { else {
BSplCLib::IncreaseDegree(Degree(), Deg, 0, BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
bidknots, bidmults, bidknots, bidmults,
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
bidknots, bidmults); bidknots, bidmults);
} }
@ -386,19 +386,16 @@ void Geom_BezierCurve::Segment(const Standard_Real U1, const Standard_Real U2)
if(!CoefficientsOK(0.)) UpdateCoefficients(0.); if(!CoefficientsOK(0.)) UpdateCoefficients(0.);
if (IsRational()) { if (IsRational()) {
PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::Trimming(U1,U2,coeffs->ChangeArray1(),
wcoeffs->ChangeArray1()); &wcoeffs->ChangeArray1());
PLib::CoefficientsPoles(coeffs->Array1(), PLib::CoefficientsPoles(coeffs->Array1(),
wcoeffs->Array1(), &wcoeffs->Array1(),
poles->ChangeArray1(), poles->ChangeArray1(),
weights->ChangeArray1()); &weights->ChangeArray1());
} }
else { else {
PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::NoWeights());
*((TColStd_Array1OfReal*) NULL)); PLib::CoefficientsPoles(coeffs->Array1(), PLib::NoWeights(),
PLib::CoefficientsPoles(coeffs->Array1(), poles->ChangeArray1(), PLib::NoWeights());
*((TColStd_Array1OfReal*) NULL),
poles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL));
} }
UpdateCoefficients(); UpdateCoefficients();
} }
@ -550,13 +547,11 @@ void Geom_BezierCurve::D0 (const Standard_Real U, gp_Pnt& P ) const
if (IsRational()) if (IsRational())
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
wcoeffs->Array1(), &wcoeffs->Array1(),
P); P);
else else
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(), BSplCLib::NoWeights(), P);
*((TColStd_Array1OfReal*) NULL),P
);
} }
//======================================================================= //=======================================================================
@ -573,12 +568,12 @@ void Geom_BezierCurve::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V1) const
if (IsRational()) if (IsRational())
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
wcoeffs->Array1(), &wcoeffs->Array1(),
P,V1); P,V1);
else else
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
P,V1); P,V1);
} }
@ -599,12 +594,12 @@ void Geom_BezierCurve::D2 (const Standard_Real U,
if (IsRational()) if (IsRational())
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
wcoeffs->Array1(), &wcoeffs->Array1(),
P,V1,V2); P,V1,V2);
else else
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
P,V1,V2); P,V1,V2);
} }
@ -624,12 +619,12 @@ void Geom_BezierCurve::D3 (const Standard_Real U,
if (IsRational()) if (IsRational())
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
wcoeffs->Array1(), &wcoeffs->Array1(),
P,V1,V2,V3); P,V1,V2,V3);
else else
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
P,V1,V2,V3); P,V1,V2,V3);
} }
@ -652,14 +647,14 @@ gp_Vec Geom_BezierCurve::DN (const Standard_Real U,
// BSplCLib::DN(U,N,0,Degree(),0., // BSplCLib::DN(U,N,0,Degree(),0.,
BSplCLib::DN(U,N,0,Degree(),Standard_False, BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(), poles->Array1(),
weights->Array1(), &weights->Array1(),
bidknots,bidmults,V); bidknots,&bidmults,V);
else else
// BSplCLib::DN(U,N,0,Degree(),0., // BSplCLib::DN(U,N,0,Degree(),0.,
BSplCLib::DN(U,N,0,Degree(),Standard_False, BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
bidknots,bidmults,V); bidknots,&bidmults,V);
return V; return V;
} }
@ -804,7 +799,7 @@ void Geom_BezierCurve::Resolution(const Standard_Real Tolerance3D,
if (IsRational()) { if (IsRational()) {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
weights->Array1(), &weights->Array1(),
poles->Length(), poles->Length(),
bidflatknots, bidflatknots,
Degree(), Degree(),
@ -902,15 +897,15 @@ void Geom_BezierCurve::UpdateCoefficients(const Standard_Real )
if (IsRational()) if (IsRational())
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(), BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(), bidflatknots,poles->Array1(),
weights->Array1(), &weights->Array1(),
coeffs->ChangeArray1(), coeffs->ChangeArray1(),
wcoeffs->ChangeArray1()); &wcoeffs->ChangeArray1());
else else
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(), BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(), bidflatknots,poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
coeffs->ChangeArray1(), coeffs->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL)); BSplCLib::NoWeights());
validcache = 1; validcache = 1;
} }

View File

@ -594,20 +594,20 @@ void Geom_BezierSurface::Increase (const Standard_Integer UDeg,
BSplSLib::IncreaseDegree(1, oldUDeg, UDeg, 0, BSplSLib::IncreaseDegree(1, oldUDeg, UDeg, 0,
poles->Array2(), poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots, bidumults, biduknots, bidumults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2(), &nweights->ChangeArray2(),
biduknots, bidumults); biduknots, bidumults);
weights = nweights; weights = nweights;
} }
else { else {
BSplSLib::IncreaseDegree(1, oldUDeg, UDeg, 0, BSplSLib::IncreaseDegree(1, oldUDeg, UDeg, 0,
poles->Array2(), poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots, bidumults, biduknots, bidumults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots, bidumults); biduknots, bidumults);
} }
poles = npoles; poles = npoles;
@ -620,20 +620,20 @@ void Geom_BezierSurface::Increase (const Standard_Integer UDeg,
BSplSLib::IncreaseDegree(0, oldVDeg, VDeg, 0, BSplSLib::IncreaseDegree(0, oldVDeg, VDeg, 0,
poles->Array2(), poles->Array2(),
weights->Array2(), &weights->Array2(),
bidvknots, bidvmults, bidvknots, bidvmults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
nweights->ChangeArray2(), &nweights->ChangeArray2(),
bidvknots, bidvmults); bidvknots, bidvmults);
weights = nweights; weights = nweights;
} }
else { else {
BSplSLib::IncreaseDegree(0, oldVDeg, VDeg, 0, BSplSLib::IncreaseDegree(0, oldVDeg, VDeg, 0,
poles->Array2(), poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
bidvknots, bidvmults, bidvknots, bidvmults,
npoles->ChangeArray2(), npoles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
bidvknots, bidvmults); bidvknots, bidvmults);
} }
@ -1000,23 +1000,19 @@ void Geom_BezierSurface::Segment
vlast = 2*(V2 - 0.5); vlast = 2*(V2 - 0.5);
if (rat) { if (rat) {
PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(), PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(),
WCoefs->ChangeArray2()); &WCoefs->ChangeArray2());
PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(), PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(),
WCoefs->ChangeArray2()); &WCoefs->ChangeArray2());
PLib::CoefficientsPoles(Coefs->Array2(), PLib::CoefficientsPoles(Coefs->Array2(),
WCoefs->Array2(), &WCoefs->Array2(),
poles->ChangeArray2(), poles->ChangeArray2(),
weights->ChangeArray2()); &weights->ChangeArray2());
} }
else { else {
PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(), PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(), PLib::NoWeights2());
*((TColStd_Array2OfReal*) NULL)); PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(), PLib::NoWeights2());
PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(), PLib::CoefficientsPoles (Coefs->Array2(), PLib::NoWeights2(),
*((TColStd_Array2OfReal*) NULL)); poles->ChangeArray2(), PLib::NoWeights2());
PLib::CoefficientsPoles (Coefs->Array2(),
*((TColStd_Array2OfReal*) NULL),
poles->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL));
} }
UpdateCoefficients(); UpdateCoefficients();
} }
@ -1468,7 +1464,7 @@ void Geom_BezierSurface::D0 (const Standard_Real U,
uparameter_11, vparameter_11, uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11, uspanlenght_11, vspanlenght_11,
coeffs->Array2(), coeffs->Array2(),
wcoeffs->Array2(), &wcoeffs->Array2(),
P); P);
} }
else { else {
@ -1476,7 +1472,7 @@ void Geom_BezierSurface::D0 (const Standard_Real U,
uparameter_11, vparameter_11, uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11, uspanlenght_11, vspanlenght_11,
coeffs->Array2(), coeffs->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
P); P);
} }
} }
@ -1491,8 +1487,8 @@ void Geom_BezierSurface::D0 (const Standard_Real U,
TColStd_Array1OfInteger bidvmults(mult_v[0],1,2); bidvmults.Init(VDegree() + 1); TColStd_Array1OfInteger bidvmults(mult_v[0],1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) { if (urational || vrational) {
BSplSLib::D0(U, V, 1,1,poles->Array2(), BSplSLib::D0(U, V, 1,1,poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots,bidvknots,bidumults,bidvmults, biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(), UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False, urational,vrational,Standard_False,Standard_False,
P) ; P) ;
@ -1500,8 +1496,8 @@ void Geom_BezierSurface::D0 (const Standard_Real U,
else { else {
BSplSLib::D0(U, V, 1,1,poles->Array2(), BSplSLib::D0(U, V, 1,1,poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots,bidvknots,bidumults,bidvmults, biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(), UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False, urational,vrational,Standard_False,Standard_False,
P) ; P) ;
@ -1537,7 +1533,7 @@ void Geom_BezierSurface::D1
uparameter_11, vparameter_11, uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11, uspanlenght_11, vspanlenght_11,
coeffs->Array2(), coeffs->Array2(),
wcoeffs->Array2(), &wcoeffs->Array2(),
P, D1U, D1V); P, D1U, D1V);
} }
else { else {
@ -1545,7 +1541,7 @@ void Geom_BezierSurface::D1
uparameter_11, vparameter_11, uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11, uspanlenght_11, vspanlenght_11,
coeffs->Array2(), coeffs->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
P, D1U, D1V); P, D1U, D1V);
} }
} }
@ -1560,16 +1556,16 @@ void Geom_BezierSurface::D1
TColStd_Array1OfInteger bidvmults(mult_v[0],1,2); bidvmults.Init(VDegree() + 1); TColStd_Array1OfInteger bidvmults(mult_v[0],1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) { if (urational || vrational) {
BSplSLib::D1(U, V, 1,1,poles->Array2(), BSplSLib::D1(U, V, 1,1,poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots,bidvknots,bidumults,bidvmults, biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(), UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False, urational,vrational,Standard_False,Standard_False,
P,D1U, D1V) ; P,D1U, D1V) ;
} }
else { else {
BSplSLib::D1(U, V, 1,1,poles->Array2(), BSplSLib::D1(U, V, 1,1,poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots,bidvknots,bidumults,bidvmults, biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(), UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False, urational,vrational,Standard_False,Standard_False,
P,D1U, D1V) ; P,D1U, D1V) ;
@ -1606,7 +1602,7 @@ void Geom_BezierSurface::D2
uparameter_11, vparameter_11, uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11, uspanlenght_11, vspanlenght_11,
coeffs->Array2(), coeffs->Array2(),
wcoeffs->Array2(), &wcoeffs->Array2(),
P, D1U, D1V, D2U, D2UV , D2V); P, D1U, D1V, D2U, D2UV , D2V);
} }
else { else {
@ -1615,7 +1611,7 @@ void Geom_BezierSurface::D2
uparameter_11, vparameter_11, uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11, uspanlenght_11, vspanlenght_11,
coeffs->Array2(), coeffs->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
P, D1U, D1V, D2U, D2UV , D2V); P, D1U, D1V, D2U, D2UV , D2V);
} }
} }
@ -1631,8 +1627,8 @@ void Geom_BezierSurface::D2
if (urational || vrational) { if (urational || vrational) {
//-- ATTENTION a l'ORDRE d'appel ds BSPLSLIB //-- ATTENTION a l'ORDRE d'appel ds BSPLSLIB
BSplSLib::D2(U, V, 1,1,poles->Array2(), BSplSLib::D2(U, V, 1,1,poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots,bidvknots,bidumults,bidvmults, biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(), UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False, urational,vrational,Standard_False,Standard_False,
P,D1U, D1V, D2U, D2V , D2UV) ; P,D1U, D1V, D2U, D2V , D2UV) ;
@ -1640,8 +1636,8 @@ void Geom_BezierSurface::D2
else { else {
//-- ATTENTION a l'ORDRE d'appel ds BSPLSLIB //-- ATTENTION a l'ORDRE d'appel ds BSPLSLIB
BSplSLib::D2(U, V, 1,1,poles->Array2(), BSplSLib::D2(U, V, 1,1,poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots,bidvknots,bidumults,bidvmults, biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(), UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False, urational,vrational,Standard_False,Standard_False,
P,D1U, D1V, D2U, D2V, D2UV ) ; P,D1U, D1V, D2U, D2V, D2UV ) ;
@ -1667,8 +1663,8 @@ void Geom_BezierSurface::D3
TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1); TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) { if (urational || vrational) {
BSplSLib::D3 (U, V, 0, 0, poles->Array2(), BSplSLib::D3 (U, V, 0, 0, poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots, bidvknots, bidumults, bidvmults, biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0, UDegree(), VDegree(), urational, vrational, 0, 0,
P, P,
D1U, D1V, D1U, D1V,
@ -1677,8 +1673,8 @@ void Geom_BezierSurface::D3
} }
else { else {
BSplSLib::D3 (U, V, 0, 0, poles->Array2(), BSplSLib::D3 (U, V, 0, 0, poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots, bidvknots, bidumults, bidvmults, biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0, UDegree(), VDegree(), urational, vrational, 0, 0,
P, P,
D1U, D1V, D1U, D1V,
@ -1706,15 +1702,15 @@ gp_Vec Geom_BezierSurface::DN
TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1); TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) { if (urational || vrational) {
BSplSLib::DN (U, V, Nu, Nv, 0, 0, poles->Array2(), BSplSLib::DN (U, V, Nu, Nv, 0, 0, poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots, bidvknots, bidumults, bidvmults, biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0, UDegree(), VDegree(), urational, vrational, 0, 0,
Derivative); Derivative);
} }
else { else {
BSplSLib::DN (U, V, Nu, Nv, 0, 0, poles->Array2(), BSplSLib::DN (U, V, Nu, Nv, 0, 0, poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots, bidvknots, bidumults, bidvmults, biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0, UDegree(), VDegree(), urational, vrational, 0, 0,
Derivative); Derivative);
} }
@ -1797,9 +1793,9 @@ Handle(Geom_Curve) Geom_BezierSurface::UIso (const Standard_Real U) const
TColStd_Array1OfReal VCurveWeights TColStd_Array1OfReal VCurveWeights
(Weights.LowerCol() , Weights.UpperCol()); (Weights.LowerCol() , Weights.UpperCol());
BSplSLib::Iso (U, 1, Poles, BSplSLib::Iso (U, 1, Poles,
Weights, &Weights,
biduknots, bidumults, biduknots, &bidumults,
UDegree(), 0, VCurvePoles, VCurveWeights); UDegree(), 0, VCurvePoles, &VCurveWeights);
if (urational) if (urational)
UIsoCurve = new Geom_BezierCurve (VCurvePoles, VCurveWeights); UIsoCurve = new Geom_BezierCurve (VCurvePoles, VCurveWeights);
else else
@ -1807,8 +1803,8 @@ Handle(Geom_Curve) Geom_BezierSurface::UIso (const Standard_Real U) const
} }
else { else {
BSplSLib::Iso (U, 1, Poles, BSplSLib::Iso (U, 1, Poles,
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots, bidumults, biduknots, &bidumults,
UDegree(), 0, VCurvePoles, PLib::NoWeights()); UDegree(), 0, VCurvePoles, PLib::NoWeights());
UIsoCurve = new Geom_BezierCurve (VCurvePoles); UIsoCurve = new Geom_BezierCurve (VCurvePoles);
} }
@ -1843,9 +1839,9 @@ Handle(Geom_Curve) Geom_BezierSurface::VIso (const Standard_Real V) const
TColStd_Array1OfReal VCurveWeights TColStd_Array1OfReal VCurveWeights
(Weights.LowerRow() , Weights.UpperRow()); (Weights.LowerRow() , Weights.UpperRow());
BSplSLib::Iso (V, 0, Poles, BSplSLib::Iso (V, 0, Poles,
Weights, &Weights,
bidvknots, bidvmults, bidvknots, &bidvmults,
VDegree(), 0, VCurvePoles, VCurveWeights); VDegree(), 0, VCurvePoles, &VCurveWeights);
if (vrational) if (vrational)
VIsoCurve = new Geom_BezierCurve (VCurvePoles, VCurveWeights); VIsoCurve = new Geom_BezierCurve (VCurvePoles, VCurveWeights);
else else
@ -1853,8 +1849,8 @@ Handle(Geom_Curve) Geom_BezierSurface::VIso (const Standard_Real V) const
} }
else { else {
BSplSLib::Iso (V, 0, Poles, BSplSLib::Iso (V, 0, Poles,
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
bidvknots, bidvmults, bidvknots, &bidvmults,
VDegree(), 0, VCurvePoles, PLib::NoWeights()); VDegree(), 0, VCurvePoles, PLib::NoWeights());
VIsoCurve = new Geom_BezierCurve (VCurvePoles); VIsoCurve = new Geom_BezierCurve (VCurvePoles);
} }
@ -2030,7 +2026,7 @@ void Geom_BezierSurface::Resolution(const Standard_Real Tolerance3D,
TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1); TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1);
if(urational || vrational){ if(urational || vrational){
BSplSLib::Resolution(poles->Array2(), BSplSLib::Resolution(poles->Array2(),
weights->Array2(), &weights->Array2(),
biduknots, biduknots,
bidvknots, bidvknots,
bidumults, bidumults,
@ -2047,7 +2043,7 @@ void Geom_BezierSurface::Resolution(const Standard_Real Tolerance3D,
} }
else{ else{
BSplSLib::Resolution(poles->Array2(), BSplSLib::Resolution(poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
biduknots, biduknots,
bidvknots, bidvknots,
bidumults, bidumults,
@ -2139,9 +2135,9 @@ void Geom_BezierSurface::UpdateCoefficients(const Standard_Real ,
UDegree(),VDegree(),0,0, UDegree(),VDegree(),0,0,
biduflatknots,bidvflatknots, biduflatknots,bidvflatknots,
poles->Array2(), poles->Array2(),
weights->Array2(), &weights->Array2(),
coeffs->ChangeArray2(), coeffs->ChangeArray2(),
wcoeffs->ChangeArray2()); &wcoeffs->ChangeArray2());
} }
else { else {
BSplSLib::BuildCache(uparameter_11,vparameter_11, BSplSLib::BuildCache(uparameter_11,vparameter_11,
@ -2149,9 +2145,9 @@ void Geom_BezierSurface::UpdateCoefficients(const Standard_Real ,
UDegree(),VDegree(),0,0, UDegree(),VDegree(),0,0,
biduflatknots,bidvflatknots, biduflatknots,bidvflatknots,
poles->Array2(), poles->Array2(),
*((TColStd_Array2OfReal*) NULL), BSplSLib::NoWeights(),
coeffs->ChangeArray2(), coeffs->ChangeArray2(),
*((TColStd_Array2OfReal*) NULL)); BSplSLib::NoWeights());
} }
validcache = 1; validcache = 1;
} }

View File

@ -260,9 +260,9 @@ void Geom2d_BSplineCurve::IncreaseDegree
BSplCLib::IncreaseDegree BSplCLib::IncreaseDegree
(deg,Degree, periodic, (deg,Degree, periodic,
poles->Array1(),weights->Array1(), poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(),nweights->ChangeArray1(), npoles->ChangeArray1(),&nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
else { else {
@ -270,10 +270,10 @@ void Geom2d_BSplineCurve::IncreaseDegree
BSplCLib::IncreaseDegree BSplCLib::IncreaseDegree
(deg,Degree, periodic, (deg,Degree, periodic,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1()); nknots->ChangeArray1(),nmults->ChangeArray1());
} }
@ -368,7 +368,7 @@ void Geom2d_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots,
if (!BSplCLib::PrepareInsertKnots(deg,periodic, if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
Knots,Mults,nbpoles,nbknots,Epsilon,Add)) Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
Standard_ConstructionError::Raise("Geom2d_BSplineCurve::InsertKnots"); Standard_ConstructionError::Raise("Geom2d_BSplineCurve::InsertKnots");
if (nbpoles == poles->Length()) return; if (nbpoles == poles->Length()) return;
@ -386,10 +386,10 @@ void Geom2d_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots,
Handle(TColStd_HArray1OfReal) nweights = Handle(TColStd_HArray1OfReal) nweights =
new TColStd_HArray1OfReal(1,nbpoles); new TColStd_HArray1OfReal(1,nbpoles);
BSplCLib::InsertKnots(deg,periodic, BSplCLib::InsertKnots(deg,periodic,
poles->Array1(), weights->Array1(), poles->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), mults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray1(), nweights->ChangeArray1(), npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon,Add); Epsilon,Add);
weights = nweights; weights = nweights;
@ -397,11 +397,11 @@ void Geom2d_BSplineCurve::InsertKnots(const TColStd_Array1OfReal& Knots,
else { else {
BSplCLib::InsertKnots(deg,periodic, BSplCLib::InsertKnots(deg,periodic,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), mults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon,Add); Epsilon,Add);
} }
@ -453,9 +453,9 @@ Standard_Boolean Geom2d_BSplineCurve::RemoveKnot
new TColStd_HArray1OfReal(1,npoles->Length()); new TColStd_HArray1OfReal(1,npoles->Length());
if (!BSplCLib::RemoveKnot if (!BSplCLib::RemoveKnot
(Index, M, deg, periodic, (Index, M, deg, periodic,
poles->Array1(),weights->Array1(), poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(), nweights->ChangeArray1(), npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -465,10 +465,10 @@ Standard_Boolean Geom2d_BSplineCurve::RemoveKnot
if (!BSplCLib::RemoveKnot if (!BSplCLib::RemoveKnot
(Index, M, deg, periodic, (Index, M, deg, periodic,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(), nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance)) Tolerance))
return Standard_False; return Standard_False;
@ -1053,18 +1053,18 @@ void Geom2d_BSplineCurve::SetNotPeriodic ()
BSplCLib::Unperiodize BSplCLib::Unperiodize
(deg,mults->Array1(),knots->Array1(),poles->Array1(), (deg,mults->Array1(),knots->Array1(),poles->Array1(),
weights->Array1(),nmults->ChangeArray1(), &weights->Array1(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(), nknots->ChangeArray1(),npoles->ChangeArray1(),
nweights->ChangeArray1()); &nweights->ChangeArray1());
} }
else { else {
BSplCLib::Unperiodize BSplCLib::Unperiodize
(deg,mults->Array1(),knots->Array1(),poles->Array1(), (deg,mults->Array1(),knots->Array1(),poles->Array1(),
*((TColStd_Array1OfReal*) NULL),nmults->ChangeArray1(), BSplCLib::NoWeights(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(), nknots->ChangeArray1(),npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL)); BSplCLib::NoWeights());
} }
poles = npoles; poles = npoles;

View File

@ -798,7 +798,7 @@ public:
Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const; Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const;
//! Returns the weights of the B-spline curve; //! Returns the weights of the B-spline curve;
Standard_EXPORT const TColStd_Array1OfReal& Weights() const; Standard_EXPORT const TColStd_Array1OfReal* Weights() const;
//! Applies the transformation T to this BSpline curve. //! Applies the transformation T to this BSpline curve.
Standard_EXPORT void Transform (const gp_Trsf2d& T); Standard_EXPORT void Transform (const gp_Trsf2d& T);

View File

@ -195,21 +195,21 @@ void Geom2d_BSplineCurve::D0(const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P); P);
} }
else else
{ {
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P); P);
} }
} }
@ -227,21 +227,21 @@ void Geom2d_BSplineCurve::D1(const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1); P, V1);
} }
else else
{ {
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1); P, V1);
} }
} }
@ -259,21 +259,21 @@ void Geom2d_BSplineCurve::D2(const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2); P, V1, V2);
} }
else else
{ {
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2); P, V1, V2);
} }
} }
@ -292,21 +292,21 @@ void Geom2d_BSplineCurve::D3(const Standard_Real U,
Standard_Integer aSpanIndex = 0; Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U); Standard_Real aNewU(U);
PeriodicNormalization(aNewU); PeriodicNormalization(aNewU);
BSplCLib::LocateParameter(deg, knots->Array1(), mults->Array1(), U, periodic, aSpanIndex, aNewU); BSplCLib::LocateParameter(deg, knots->Array1(), &mults->Array1(), U, periodic, aSpanIndex, aNewU);
if (aNewU < knots->Value(aSpanIndex)) if (aNewU < knots->Value(aSpanIndex))
aSpanIndex--; aSpanIndex--;
if (rational) if (rational)
{ {
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2, V3); P, V1, V2, V3);
} }
else else
{ {
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES, BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(), knots->Array1(), &mults->Array1(),
P, V1, V2, V3); P, V1, V2, V3);
} }
} }
@ -323,12 +323,12 @@ gp_Vec2d Geom2d_BSplineCurve::DN(const Standard_Real U,
if ( rational ) { if ( rational ) {
BSplCLib::DN(U,N,0,deg,periodic,POLES, BSplCLib::DN(U,N,0,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS, V);
} }
else { else {
BSplCLib::DN(U,N,0,deg,periodic,POLES, BSplCLib::DN(U,N,0,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
return V; return V;
@ -485,12 +485,12 @@ void Geom2d_BSplineCurve::LocalD0
if ( rational ) { if ( rational ) {
BSplCLib::D0(u,index,deg,periodic,POLES, BSplCLib::D0(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P); FKNOTS,FMULTS,P);
} }
else { else {
BSplCLib::D0(u,index,deg,periodic,POLES, BSplCLib::D0(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P); FKNOTS,FMULTS,P);
} }
} }
@ -516,12 +516,12 @@ void Geom2d_BSplineCurve::LocalD1 (const Standard_Real U,
if (rational) { if (rational) {
BSplCLib::D1(u,index,deg,periodic,POLES, BSplCLib::D1(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P,V1); FKNOTS,FMULTS,P,V1);
} }
else { else {
BSplCLib::D1(u,index,deg,periodic,POLES, BSplCLib::D1(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1); FKNOTS,FMULTS,P,V1);
} }
} }
@ -549,12 +549,12 @@ void Geom2d_BSplineCurve::LocalD2
if ( rational ) { if ( rational ) {
BSplCLib::D2(u,index,deg,periodic,POLES, BSplCLib::D2(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2); FKNOTS,FMULTS,P,V1,V2);
} }
else { else {
BSplCLib::D2(u,index,deg,periodic,POLES, BSplCLib::D2(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2); FKNOTS,FMULTS,P,V1,V2);
} }
} }
@ -583,12 +583,12 @@ void Geom2d_BSplineCurve::LocalD3
if ( rational ) { if ( rational ) {
BSplCLib::D3(u,index,deg,periodic,POLES, BSplCLib::D3(u,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2,V3); FKNOTS,FMULTS,P,V1,V2,V3);
} }
else { else {
BSplCLib::D3(u,index,deg,periodic,POLES, BSplCLib::D3(u,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2,V3); FKNOTS,FMULTS,P,V1,V2,V3);
} }
} }
@ -616,12 +616,12 @@ gp_Vec2d Geom2d_BSplineCurve::LocalDN
if ( rational ) { if ( rational ) {
BSplCLib::DN(u,N,index,deg,periodic,POLES, BSplCLib::DN(u,N,index,deg,periodic,POLES,
weights->Array1(), &weights->Array1(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
else { else {
BSplCLib::DN(u,N,index,deg,periodic,POLES, BSplCLib::DN(u,N,index,deg,periodic,POLES,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
FKNOTS,FMULTS,V); FKNOTS,FMULTS,V);
} }
return V; return V;
@ -750,10 +750,10 @@ void Geom2d_BSplineCurve::Weights
} }
} }
const TColStd_Array1OfReal& Geom2d_BSplineCurve::Weights() const const TColStd_Array1OfReal* Geom2d_BSplineCurve::Weights() const
{ {
if (IsRational()) if (IsRational())
return weights->Array1(); return &weights->Array1();
return BSplCLib::NoWeights(); return BSplCLib::NoWeights();
} }
@ -856,7 +856,7 @@ void Geom2d_BSplineCurve::Resolution(const Standard_Real ToleranceUV,
new_weights(ii) = weights->Array1()(((ii-1) % poles->Length()) + 1) ; new_weights(ii) = weights->Array1()(((ii-1) % poles->Length()) + 1) ;
} }
BSplCLib::Resolution(new_poles, BSplCLib::Resolution(new_poles,
new_weights, &new_weights,
new_poles.Length(), new_poles.Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,
@ -865,7 +865,7 @@ void Geom2d_BSplineCurve::Resolution(const Standard_Real ToleranceUV,
} }
else { else {
BSplCLib::Resolution(new_poles, BSplCLib::Resolution(new_poles,
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
new_poles.Length(), new_poles.Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,
@ -876,7 +876,7 @@ void Geom2d_BSplineCurve::Resolution(const Standard_Real ToleranceUV,
else { else {
if (rational) { if (rational) {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
weights->Array1(), &weights->Array1(),
poles->Length(), poles->Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,
@ -885,7 +885,7 @@ void Geom2d_BSplineCurve::Resolution(const Standard_Real ToleranceUV,
} }
else { else {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
poles->Length(), poles->Length(),
flatknots->Array1(), flatknots->Array1(),
deg, deg,

View File

@ -155,18 +155,18 @@ void Geom2d_BezierCurve::Increase (const Standard_Integer Deg)
if (IsRational()) { if (IsRational()) {
nweights = new TColStd_HArray1OfReal(1,Deg+1); nweights = new TColStd_HArray1OfReal(1,Deg+1);
BSplCLib::IncreaseDegree(Degree(), Deg, 0, BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(),weights->Array1(), poles->Array1(),&weights->Array1(),
bidknots, bidmults, bidknots, bidmults,
npoles->ChangeArray1(),nweights->ChangeArray1(), npoles->ChangeArray1(),&nweights->ChangeArray1(),
bidknots, bidmults); bidknots, bidmults);
} }
else { else {
BSplCLib::IncreaseDegree(Degree(), Deg, 0, BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
bidknots, bidmults, bidknots, bidmults,
npoles->ChangeArray1(), npoles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
bidknots, bidmults); bidknots, bidmults);
} }
@ -378,17 +378,14 @@ void Geom2d_BezierCurve::Segment
// //
if (IsRational()) { if (IsRational()) {
PLib::Trimming(U1,U2,coeffs->ChangeArray1(),wcoeffs->ChangeArray1()); PLib::Trimming(U1,U2,coeffs->ChangeArray1(),&wcoeffs->ChangeArray1());
PLib::CoefficientsPoles(coeffs->Array1(),wcoeffs->Array1(), PLib::CoefficientsPoles(coeffs->Array1(),&wcoeffs->Array1(),
poles->ChangeArray1(),weights->ChangeArray1()); poles->ChangeArray1(),&weights->ChangeArray1());
} }
else { else {
PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::NoWeights());
*((TColStd_Array1OfReal*) NULL)); PLib::CoefficientsPoles(coeffs->Array1(), PLib::NoWeights(),
PLib::CoefficientsPoles(coeffs->Array1(), poles->ChangeArray1(), PLib::NoWeights());
*((TColStd_Array1OfReal*) NULL),
poles->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL));
} }
UpdateCoefficients(); UpdateCoefficients();
} }
@ -557,12 +554,10 @@ void Geom2d_BezierCurve::D0 (const Standard_Real U, gp_Pnt2d& P ) const
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U); // ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational()) if (IsRational())
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),wcoeffs->Array1(),P); coeffs->Array1(),&wcoeffs->Array1(),P);
else else
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(), BSplCLib::NoWeights(), P);
*((TColStd_Array1OfReal*) NULL),
P);
} }
//======================================================================= //=======================================================================
@ -580,12 +575,10 @@ void Geom2d_BezierCurve::D1(const Standard_Real U,
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U); // ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational()) if (IsRational())
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),wcoeffs->Array1(),P,V1); coeffs->Array1(),&wcoeffs->Array1(),P,V1);
else else
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(), BSplCLib::NoWeights(), P,V1);
*((TColStd_Array1OfReal*) NULL),
P,V1);
} }
//======================================================================= //=======================================================================
@ -604,12 +597,10 @@ void Geom2d_BezierCurve::D2 (const Standard_Real U,
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U); // ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational()) if (IsRational())
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),wcoeffs->Array1(),P,V1,V2); coeffs->Array1(),&wcoeffs->Array1(),P,V1,V2);
else else
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(), BSplCLib::NoWeights(), P,V1,V2);
*((TColStd_Array1OfReal*) NULL),
P,V1,V2);
} }
//======================================================================= //=======================================================================
@ -629,12 +620,10 @@ void Geom2d_BezierCurve::D3 (const Standard_Real U,
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U); // ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational()) if (IsRational())
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),wcoeffs->Array1(),P,V1,V2,V3); coeffs->Array1(),&wcoeffs->Array1(),P,V1,V2,V3);
else else
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache, BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(), coeffs->Array1(), BSplCLib::NoWeights(), P,V1,V2,V3);
*((TColStd_Array1OfReal*) NULL),
P,V1,V2,V3);
} }
//======================================================================= //=======================================================================
@ -653,13 +642,13 @@ gp_Vec2d Geom2d_BezierCurve::DN (const Standard_Real U,
if (IsRational()) if (IsRational())
BSplCLib::DN(U,N,0,Degree(),Standard_False, BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(),weights->Array1(), poles->Array1(),&weights->Array1(),
bidknots,bidmults,V); bidknots,&bidmults,V);
else else
BSplCLib::DN(U,N,0,Degree(),Standard_False, BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(), poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
bidknots,bidmults,V); bidknots,&bidmults,V);
return V; return V;
} }
@ -817,7 +806,7 @@ void Geom2d_BezierCurve::Resolution(const Standard_Real ToleranceUV,
if (IsRational()) { if (IsRational()) {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
weights->Array1(), &weights->Array1(),
poles->Length(), poles->Length(),
bidflatknots, bidflatknots,
Degree(), Degree(),
@ -826,7 +815,7 @@ void Geom2d_BezierCurve::Resolution(const Standard_Real ToleranceUV,
} }
else { else {
BSplCLib::Resolution(poles->Array1(), BSplCLib::Resolution(poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
poles->Length(), poles->Length(),
bidflatknots, bidflatknots,
Degree(), Degree(),
@ -919,14 +908,14 @@ void Geom2d_BezierCurve::UpdateCoefficients(const Standard_Real )
1, 2*(Degree()+1)); 1, 2*(Degree()+1));
if (IsRational()) if (IsRational())
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(), BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(),weights->Array1(), bidflatknots,poles->Array1(),&weights->Array1(),
coeffs->ChangeArray1(),wcoeffs->ChangeArray1()); coeffs->ChangeArray1(),&wcoeffs->ChangeArray1());
else else
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(), BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(), bidflatknots,poles->Array1(),
*((TColStd_Array1OfReal*) NULL), BSplCLib::NoWeights(),
coeffs->ChangeArray1(), coeffs->ChangeArray1(),
*((TColStd_Array1OfReal*) NULL)); BSplCLib::NoWeights());
validcache = 1; validcache = 1;
} }

View File

@ -267,7 +267,7 @@ void Geom2dAPI_PointsToBSpline::Init
// insert the Knots // insert the Knots
BSplCLib::InsertKnots(Degree,Standard_False,1, BSplCLib::InsertKnots(Degree,Standard_False,1,
NewTempPoles,NewTempKnots,NewTempMults, NewTempPoles,NewTempKnots,NewTempMults,
TheCurve.Knots(),TheCurve.Multiplicities(), TheCurve.Knots(),&TheCurve.Multiplicities(),
XPoles,Knots,Mults, XPoles,Knots,Mults,
Epsilon(1)); Epsilon(1));

View File

@ -562,7 +562,7 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColStd_Array2OfReal& ZPoints,
// insert the Knots // insert the Knots
BSplCLib::InsertKnots(VDegree,Standard_False,1, BSplCLib::InsertKnots(VDegree,Standard_False,1,
NewTempPoles,NewTempKnots,NewTempMults, NewTempPoles,NewTempKnots,NewTempMults,
TheCurve.Knots(),TheCurve.Multiplicities(), TheCurve.Knots(),&TheCurve.Multiplicities(),
YPoles,VKnots,VMults, YPoles,VKnots,VMults,
Epsilon(1)); Epsilon(1));
@ -628,7 +628,7 @@ void GeomAPI_PointsToBSplineSurface::Init(const TColStd_Array2OfReal& ZPoints,
// insert the Knots // insert the Knots
BSplCLib::InsertKnots(UDegree,Standard_False,1, BSplCLib::InsertKnots(UDegree,Standard_False,1,
NewTempPoles2,NewTempKnots,NewTempMults, NewTempPoles2,NewTempKnots,NewTempMults,
TheCurve2.Knots(),TheCurve2.Multiplicities(), TheCurve2.Knots(),&TheCurve2.Multiplicities(),
XPoles,UKnots,UMults, XPoles,UKnots,UMults,
Epsilon(1)); Epsilon(1));

View File

@ -154,15 +154,15 @@ Standard_Integer SetSameDistribution(Handle(Geom_BSplineCurve)& C1,
Standard_Integer NP,NK; Standard_Integer NP,NK;
if ( BSplCLib::PrepareInsertKnots(C1->Degree(),Standard_False, if ( BSplCLib::PrepareInsertKnots(C1->Degree(),Standard_False,
K1,M1,K2,M2,NP,NK,Precision::PConfusion(), K1,M1,K2,&M2,NP,NK,Precision::PConfusion(),
Standard_False)) { Standard_False)) {
TColgp_Array1OfPnt NewP(1, NP); TColgp_Array1OfPnt NewP(1, NP);
TColStd_Array1OfReal NewW(1, NP); TColStd_Array1OfReal NewW(1, NP);
TColStd_Array1OfReal NewK(1, NK); TColStd_Array1OfReal NewK(1, NK);
TColStd_Array1OfInteger NewM(1, NK); TColStd_Array1OfInteger NewM(1, NK);
BSplCLib::InsertKnots(C1->Degree(),Standard_False, BSplCLib::InsertKnots(C1->Degree(),Standard_False,
P1,W1,K1,M1,K2,M2, P1,&W1,K1,M1,K2,&M2,
NewP,NewW,NewK,NewM,Precision::PConfusion(), NewP,&NewW,NewK,NewM,Precision::PConfusion(),
Standard_False); Standard_False);
if ( C1->IsRational()) { if ( C1->IsRational()) {
C1 = new Geom_BSplineCurve(NewP,NewW,NewK,NewM,C1->Degree()); C1 = new Geom_BSplineCurve(NewP,NewW,NewK,NewM,C1->Degree());
@ -171,8 +171,8 @@ Standard_Integer SetSameDistribution(Handle(Geom_BSplineCurve)& C1,
C1 = new Geom_BSplineCurve(NewP,NewK,NewM,C1->Degree()); C1 = new Geom_BSplineCurve(NewP,NewK,NewM,C1->Degree());
} }
BSplCLib::InsertKnots(C2->Degree(),Standard_False, BSplCLib::InsertKnots(C2->Degree(),Standard_False,
P2,W2,K2,M2,K1,M1, P2,&W2,K2,M2,K1,&M1,
NewP,NewW,NewK,NewM,Precision::PConfusion(), NewP,&NewW,NewK,NewM,Precision::PConfusion(),
Standard_False); Standard_False);
if ( C2->IsRational()) { if ( C2->IsRational()) {
C2 = new Geom_BSplineCurve(NewP,NewW,NewK,NewM,C2->Degree()); C2 = new Geom_BSplineCurve(NewP,NewW,NewK,NewM,C2->Degree());

View File

@ -693,43 +693,43 @@ void GeomFill_ConstrainedFilling::MatchKnots()
if(BSplCLib::PrepareInsertKnots(degree[1],0, if(BSplCLib::PrepareInsertKnots(degree[1],0,
knots[1]->Array1(), knots[1]->Array1(),
mults[1]->Array1(), mults[1]->Array1(),
addk,addm,nbnp,nbnk,tolk,0)){ addk,&addm,nbnp,nbnk,tolk,0)){
nm[1] = new TColStd_HArray1OfInteger(1,nbnk); nm[1] = new TColStd_HArray1OfInteger(1,nbnk);
nk[1] = new TColStd_HArray1OfReal(1,nbnk); nk[1] = new TColStd_HArray1OfReal(1,nbnk);
ncpol[1] = new TColgp_HArray1OfPnt(1,nbnp); ncpol[1] = new TColgp_HArray1OfPnt(1,nbnp);
ncpol[3] = new TColgp_HArray1OfPnt(1,nbnp); ncpol[3] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[1],0, BSplCLib::InsertKnots(degree[1],0,
curvpol[1]->Array1(),PLib::NoWeights(), curvpol[1]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(), knots[1]->Array1(),mults[1]->Array1(),
addk,addm, addk,&addm,
ncpol[1]->ChangeArray1(),PLib::NoWeights(), ncpol[1]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(), nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0); tolk,0);
BSplCLib::InsertKnots(degree[1],0, BSplCLib::InsertKnots(degree[1],0,
curvpol[3]->Array1(),PLib::NoWeights(), curvpol[3]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(), knots[1]->Array1(),mults[1]->Array1(),
addk,addm, addk,&addm,
ncpol[3]->ChangeArray1(),PLib::NoWeights(), ncpol[3]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(), nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0); tolk,0);
if(!tgtepol[1].IsNull()){ if(!tgtepol[1].IsNull()){
ntpol[1] = new TColgp_HArray1OfPnt(1,nbnp); ntpol[1] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[1],0, BSplCLib::InsertKnots(degree[1],0,
tgtepol[1]->Array1(),PLib::NoWeights(), tgtepol[1]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(), knots[1]->Array1(),mults[1]->Array1(),
addk,addm, addk,&addm,
ntpol[1]->ChangeArray1(),PLib::NoWeights(), ntpol[1]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(), nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0); tolk,0);
} }
if(!tgtepol[3].IsNull()){ if(!tgtepol[3].IsNull()){
ntpol[3] = new TColgp_HArray1OfPnt(1,nbnp); ntpol[3] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[1],0, BSplCLib::InsertKnots(degree[1],0,
tgtepol[3]->Array1(),PLib::NoWeights(), tgtepol[3]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(), knots[1]->Array1(),mults[1]->Array1(),
addk,addm, addk,&addm,
ntpol[3]->ChangeArray1(),PLib::NoWeights(), ntpol[3]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(), nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0); tolk,0);
} }
@ -760,43 +760,43 @@ void GeomFill_ConstrainedFilling::MatchKnots()
if(BSplCLib::PrepareInsertKnots(degree[0],0, if(BSplCLib::PrepareInsertKnots(degree[0],0,
knots[0]->Array1(), knots[0]->Array1(),
mults[0]->Array1(), mults[0]->Array1(),
addk,addm,nbnp,nbnk,tolk,0)){ addk,&addm,nbnp,nbnk,tolk,0)){
nm[0] = new TColStd_HArray1OfInteger(1,nbnk); nm[0] = new TColStd_HArray1OfInteger(1,nbnk);
nk[0] = new TColStd_HArray1OfReal(1,nbnk); nk[0] = new TColStd_HArray1OfReal(1,nbnk);
ncpol[0] = new TColgp_HArray1OfPnt(1,nbnp); ncpol[0] = new TColgp_HArray1OfPnt(1,nbnp);
ncpol[2] = new TColgp_HArray1OfPnt(1,nbnp); ncpol[2] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[0],0, BSplCLib::InsertKnots(degree[0],0,
curvpol[0]->Array1(),PLib::NoWeights(), curvpol[0]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(), knots[0]->Array1(),mults[0]->Array1(),
addk,addm, addk,&addm,
ncpol[0]->ChangeArray1(),PLib::NoWeights(), ncpol[0]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(), nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0); tolk,0);
BSplCLib::InsertKnots(degree[0],0, BSplCLib::InsertKnots(degree[0],0,
curvpol[2]->Array1(),PLib::NoWeights(), curvpol[2]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(), knots[0]->Array1(),mults[0]->Array1(),
addk,addm, addk,&addm,
ncpol[2]->ChangeArray1(),PLib::NoWeights(), ncpol[2]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(), nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0); tolk,0);
if(!tgtepol[0].IsNull()){ if(!tgtepol[0].IsNull()){
ntpol[0] = new TColgp_HArray1OfPnt(1,nbnp); ntpol[0] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[0],0, BSplCLib::InsertKnots(degree[0],0,
tgtepol[0]->Array1(),PLib::NoWeights(), tgtepol[0]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(), knots[0]->Array1(),mults[0]->Array1(),
addk,addm, addk,&addm,
ntpol[0]->ChangeArray1(),PLib::NoWeights(), ntpol[0]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(), nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0); tolk,0);
} }
if(!tgtepol[2].IsNull()){ if(!tgtepol[2].IsNull()){
ntpol[2] = new TColgp_HArray1OfPnt(1,nbnp); ntpol[2] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[0],0, BSplCLib::InsertKnots(degree[0],0,
tgtepol[2]->Array1(),PLib::NoWeights(), tgtepol[2]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(), knots[0]->Array1(),mults[0]->Array1(),
addk,addm, addk,&addm,
ntpol[2]->ChangeArray1(),PLib::NoWeights(), ntpol[2]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(), nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0); tolk,0);
} }
@ -1355,10 +1355,10 @@ void GeomFill_ConstrainedFilling::CheckApprox(const Standard_Integer I)
uu /= nbp; uu /= nbp;
pbound = bou->Value(uu); pbound = bou->Value(uu);
BSplCLib::D0(uu,0,degree[I%2],0,ncpol[I]->Array1(),BSplCLib::NoWeights(), BSplCLib::D0(uu,0,degree[I%2],0,ncpol[I]->Array1(),BSplCLib::NoWeights(),
nk[I%2]->Array1(),nm[I%2]->Array1(),papp); nk[I%2]->Array1(),&nm[I%2]->Array1(),papp);
if(donor) { if(donor) {
BSplCLib::D0(uu,0,degree[I%2],0,ntpol[I]->Array1(),BSplCLib::NoWeights(), BSplCLib::D0(uu,0,degree[I%2],0,ntpol[I]->Array1(),BSplCLib::NoWeights(),
nk[I%2]->Array1(),nm[I%2]->Array1(),pbid); nk[I%2]->Array1(),&nm[I%2]->Array1(),pbid);
vapp.SetXYZ(pbid.XYZ()); vapp.SetXYZ(pbid.XYZ());
vbound = bou->Norm(uu); vbound = bou->Norm(uu);
if(vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15){ if(vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15){

View File

@ -106,15 +106,15 @@ void GeomFill_Coons::Init(const TColgp_Array1OfPnt& P1,
PLib::CoefficientsPoles(Coef, PLib::NoWeights(), PLib::CoefficientsPoles(Coef, PLib::NoWeights(),
Pole, PLib::NoWeights()); Pole, PLib::NoWeights());
if (NPolU > 4) { if (NPolU > 4) {
BSplCLib::IncreaseDegree(NPolU-1, Pole, PLib::NoWeights(), BSplCLib::IncreaseDegree(NPolU-1, Pole, BSplCLib::NoWeights(),
CoefU, PLib::NoWeights()); CoefU, BSplCLib::NoWeights());
} }
else { else {
CoefU = Pole; CoefU = Pole;
} }
if (NPolV > 4) { if (NPolV > 4) {
BSplCLib::IncreaseDegree(NPolV-1, Pole, PLib::NoWeights(), BSplCLib::IncreaseDegree(NPolV-1, Pole, BSplCLib::NoWeights(),
CoefV, PLib::NoWeights()); CoefV, BSplCLib::NoWeights());
} }
else { else {
CoefV = Pole; CoefV = Pole;

View File

@ -2190,10 +2190,10 @@ static void FunctionMultiply(Handle(Geom_BSplineSurface)& BSurf,
BSurf->VDegree(), BSurf->VDegree(),
surface_u_knots, surface_u_knots,
surface_v_knots, surface_v_knots,
surface_u_mults, &surface_u_mults,
surface_v_mults, &surface_v_mults,
surface_poles, surface_poles,
surface_weights, &surface_weights,
newuflatknots, newuflatknots,
newvflatknots, newvflatknots,
BSurf->UDegree()+3, BSurf->UDegree()+3,

View File

@ -77,9 +77,9 @@ Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real UParamet
BSplSLib::HomogeneousD1(mySurface->UKnot(mySurface->LastUKnotIndex()),VParameter, BSplSLib::HomogeneousD1(mySurface->UKnot(mySurface->LastUKnotIndex()),VParameter,
0,0, 0,0,
surface_poles, surface_poles,
surface_weights, &surface_weights,
surface_u_knots,surface_v_knots, surface_u_knots,surface_v_knots,
surface_u_mults,surface_v_mults, &surface_u_mults,&surface_v_mults,
udegree,vdegree, udegree,vdegree,
mySurface->IsURational(),mySurface->IsVRational(), mySurface->IsURational(),mySurface->IsVRational(),
mySurface->IsUPeriodic(),mySurface->IsVPeriodic(), mySurface->IsUPeriodic(),mySurface->IsVPeriodic(),
@ -90,9 +90,9 @@ Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real UParamet
BSplSLib::HomogeneousD1(mySurface->UKnot(1),VParameter, BSplSLib::HomogeneousD1(mySurface->UKnot(1),VParameter,
0,0, 0,0,
surface_poles, surface_poles,
surface_weights, &surface_weights,
surface_u_knots,surface_v_knots, surface_u_knots,surface_v_knots,
surface_u_mults,surface_v_mults, &surface_u_mults,&surface_v_mults,
udegree,vdegree, udegree,vdegree,
mySurface->IsURational(),mySurface->IsVRational(), mySurface->IsURational(),mySurface->IsVRational(),
mySurface->IsUPeriodic(),mySurface->IsVPeriodic(), mySurface->IsUPeriodic(),mySurface->IsVPeriodic(),

View File

@ -58,8 +58,8 @@ static void HermiteCoeff(const Handle(Geom_BSplineCurve)& BS,
Index0 = BS->FirstUKnotIndex(); Index0 = BS->FirstUKnotIndex();
Index1 = BS->LastUKnotIndex()-1; Index1 = BS->LastUKnotIndex()-1;
BSplCLib::D1(0.0,Index0,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,Mults,Denom0,Deriv0); BSplCLib::D1(0.0,Index0,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,&Mults,Denom0,Deriv0);
BSplCLib::D1(1.0,Index1,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,Mults,Denom1,Deriv1); BSplCLib::D1(1.0,Index1,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,&Mults,Denom1,Deriv1);
TAB(0) = 1/Denom0; //Hermit coefficients TAB(0) = 1/Denom0; //Hermit coefficients
TAB(1) = -Deriv0/(Denom0*Denom0); TAB(1) = -Deriv0/(Denom0*Denom0);
TAB(2) = -Deriv1/(Denom1*Denom1); TAB(2) = -Deriv1/(Denom1*Denom1);
@ -94,8 +94,8 @@ static void HermiteCoeff(const Handle(Geom2d_BSplineCurve)& BS,
Index0 = BS->FirstUKnotIndex(); Index0 = BS->FirstUKnotIndex();
Index1 = BS->LastUKnotIndex()-1; Index1 = BS->LastUKnotIndex()-1;
BSplCLib::D1(0.0,Index0,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,Mults,Denom0,Deriv0); BSplCLib::D1(0.0,Index0,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,&Mults,Denom0,Deriv0);
BSplCLib::D1(1.0,Index1,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,Mults,Denom1,Deriv1); BSplCLib::D1(1.0,Index1,Degree,Periodic,Weights,BSplCLib::NoWeights(),Knots,&Mults,Denom1,Deriv1);
TAB(0) = 1/Denom0; //Hermit coefficients TAB(0) = 1/Denom0; //Hermit coefficients
TAB(1) = -Deriv0/(Denom0*Denom0); TAB(1) = -Deriv0/(Denom0*Denom0);
TAB(2) = -Deriv1/(Denom1*Denom1); TAB(2) = -Deriv1/(Denom1*Denom1);

View File

@ -457,7 +457,7 @@ void Law_BSpline::InsertKnots(const TColStd_Array1OfReal& Knots,
if (!BSplCLib::PrepareInsertKnots(deg,periodic, if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(), knots->Array1(),mults->Array1(),
Knots,Mults,nbpoles,nbknots,Epsilon,Add)) Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
Standard_ConstructionError::Raise("Law_BSpline::InsertKnots"); Standard_ConstructionError::Raise("Law_BSpline::InsertKnots");
if (nbpoles == poles->Length()) return; if (nbpoles == poles->Length()) return;
@ -479,7 +479,7 @@ void Law_BSpline::InsertKnots(const TColStd_Array1OfReal& Knots,
TColStd_Array1OfReal adimnpol(1,2*npoles->Upper()); TColStd_Array1OfReal adimnpol(1,2*npoles->Upper());
BSplCLib::InsertKnots(deg,periodic,2,adimpol, BSplCLib::InsertKnots(deg,periodic,2,adimpol,
knots->Array1(), mults->Array1(), knots->Array1(), mults->Array1(),
Knots, Mults,adimnpol, Knots, &Mults,adimnpol,
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add); Epsilon, Add);
GetPoles(adimnpol,npoles->ChangeArray1(),nweights->ChangeArray1()); GetPoles(adimnpol,npoles->ChangeArray1(),nweights->ChangeArray1());
@ -488,7 +488,7 @@ void Law_BSpline::InsertKnots(const TColStd_Array1OfReal& Knots,
else { else {
BSplCLib::InsertKnots(deg,periodic,1,poles->Array1(), BSplCLib::InsertKnots(deg,periodic,1,poles->Array1(),
knots->Array1(), mults->Array1(), knots->Array1(), mults->Array1(),
Knots, Mults, Knots, &Mults,
npoles->ChangeArray1(), npoles->ChangeArray1(),
nknots->ChangeArray1(), nmults->ChangeArray1(), nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add); Epsilon, Add);
@ -1403,7 +1403,7 @@ void Law_BSpline::D0 (const Standard_Real U,
Standard_Real NewU = U ; Standard_Real NewU = U ;
PeriodicNormalization(NewU) ; PeriodicNormalization(NewU) ;
if (rational) { if (rational) {
BSplCLib::D0(NewU,0,deg,periodic,POLES, weights->Array1(),FKNOTS,FMULTS,P); BSplCLib::D0(NewU,0,deg,periodic,POLES, &weights->Array1(),FKNOTS,FMULTS,P);
} }
else { else {
BSplCLib::D0(NewU,0,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P); BSplCLib::D0(NewU,0,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P);
@ -1425,7 +1425,7 @@ void Law_BSpline::D1 (const Standard_Real U,
Standard_Real NewU = U ; Standard_Real NewU = U ;
PeriodicNormalization(NewU) ; PeriodicNormalization(NewU) ;
if (rational) { if (rational) {
BSplCLib::D1(NewU,0,deg,periodic,POLES, weights->Array1(),FKNOTS,FMULTS, BSplCLib::D1(NewU,0,deg,periodic,POLES, &weights->Array1(),FKNOTS,FMULTS,
P,V1) ; P,V1) ;
} }
else { else {
@ -1449,7 +1449,7 @@ void Law_BSpline::D2(const Standard_Real U ,
Standard_Real NewU = U ; Standard_Real NewU = U ;
PeriodicNormalization(NewU) ; PeriodicNormalization(NewU) ;
if (rational) { if (rational) {
BSplCLib::D2(NewU,0,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS, BSplCLib::D2(NewU,0,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,
P, V1, V2) ; P, V1, V2) ;
} }
else { else {
@ -1474,7 +1474,7 @@ void Law_BSpline::D3(const Standard_Real U ,
Standard_Real NewU = U ; Standard_Real NewU = U ;
PeriodicNormalization(NewU) ; PeriodicNormalization(NewU) ;
if (rational) { if (rational) {
BSplCLib::D3(NewU,0,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS, BSplCLib::D3(NewU,0,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,
P, V1, V2, V3) ; P, V1, V2, V3) ;
} }
else { else {
@ -1495,7 +1495,7 @@ Standard_Real Law_BSpline::DN(const Standard_Real U,
{ {
Standard_Real V; Standard_Real V;
if (rational) { if (rational) {
BSplCLib::DN(U,N,0,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS,V); BSplCLib::DN(U,N,0,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,V);
} }
else { else {
BSplCLib::DN(U,N,0,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,V); BSplCLib::DN(U,N,0,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,V);
@ -1650,7 +1650,7 @@ void Law_BSpline::LocalD0
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic,FromK1,ToK2, index,u); BSplCLib::LocateParameter(deg, FKNOTS, U, periodic,FromK1,ToK2, index,u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D0(u,index,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS,P); BSplCLib::D0(u,index,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,P);
} }
else { else {
BSplCLib::D0(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P); BSplCLib::D0(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P);
@ -1675,7 +1675,7 @@ void Law_BSpline::LocalD1 (const Standard_Real U,
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u); BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D1(u,index,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS,P,V1); BSplCLib::D1(u,index,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,P,V1);
} }
else { else {
BSplCLib::D1(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1); BSplCLib::D1(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1);
@ -1703,7 +1703,7 @@ void Law_BSpline::LocalD2
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u); BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D2(u,index,deg,periodic,POLES, weights->Array1(),FKNOTS,FMULTS,P,V1,V2); BSplCLib::D2(u,index,deg,periodic,POLES, &weights->Array1(),FKNOTS,FMULTS,P,V1,V2);
} }
else { else {
BSplCLib::D2(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1,V2); BSplCLib::D2(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1,V2);
@ -1732,7 +1732,7 @@ void Law_BSpline::LocalD3
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u); BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic); index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) { if (rational) {
BSplCLib::D3(u,index,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS,P,V1,V2,V3); BSplCLib::D3(u,index,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,P,V1,V2,V3);
} }
else { else {
BSplCLib::D3(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1,V2,V3); BSplCLib::D3(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1,V2,V3);
@ -1761,7 +1761,7 @@ Standard_Real Law_BSpline::LocalDN
Standard_Real V; Standard_Real V;
if (rational) { if (rational) {
BSplCLib::DN(u,N,index,deg,periodic,POLES,weights->Array1(),FKNOTS,FMULTS,V); BSplCLib::DN(u,N,index,deg,periodic,POLES,&weights->Array1(),FKNOTS,FMULTS,V);
} }
else { else {
BSplCLib::DN(u,N,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,V); BSplCLib::DN(u,N,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,V);
@ -2012,7 +2012,7 @@ void Law_BSpline::Resolution(const Standard_Real Tolerance3D,
Standard_Real* bidr = (Standard_Real*)bid; Standard_Real* bidr = (Standard_Real*)bid;
if (rational) { if (rational) {
BSplCLib::Resolution(*bidr,1,poles->Length(), BSplCLib::Resolution(*bidr,1,poles->Length(),
weights->Array1(),FKNOTS,deg, &weights->Array1(),FKNOTS,deg,
Tolerance3D, Tolerance3D,
UTolerance) ; UTolerance) ;
} }

View File

@ -1,6 +1,5 @@
PLib.cxx PLib.cxx
PLib.hxx PLib.hxx
PLib.lxx
PLib_Base.cxx PLib_Base.cxx
PLib_Base.hxx PLib_Base.hxx
PLib_DoubleJacobiPolynomial.cxx PLib_DoubleJacobiPolynomial.cxx

View File

@ -1331,9 +1331,9 @@ Standard_Boolean PLib::HermiteCoefficients(const Standard_Real FirstParameter,
//======================================================================= //=======================================================================
void PLib::CoefficientsPoles (const TColgp_Array1OfPnt& Coefs, void PLib::CoefficientsPoles (const TColgp_Array1OfPnt& Coefs,
const TColStd_Array1OfReal& WCoefs, const TColStd_Array1OfReal* WCoefs,
TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt& Poles,
TColStd_Array1OfReal& Weights) TColStd_Array1OfReal* Weights)
{ {
TColStd_Array1OfReal tempC(1,3*Coefs.Length()); TColStd_Array1OfReal tempC(1,3*Coefs.Length());
PLib::SetPoles(Coefs,tempC); PLib::SetPoles(Coefs,tempC);
@ -1349,9 +1349,9 @@ void PLib::CoefficientsPoles (const TColgp_Array1OfPnt& Coefs,
//======================================================================= //=======================================================================
void PLib::CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs, void PLib::CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs,
const TColStd_Array1OfReal& WCoefs, const TColStd_Array1OfReal* WCoefs,
TColgp_Array1OfPnt2d& Poles, TColgp_Array1OfPnt2d& Poles,
TColStd_Array1OfReal& Weights) TColStd_Array1OfReal* Weights)
{ {
TColStd_Array1OfReal tempC(1,2*Coefs.Length()); TColStd_Array1OfReal tempC(1,2*Coefs.Length());
PLib::SetPoles(Coefs,tempC); PLib::SetPoles(Coefs,tempC);
@ -1367,9 +1367,9 @@ void PLib::CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs,
//======================================================================= //=======================================================================
void PLib::CoefficientsPoles (const TColStd_Array1OfReal& Coefs, void PLib::CoefficientsPoles (const TColStd_Array1OfReal& Coefs,
const TColStd_Array1OfReal& WCoefs, const TColStd_Array1OfReal* WCoefs,
TColStd_Array1OfReal& Poles, TColStd_Array1OfReal& Poles,
TColStd_Array1OfReal& Weights) TColStd_Array1OfReal* Weights)
{ {
PLib::CoefficientsPoles(1,Coefs,WCoefs,Poles,Weights); PLib::CoefficientsPoles(1,Coefs,WCoefs,Poles,Weights);
} }
@ -1381,11 +1381,11 @@ void PLib::CoefficientsPoles (const TColStd_Array1OfReal& Coefs,
void PLib::CoefficientsPoles (const Standard_Integer dim, void PLib::CoefficientsPoles (const Standard_Integer dim,
const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal& Coefs,
const TColStd_Array1OfReal& WCoefs, const TColStd_Array1OfReal* WCoefs,
TColStd_Array1OfReal& Poles, TColStd_Array1OfReal& Poles,
TColStd_Array1OfReal& Weights) TColStd_Array1OfReal* Weights)
{ {
Standard_Boolean rat = &WCoefs != NULL; Standard_Boolean rat = WCoefs != NULL;
Standard_Integer loc = Coefs.Lower(); Standard_Integer loc = Coefs.Lower();
Standard_Integer lop = Poles.Lower(); Standard_Integer lop = Poles.Lower();
Standard_Integer lowc=0; Standard_Integer lowc=0;
@ -1398,8 +1398,8 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
Standard_Integer i,j,k; Standard_Integer i,j,k;
//Les Extremites. //Les Extremites.
if (rat) { if (rat) {
lowc = WCoefs.Lower(); lowp = Weights.Lower(); lowc = WCoefs->Lower(); lowp = Weights->Lower();
upwc = WCoefs.Upper(); upwp = Weights.Upper(); upwc = WCoefs->Upper(); upwp = Weights->Upper();
} }
for (i = 0; i < dim; i++){ for (i = 0; i < dim; i++){
@ -1407,14 +1407,14 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
Poles (upp - i) = Coefs (upc - i); Poles (upp - i) = Coefs (upc - i);
} }
if (rat) { if (rat) {
Weights (lowp) = WCoefs (lowc); (*Weights) (lowp) = (*WCoefs) (lowc);
Weights (upwp) = WCoefs (upwc); (*Weights) (upwp) = (*WCoefs) (upwc);
} }
Standard_Real Cnp; Standard_Real Cnp;
for (i = 2; i < reflen; i++ ) { for (i = 2; i < reflen; i++ ) {
Cnp = PLib::Bin(reflen - 1, i - 1); Cnp = PLib::Bin(reflen - 1, i - 1);
if (rat) Weights (lowp + i - 1) = WCoefs (lowc + i - 1) / Cnp; if (rat) (*Weights)(lowp + i - 1) = (*WCoefs)(lowc + i - 1) / Cnp;
for(j = 0; j < dim; j++){ for(j = 0; j < dim; j++){
Poles(lop + dim * (i-1) + j)= Coefs(loc + dim * (i-1) + j) / Cnp; Poles(lop + dim * (i-1) + j)= Coefs(loc + dim * (i-1) + j) / Cnp;
@ -1424,7 +1424,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
for (i = 1; i <= reflen - 1; i++) { for (i = 1; i <= reflen - 1; i++) {
for (j = reflen - 1; j >= i; j--) { for (j = reflen - 1; j >= i; j--) {
if (rat) Weights (lowp + j) += Weights (lowp + j -1); if (rat) (*Weights)(lowp + j) += (*Weights)(lowp + j - 1);
for(k = 0; k < dim; k++){ for(k = 0; k < dim; k++){
Poles(lop + dim * j + k) += Poles(lop + dim * (j - 1) + k); Poles(lop + dim * j + k) += Poles(lop + dim * (j - 1) + k);
@ -1436,7 +1436,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
for (i = 1; i <= reflen; i++) { for (i = 1; i <= reflen; i++) {
for(j = 0; j < dim; j++){ for(j = 0; j < dim; j++){
Poles(lop + dim * (i-1) + j) /= Weights(lowp + i -1); Poles(lop + dim * (i-1) + j) /= (*Weights)(lowp + i -1);
} }
} }
} }
@ -1450,7 +1450,7 @@ void PLib::CoefficientsPoles (const Standard_Integer dim,
void PLib::Trimming(const Standard_Real U1, void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
TColgp_Array1OfPnt& Coefs, TColgp_Array1OfPnt& Coefs,
TColStd_Array1OfReal& WCoefs) TColStd_Array1OfReal* WCoefs)
{ {
TColStd_Array1OfReal temp(1,3*Coefs.Length()); TColStd_Array1OfReal temp(1,3*Coefs.Length());
PLib::SetPoles(Coefs,temp); PLib::SetPoles(Coefs,temp);
@ -1466,7 +1466,7 @@ void PLib::Trimming(const Standard_Real U1,
void PLib::Trimming(const Standard_Real U1, void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
TColgp_Array1OfPnt2d& Coefs, TColgp_Array1OfPnt2d& Coefs,
TColStd_Array1OfReal& WCoefs) TColStd_Array1OfReal* WCoefs)
{ {
TColStd_Array1OfReal temp(1,2*Coefs.Length()); TColStd_Array1OfReal temp(1,2*Coefs.Length());
PLib::SetPoles(Coefs,temp); PLib::SetPoles(Coefs,temp);
@ -1482,7 +1482,7 @@ void PLib::Trimming(const Standard_Real U1,
void PLib::Trimming(const Standard_Real U1, void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
TColStd_Array1OfReal& Coefs, TColStd_Array1OfReal& Coefs,
TColStd_Array1OfReal& WCoefs) TColStd_Array1OfReal* WCoefs)
{ {
PLib::Trimming(U1,U2,1,Coefs,WCoefs); PLib::Trimming(U1,U2,1,Coefs,WCoefs);
} }
@ -1496,7 +1496,7 @@ void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
const Standard_Integer dim, const Standard_Integer dim,
TColStd_Array1OfReal& Coefs, TColStd_Array1OfReal& Coefs,
TColStd_Array1OfReal& WCoefs) TColStd_Array1OfReal* WCoefs)
{ {
// principe : // principe :
@ -1508,12 +1508,12 @@ void PLib::Trimming(const Standard_Real U1,
Standard_Integer indc, indw=0; Standard_Integer indc, indw=0;
Standard_Integer upc = Coefs.Upper() - dim + 1, upw=0; Standard_Integer upc = Coefs.Upper() - dim + 1, upw=0;
Standard_Integer len = Coefs.Length()/dim; Standard_Integer len = Coefs.Length()/dim;
Standard_Boolean rat = &WCoefs != NULL; Standard_Boolean rat = WCoefs != NULL;
if (rat) { if (rat) {
if(len != WCoefs.Length()) if(len != WCoefs->Length())
Standard_Failure::Raise("PLib::Trimming : nbcoefs/dim != nbweights !!!"); Standard_Failure::Raise("PLib::Trimming : nbcoefs/dim != nbweights !!!");
upw = WCoefs.Upper(); upw = WCoefs->Upper();
} }
len --; len --;
@ -1526,7 +1526,7 @@ void PLib::Trimming(const Standard_Real U1,
for( j = 0; j < dim; j++){ for( j = 0; j < dim; j++){
Coefs(indc - dim + j) += U1 * Coefs(indc + j); Coefs(indc - dim + j) += U1 * Coefs(indc + j);
} }
if (rat) WCoefs(indw - 1) += U1 * WCoefs(indw); if (rat) (*WCoefs)(indw - 1) += U1 * (*WCoefs)(indw);
//calcul des coefficients intermediaires : //calcul des coefficients intermediaires :
@ -1539,7 +1539,7 @@ void PLib::Trimming(const Standard_Real U1,
} }
if (rat) { if (rat) {
indw ++; indw ++;
WCoefs(indw - 1) = U1 * WCoefs(indw) + lsp * WCoefs(indw - 1); (*WCoefs)(indw - 1) = U1 * (*WCoefs)(indw) + lsp * (*WCoefs)(indw - 1);
} }
} }
@ -1548,7 +1548,7 @@ void PLib::Trimming(const Standard_Real U1,
for(j = 0; j < dim; j++){ for(j = 0; j < dim; j++){
Coefs(upc + j) *= lsp; Coefs(upc + j) *= lsp;
} }
if (rat) WCoefs(upw) *= lsp; if (rat) (*WCoefs)(upw) *= lsp;
} }
} }
@ -1561,11 +1561,11 @@ void PLib::Trimming(const Standard_Real U1,
//======================================================================= //=======================================================================
void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs, void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
const TColStd_Array2OfReal& WCoefs, const TColStd_Array2OfReal* WCoefs,
TColgp_Array2OfPnt& Poles, TColgp_Array2OfPnt& Poles,
TColStd_Array2OfReal& Weights) TColStd_Array2OfReal* Weights)
{ {
Standard_Boolean rat = (&WCoefs != NULL); Standard_Boolean rat = (WCoefs != NULL);
Standard_Integer LowerRow = Poles.LowerRow(); Standard_Integer LowerRow = Poles.LowerRow();
Standard_Integer UpperRow = Poles.UpperRow(); Standard_Integer UpperRow = Poles.UpperRow();
Standard_Integer LowerCol = Poles.LowerCol(); Standard_Integer LowerCol = Poles.LowerCol();
@ -1587,7 +1587,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){ for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){
Poles (NPoleu, LowerCol) = Coefs (NPoleu, LowerCol); Poles (NPoleu, LowerCol) = Coefs (NPoleu, LowerCol);
if (rat) { if (rat) {
Weights (NPoleu, LowerCol) = WCoefs (NPoleu, LowerCol); (*Weights) (NPoleu, LowerCol) = (*WCoefs) (NPoleu, LowerCol);
} }
for (Col = LowerCol + 1; Col <= UpperCol - 1; Col++) { for (Col = LowerCol + 1; Col <= UpperCol - 1; Col++) {
@ -1596,12 +1596,12 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
Temp.Divide (Cnp); Temp.Divide (Cnp);
Poles (NPoleu, Col).SetXYZ (Temp); Poles (NPoleu, Col).SetXYZ (Temp);
if (rat) { if (rat) {
Weights (NPoleu, Col) = WCoefs (NPoleu, Col) / Cnp; (*Weights) (NPoleu, Col) = (*WCoefs) (NPoleu, Col) / Cnp;
} }
} }
Poles (NPoleu, UpperCol) = Coefs (NPoleu, UpperCol); Poles (NPoleu, UpperCol) = Coefs (NPoleu, UpperCol);
if (rat) { if (rat) {
Weights (NPoleu, UpperCol) = WCoefs (NPoleu, UpperCol); (*Weights) (NPoleu, UpperCol) = (*WCoefs) (NPoleu, UpperCol);
} }
for (I1 = 1; I1 <= RowLength - 1; I1++) { for (I1 = 1; I1 <= RowLength - 1; I1++) {
@ -1610,7 +1610,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
Temp.SetLinearForm Temp.SetLinearForm
(Poles (NPoleu, I2).XYZ(), Poles (NPoleu, I2-1).XYZ()); (Poles (NPoleu, I2).XYZ(), Poles (NPoleu, I2-1).XYZ());
Poles (NPoleu, I2).SetXYZ (Temp); Poles (NPoleu, I2).SetXYZ (Temp);
if (rat) Weights(NPoleu, I2) += Weights(NPoleu, I2-1); if (rat) (*Weights)(NPoleu, I2) += (*Weights)(NPoleu, I2-1);
} }
} }
} }
@ -1622,7 +1622,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
Temp = Poles (Row, NPolev).XYZ(); Temp = Poles (Row, NPolev).XYZ();
Temp.Divide (Cnp); Temp.Divide (Cnp);
Poles (Row, NPolev).SetXYZ (Temp); Poles (Row, NPolev).SetXYZ (Temp);
if (rat) Weights(Row, NPolev) /= Cnp; if (rat) (*Weights)(Row, NPolev) /= Cnp;
} }
for (I1 = 1; I1 <= ColLength - 1; I1++) { for (I1 = 1; I1 <= ColLength - 1; I1++) {
@ -1631,7 +1631,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
Temp.SetLinearForm Temp.SetLinearForm
(Poles (I2, NPolev).XYZ(), Poles (I2-1, NPolev).XYZ()); (Poles (I2, NPolev).XYZ(), Poles (I2-1, NPolev).XYZ());
Poles (I2, NPolev).SetXYZ (Temp); Poles (I2, NPolev).SetXYZ (Temp);
if (rat) Weights(I2, NPolev) += Weights(I2-1, NPolev); if (rat) (*Weights)(I2, NPolev) += (*Weights)(I2-1, NPolev);
} }
} }
} }
@ -1640,7 +1640,7 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
for (Row = LowerRow; Row <= UpperRow; Row++) { for (Row = LowerRow; Row <= UpperRow; Row++) {
for (Col = LowerCol; Col <= UpperCol; Col++) { for (Col = LowerCol; Col <= UpperCol; Col++) {
W = Weights (Row, Col); W = (*Weights) (Row, Col);
Temp = Poles(Row, Col).XYZ(); Temp = Poles(Row, Col).XYZ();
Temp.Divide (W); Temp.Divide (W);
Poles(Row, Col).SetXYZ (Temp); Poles(Row, Col).SetXYZ (Temp);
@ -1657,9 +1657,9 @@ void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
void PLib::UTrimming(const Standard_Real U1, void PLib::UTrimming(const Standard_Real U1,
const Standard_Real U2, const Standard_Real U2,
TColgp_Array2OfPnt& Coeffs, TColgp_Array2OfPnt& Coeffs,
TColStd_Array2OfReal& WCoeffs) TColStd_Array2OfReal* WCoeffs)
{ {
Standard_Boolean rat = &WCoeffs != NULL; Standard_Boolean rat = WCoeffs != NULL;
Standard_Integer lr = Coeffs.LowerRow(); Standard_Integer lr = Coeffs.LowerRow();
Standard_Integer ur = Coeffs.UpperRow(); Standard_Integer ur = Coeffs.UpperRow();
Standard_Integer lc = Coeffs.LowerCol(); Standard_Integer lc = Coeffs.LowerCol();
@ -1671,14 +1671,14 @@ void PLib::UTrimming(const Standard_Real U1,
Standard_Integer irow ; Standard_Integer irow ;
for ( irow = lr; irow <= ur; irow++) { for ( irow = lr; irow <= ur; irow++) {
Temp (irow) = Coeffs (irow, icol); Temp (irow) = Coeffs (irow, icol);
if (rat) Temw (irow) = WCoeffs (irow, icol); if (rat) Temw (irow) = (*WCoeffs) (irow, icol);
} }
if (rat) PLib::Trimming (U1, U2, Temp, Temw); if (rat) PLib::Trimming (U1, U2, Temp, &Temw);
else PLib::Trimming (U1, U2, Temp, PLib::NoWeights()); else PLib::Trimming (U1, U2, Temp, PLib::NoWeights());
for (irow = lr; irow <= ur; irow++) { for (irow = lr; irow <= ur; irow++) {
Coeffs (irow, icol) = Temp (irow); Coeffs (irow, icol) = Temp (irow);
if (rat) WCoeffs (irow, icol) = Temw (irow); if (rat) (*WCoeffs) (irow, icol) = Temw (irow);
} }
} }
} }
@ -1691,9 +1691,9 @@ void PLib::UTrimming(const Standard_Real U1,
void PLib::VTrimming(const Standard_Real V1, void PLib::VTrimming(const Standard_Real V1,
const Standard_Real V2, const Standard_Real V2,
TColgp_Array2OfPnt& Coeffs, TColgp_Array2OfPnt& Coeffs,
TColStd_Array2OfReal& WCoeffs) TColStd_Array2OfReal* WCoeffs)
{ {
Standard_Boolean rat = &WCoeffs != NULL; Standard_Boolean rat = WCoeffs != NULL;
Standard_Integer lr = Coeffs.LowerRow(); Standard_Integer lr = Coeffs.LowerRow();
Standard_Integer ur = Coeffs.UpperRow(); Standard_Integer ur = Coeffs.UpperRow();
Standard_Integer lc = Coeffs.LowerCol(); Standard_Integer lc = Coeffs.LowerCol();
@ -1705,14 +1705,14 @@ void PLib::VTrimming(const Standard_Real V1,
Standard_Integer icol ; Standard_Integer icol ;
for ( icol = lc; icol <= uc; icol++) { for ( icol = lc; icol <= uc; icol++) {
Temp (icol) = Coeffs (irow, icol); Temp (icol) = Coeffs (irow, icol);
if (rat) Temw (icol) = WCoeffs (irow, icol); if (rat) Temw (icol) = (*WCoeffs) (irow, icol);
} }
if (rat) PLib::Trimming (V1, V2, Temp, Temw); if (rat) PLib::Trimming (V1, V2, Temp, &Temw);
else PLib::Trimming (V1, V2, Temp, PLib::NoWeights()); else PLib::Trimming (V1, V2, Temp, PLib::NoWeights());
for (icol = lc; icol <= uc; icol++) { for (icol = lc; icol <= uc; icol++) {
Coeffs (irow, icol) = Temp (icol); Coeffs (irow, icol) = Temp (icol);
if (rat) WCoeffs (irow, icol) = Temw (icol); if (rat) (*WCoeffs) (irow, icol) = Temw (icol);
} }
} }
} }

View File

@ -40,6 +40,9 @@ class PLib_DoubleJacobiPolynomial;
//! PLib means Polynomial functions library. This pk //! PLib means Polynomial functions library. This pk
//! provides basic computation functions for //! provides basic computation functions for
//! polynomial functions. //! polynomial functions.
//! Note: weight arrays can be passed by pointer for
//! some functions so that NULL pointer is valid.
//! That means no weights passed.
class PLib class PLib
{ {
public: public:
@ -48,11 +51,17 @@ public:
//! Used as argument for a non rational functions //! Used as argument for a non rational functions
static TColStd_Array1OfReal& NoWeights(); inline static TColStd_Array1OfReal* NoWeights()
{
return NULL;
}
//! Used as argument for a non rational functions //! Used as argument for a non rational functions
static TColStd_Array2OfReal& NoWeights2(); inline static TColStd_Array2OfReal* NoWeights2()
{
return NULL;
}
//! Copy in FP the coordinates of the poles. //! Copy in FP the coordinates of the poles.
Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& FP); Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& FP);
@ -272,27 +281,27 @@ public:
//! / (|FirstParameter| +|LastParameter|) < 1/100 //! / (|FirstParameter| +|LastParameter|) < 1/100
Standard_EXPORT static Standard_Boolean HermiteCoefficients (const Standard_Real FirstParameter, const Standard_Real LastParameter, const Standard_Integer FirstOrder, const Standard_Integer LastOrder, math_Matrix& MatrixCoefs); Standard_EXPORT static Standard_Boolean HermiteCoefficients (const Standard_Real FirstParameter, const Standard_Real LastParameter, const Standard_Integer FirstOrder, const Standard_Integer LastOrder, math_Matrix& MatrixCoefs);
Standard_EXPORT static void CoefficientsPoles (const TColgp_Array1OfPnt& Coefs, const TColStd_Array1OfReal& WCoefs, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& WPoles); Standard_EXPORT static void CoefficientsPoles (const TColgp_Array1OfPnt& Coefs, const TColStd_Array1OfReal* WCoefs, TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal* WPoles);
Standard_EXPORT static void CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs, const TColStd_Array1OfReal& WCoefs, TColgp_Array1OfPnt2d& Poles, TColStd_Array1OfReal& WPoles); Standard_EXPORT static void CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs, const TColStd_Array1OfReal* WCoefs, TColgp_Array1OfPnt2d& Poles, TColStd_Array1OfReal* WPoles);
Standard_EXPORT static void CoefficientsPoles (const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal& WCoefs, TColStd_Array1OfReal& Poles, TColStd_Array1OfReal& WPoles); Standard_EXPORT static void CoefficientsPoles (const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal* WCoefs, TColStd_Array1OfReal& Poles, TColStd_Array1OfReal* WPoles);
Standard_EXPORT static void CoefficientsPoles (const Standard_Integer dim, const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal& WCoefs, TColStd_Array1OfReal& Poles, TColStd_Array1OfReal& WPoles); Standard_EXPORT static void CoefficientsPoles (const Standard_Integer dim, const TColStd_Array1OfReal& Coefs, const TColStd_Array1OfReal* WCoefs, TColStd_Array1OfReal& Poles, TColStd_Array1OfReal* WPoles);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array1OfPnt& Coeffs, TColStd_Array1OfReal& WCoeffs); Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array1OfPnt& Coeffs, TColStd_Array1OfReal* WCoeffs);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array1OfPnt2d& Coeffs, TColStd_Array1OfReal& WCoeffs); Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array1OfPnt2d& Coeffs, TColStd_Array1OfReal* WCoeffs);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& Coeffs, TColStd_Array1OfReal& WCoeffs); Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, TColStd_Array1OfReal& Coeffs, TColStd_Array1OfReal* WCoeffs);
Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, const Standard_Integer dim, TColStd_Array1OfReal& Coeffs, TColStd_Array1OfReal& WCoeffs); Standard_EXPORT static void Trimming (const Standard_Real U1, const Standard_Real U2, const Standard_Integer dim, TColStd_Array1OfReal& Coeffs, TColStd_Array1OfReal* WCoeffs);
Standard_EXPORT static void CoefficientsPoles (const TColgp_Array2OfPnt& Coefs, const TColStd_Array2OfReal& WCoefs, TColgp_Array2OfPnt& Poles, TColStd_Array2OfReal& WPoles); Standard_EXPORT static void CoefficientsPoles (const TColgp_Array2OfPnt& Coefs, const TColStd_Array2OfReal* WCoefs, TColgp_Array2OfPnt& Poles, TColStd_Array2OfReal* WPoles);
Standard_EXPORT static void UTrimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array2OfPnt& Coeffs, TColStd_Array2OfReal& WCoeffs); Standard_EXPORT static void UTrimming (const Standard_Real U1, const Standard_Real U2, TColgp_Array2OfPnt& Coeffs, TColStd_Array2OfReal* WCoeffs);
Standard_EXPORT static void VTrimming (const Standard_Real V1, const Standard_Real V2, TColgp_Array2OfPnt& Coeffs, TColStd_Array2OfReal& WCoeffs); Standard_EXPORT static void VTrimming (const Standard_Real V1, const Standard_Real V2, TColgp_Array2OfPnt& Coeffs, TColStd_Array2OfReal* WCoeffs);
//! Compute the coefficients in the canonical base of the //! Compute the coefficients in the canonical base of the
//! polynomial satisfying the given constraints //! polynomial satisfying the given constraints
@ -349,11 +358,4 @@ friend class PLib_DoubleJacobiPolynomial;
}; };
#include <PLib.lxx>
#endif // _PLib_HeaderFile #endif // _PLib_HeaderFile

View File

@ -1,25 +0,0 @@
// Created on: 1995-09-01
// Created by: Laurent BOURESCHE
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
inline TColStd_Array1OfReal& PLib::NoWeights()
{
return (*((TColStd_Array1OfReal*) NULL ));
}
inline TColStd_Array2OfReal& PLib::NoWeights2()
{
return (*((TColStd_Array2OfReal*) NULL ));
}

View File

@ -1839,8 +1839,8 @@ Handle(Geom2d_BSplineCurve)
Standard_Integer Inc = MaxDeg - MC.Degree(); Standard_Integer Inc = MaxDeg - MC.Degree();
if ( Inc > 0) { if ( Inc > 0) {
// BSplCLib::IncreaseDegree( Inc, Poles2d, PLib::NoWeights(), // BSplCLib::IncreaseDegree( Inc, Poles2d, PLib::NoWeights(),
BSplCLib::IncreaseDegree( MaxDeg, Poles2d, PLib::NoWeights(), BSplCLib::IncreaseDegree( MaxDeg, Poles2d, BSplCLib::NoWeights(),
TempPoles, PLib::NoWeights()); TempPoles, BSplCLib::NoWeights());
//update of tops of the PCurve //update of tops of the PCurve
for (Standard_Integer k = 1 ; k <= MaxDeg + 1; k++) { for (Standard_Integer k = 1 ; k <= MaxDeg + 1; k++) {
Poles.SetValue( Compt, TempPoles( k)); Poles.SetValue( Compt, TempPoles( k));

View File

@ -349,8 +349,8 @@ static void PerformApprox (const Handle(Adaptor3d_HCurve)& C,
//Augmentation eventuelle du degre //Augmentation eventuelle du degre
Standard_Integer Inc = MaxDeg - MC.Degree(); Standard_Integer Inc = MaxDeg - MC.Degree();
if ( Inc > 0) { if ( Inc > 0) {
BSplCLib::IncreaseDegree(Inc, Poles, PLib::NoWeights(), BSplCLib::IncreaseDegree(Inc, Poles, BSplCLib::NoWeights(),
TempPoles, PLib::NoWeights()); TempPoles, BSplCLib::NoWeights());
//mise a jour des poles de la PCurve //mise a jour des poles de la PCurve
for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) { for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) {
Poles.SetValue( Compt, TempPoles( j)); Poles.SetValue( Compt, TempPoles( j));

View File

@ -207,8 +207,8 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_HCurve)& C,
//Augmentation eventuelle du degre //Augmentation eventuelle du degre
Standard_Integer Inc = MaxDeg - MC.Degree(); Standard_Integer Inc = MaxDeg - MC.Degree();
if ( Inc > 0) { if ( Inc > 0) {
BSplCLib::IncreaseDegree( Inc, LocalPoles, PLib::NoWeights(), BSplCLib::IncreaseDegree( Inc, LocalPoles, BSplCLib::NoWeights(),
TempPoles, PLib::NoWeights()); TempPoles, BSplCLib::NoWeights());
//mise a jour des poles de la PCurve //mise a jour des poles de la PCurve
for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) { for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) {
Poles.SetValue( Compt, TempPoles( j)); Poles.SetValue( Compt, TempPoles( j));

View File

@ -176,8 +176,8 @@ void ShapeConstruct_CompBezierCurves2dToBSplineCurve2d::Perform()
Inc = myDegree - Deg; Inc = myDegree - Deg;
if ( Inc > 0) { if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree, BSplCLib::IncreaseDegree(myDegree,
mySequence(i)->Array1(), PLib::NoWeights(), mySequence(i)->Array1(), BSplCLib::NoWeights(),
Points, PLib::NoWeights()); Points, BSplCLib::NoWeights());
} }
else { else {
Points = mySequence(i)->Array1(); Points = mySequence(i)->Array1();

View File

@ -175,8 +175,8 @@ void ShapeConstruct_CompBezierCurvesToBSplineCurve::Perform()
Inc = myDegree - Deg; Inc = myDegree - Deg;
if ( Inc > 0) { if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree, BSplCLib::IncreaseDegree(myDegree,
mySequence(i)->Array1(), PLib::NoWeights(), mySequence(i)->Array1(), BSplCLib::NoWeights(),
Points, PLib::NoWeights()); Points, BSplCLib::NoWeights());
} }
else { else {
Points = mySequence(i)->Array1(); Points = mySequence(i)->Array1();