Dereferenced null pointers was eliminated for PLib, BSplCLib and BSplSLib. All affected code was changed accordingly.
for (k = 1; k <= nbP3d; k++) {
for (l=1; l<=deg+1; l++) TabCoef(l) = TheCoef(l+i2);
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));
FU += MyV*V1;
DFU += V1.SquareMagnitude();
for (k = 1; k <= nbP2d; k++) {
for (l=1; l<=deg+1; l++) TabCoef2d(l) = TheCoef2d(l+i2);
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));
FU += MyV2d*V12d;
DFU += V12d.SquareMagnitude();
Curve(CuIndex, TabPoles);
BSplCLib::D0(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
- myknots->Array1(),mymults->Array1(),Pt);
+ myknots->Array1(),&mymults->Array1(),Pt);
}
Curve(CuIndex, TabPoles);
BSplCLib::D0(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
- myknots->Array1(),mymults->Array1(),Pt);
+ myknots->Array1(),&mymults->Array1(),Pt);
}
Curve(CuIndex, TabPoles);
BSplCLib::D1(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
- myknots->Array1(),mymults->Array1(),Pt,V1);
+ myknots->Array1(),&mymults->Array1(),Pt,V1);
}
Curve(CuIndex, TabPoles);
BSplCLib::D2(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
- myknots->Array1(),mymults->Array1(),Pt,V1,V2);
+ myknots->Array1(),&mymults->Array1(),Pt,V1,V2);
}
Curve(CuIndex, TabPoles);
BSplCLib::D1(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
- myknots->Array1(),mymults->Array1(),Pt,V1);
+ myknots->Array1(),&mymults->Array1(),Pt,V1);
}
Curve(CuIndex, TabPoles);
BSplCLib::D2(U,0,myDegree,Standard_False,TabPoles,BSplCLib::NoWeights(),
- myknots->Array1(),mymults->Array1(),Pt,V1,V2);
+ myknots->Array1(),&mymults->Array1(),Pt,V1,V2);
}
TabPoles(i) = tabPoint->Value(i).Point(CuIndex);
}
- BSplCLib::D0 (U, TabPoles,PLib::NoWeights(), Pt);
+ BSplCLib::D0 (U, TabPoles,BSplCLib::NoWeights(), Pt);
}
TabPole(i) = tabPoint->Value(i).Point2d(CuIndex);
}
- BSplCLib::D0 (U, TabPole, PLib::NoWeights(), Pt);
+ BSplCLib::D0 (U, TabPole, BSplCLib::NoWeights(), Pt);
}
TabPole(i) = tabPoint->Value(i).Point(CuIndex);
}
- BSplCLib::D1 (U, TabPole, PLib::NoWeights(), Pt, V1);
+ BSplCLib::D1 (U, TabPole, BSplCLib::NoWeights(), Pt, V1);
}
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);
}
TabPole(i) = tabPoint->Value(i).Point2d(CuIndex);
}
- BSplCLib::D1 (U, TabPole, PLib::NoWeights(), Pt, V1);
+ BSplCLib::D1 (U, TabPole, BSplCLib::NoWeights(), Pt, V1);
}
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);
}
Inc = deg-mydegre;
TColgp_Array1OfPnt Points(1, deg+1);
if (Inc > 0) {
- BSplCLib::IncreaseDegree(deg, ThePoles, PLib::NoWeights(),
- Points, PLib::NoWeights());
+ BSplCLib::IncreaseDegree(deg, ThePoles, BSplCLib::NoWeights(),
+ Points, BSplCLib::NoWeights());
}
else {
Points = ThePoles;
Inc = deg-mydegre;
TColgp_Array1OfPnt2d Points2d(1, deg+1);
if (Inc > 0) {
- BSplCLib::IncreaseDegree(deg, ThePoles2d, PLib::NoWeights(),
- Points2d, PLib::NoWeights());
+ BSplCLib::IncreaseDegree(deg, ThePoles2d, BSplCLib::NoWeights(),
+ Points2d, BSplCLib::NoWeights());
}
else {
Points2d = ThePoles2d;
void BSplCLib::LocateParameter
(const Standard_Integer Degree,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
const Standard_Real U,
const Standard_Boolean Periodic,
Standard_Integer& KnotIndex,
Standard_Real& NewU)
{
Standard_Integer first,last;
- if (&Mults) {
+ if (Mults) {
if (Periodic) {
first = Knots.Lower();
last = Knots.Upper();
}
else {
- first = FirstUKnotIndex(Degree,Mults);
- last = LastUKnotIndex (Degree,Mults);
+ first = FirstUKnotIndex(Degree,*Mults);
+ last = LastUKnotIndex (Degree,*Mults);
}
}
else {
const Standard_Integer Index,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Standard_Real& LK)
{
Standard_Integer KLower = Knots.Lower();
const Standard_Real * pkn = &Knots(KLower);
pkn -= KLower;
Standard_Real *knot = &LK;
- if (&Mults == NULL) {
+ if (Mults == NULL) {
switch (Degree) {
case 1 : {
Standard_Integer j = Index ;
Standard_Integer i;
Standard_Integer Deg1 = Degree - 1;
Standard_Integer KUpper = Knots.Upper();
- Standard_Integer MLower = Mults.Lower();
- Standard_Integer MUpper = Mults.Upper();
- const Standard_Integer * pmu = &Mults(MLower);
+ Standard_Integer MLower = Mults->Lower();
+ Standard_Integer MUpper = Mults->Upper();
+ const Standard_Integer * pmu = &(*Mults)(MLower);
pmu -= MLower;
Standard_Real dknot = 0;
Standard_Integer ilow = Index , mlow = 0;
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots,
- const TColStd_Array1OfInteger& AddMults,
+ const TColStd_Array1OfInteger* AddMults,
Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
const Standard_Real Tolerance,
const Standard_Boolean Add)
{
- Standard_Boolean addflat = &AddMults == NULL;
+ Standard_Boolean addflat = AddMults == NULL;
Standard_Integer first,last;
if (Periodic) {
}
if (addflat) amult = 1;
- else amult = Max(0,AddMults(ak));
+ else amult = Max(0,(*AddMults)(ak));
while ((ak < AddKnots.Upper()) &&
(Abs(au - AddKnots(ak+1)) <= Eps)) {
ak++;
if (Add) {
if (addflat) amult++;
- else amult += Max(0,AddMults(ak));
+ else amult += Max(0,(*AddMults)(ak));
}
}
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots,
- const TColStd_Array1OfInteger& AddMults,
+ const TColStd_Array1OfInteger* AddMults,
TColStd_Array1OfReal& NewPoles,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults,
const Standard_Real Tolerance,
const Standard_Boolean Add)
{
- Standard_Boolean addflat = &AddMults == NULL;
+ Standard_Boolean addflat = AddMults == NULL;
Standard_Integer i,k,mult,firstmult;
Standard_Integer index,kn,curnk,curk;
else length = Degree;
if (addflat) depth = 1;
- else depth = Min(Degree,AddMults(kn));
+ else depth = Min(Degree,(*AddMults)(kn));
if (sameknot) {
if (Add) {
}
if (depth <= 0) continue;
- BuildKnots(Degree,curnk,Periodic,nknots,nmults,*knots);
+ BuildKnots(Degree,curnk,Periodic,nknots,&nmults,*knots);
// copy the poles
length = Degree - NewMults(curnk);
depth = firstmult;
- BuildKnots(Degree,curnk,Periodic,NewKnots,NewMults,*knots);
+ BuildKnots(Degree,curnk,Periodic,NewKnots,&NewMults,*knots);
TColStd_Array1OfReal npoles(NewPoles(NewPoles.Lower()),
NewPoles.Lower(),
NewPoles.Upper()-depth*Dimension);
// the new sequence of knots
// 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);
- BSplCLib::BuildKnots(Degree,TheIndex,Periodic,Knots,Mults,knots[2*Degree]);
+ BSplCLib::BuildKnots(Degree,TheIndex,Periodic,Knots,&Mults,knots[2*Degree]);
index += Mult;
K(1) = U1; K(2) = U2;
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))
Standard_OutOfRange::Raise();
// do not allow the multiplicities to Add : they must be less than Degree
//
InsertKnots(Degree, Periodic, Dimension, Poles, Knots, Mults,
- K, M, TempPoles, TempKnots, TempMults, Epsilon(U1),
+ K, &M, TempPoles, TempKnots, TempMults, Epsilon(U1),
Standard_False);
// find in TempPoles the index of the pole corresponding to U1
TColStd_Array1OfReal ExtrapPoles(1,Csize*CDimension);
Standard_Real * EPadr = &ExtrapPoles(1) ;
PLib::CoefficientsPoles(CDimension,
- ExtraCoeffs, PLib::NoWeights(),
- ExtrapPoles, PLib::NoWeights());
+ ExtraCoeffs, PLib::NoWeights(),
+ ExtrapPoles, PLib::NoWeights());
// calculate the nodes of extension with multiplicities
TColStd_Array1OfReal ExtrapNoeuds(1,2);
void BSplCLib::Resolution( Standard_Real& Poles,
const Standard_Integer ArrayDimension,
const Standard_Integer NumPoles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer Degree,
const Standard_Real Tolerance3D,
num_poles = FlatKnots.Length() - Deg1;
switch (ArrayDimension) {
case 2 : {
- if (&Weights != NULL) {
- const Standard_Real * WG = &Weights(Weights.Lower());
+ if (Weights != NULL) {
+ const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) {
break;
}
case 3 : {
- if (&Weights != NULL) {
- const Standard_Real * WG = &Weights(Weights.Lower());
+ if (Weights != NULL) {
+ const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) {
break;
}
case 4 : {
- if (&Weights != NULL) {
- const Standard_Real * WG = &Weights(Weights.Lower());
+ if (Weights != NULL) {
+ const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) {
}
default : {
Standard_Integer kk;
- if (&Weights != NULL) {
- const Standard_Real * WG = &Weights(Weights.Lower());
+ if (Weights != NULL) {
+ const Standard_Real * WG = &(*Weights)(Weights->Lower());
min_weights = WG[0];
for (ii = 1 ; ii < NumPoles ; ii++) {
//! The bounds of Poles and Weights should be the same.
//! The bounds of Knots and Mults should be the same.
//!
-//! Weights can be a null reference (BSplCLib::NoWeights())
-//! the curve is non rational.
+//! 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.
//!
-//! Mults can be a null reference (BSplCLib::NoMults())
-//! the knots are "flat" knots.
+//! No weights (BSplCLib::NoWeights()) means the curve is non rational.
+//! No mults (BSplCLib::NoMults()) means the knots are "flat" knots.
//!
//! KeyWords :
//! B-spline curve, Functions, Library
//! 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 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
//! between K1 and K2. Mults is the multiplicity
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.
- static TColStd_Array1OfReal& NoWeights();
+ static TColStd_Array1OfReal* NoWeights();
//! Used as argument for a flatknots evaluation.
- static TColStd_Array1OfInteger& NoMults();
+ static TColStd_Array1OfInteger* NoMults();
//! Stores in LK the usefull knots for the BoorSchem
//! 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
//! span Mults(Index) - Mults(Index+1). This index
//! 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 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
//! 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.
//! Starting from <Index> * <Dimension>, copy
//! Return False if :
//! The knew knots are knot increasing.
//! 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
//! multiplicities <AddMults>. <AddKnots> must be a non
//! When all the new knots are existing knots, i.e. only the
//! multiplicities will change it is safe to use the same
//! 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
//! knot sequence.
//!
//! The new control points corresponding to this insertion are
//! 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>.
//!
//! The new control points are returned. Knots and Mults are
//! 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 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)>
//! to <Mult>. If <Mult> is null the knot is
//!
//! A high tolerance can be used to "smooth" the
//! 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
//! multiplicities <Mults> after elevating the degree from
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
//! of dimension <Dimension> form <Degree> to
//!
//! The method IncreaseDegreeCountKnots can be used to
//! 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
//! Poles of the NotPeriodic Curve identical at the
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
//! Poles of the curve resulting of the trimming of the
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);
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! and then multiplies by the weights
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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
//! the method PolesCoefficients.
//! 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
//! the parameter must be normalized between
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! and then multiplies by the weights
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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
//! the method PolesCoefficients.
//! 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
//! the parameter must be normalized between
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! and then multiplies by the weights
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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
//! the method PolesCoefficients.
//! 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
//! the parameter must be normalized between
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! and then multiplies by the weights
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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
//! the method PolesCoefficients.
//! 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
//! of the Bspline normalized between 0 and 1.
//! If rational computes the homogeneous Taylor expension
//! 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
//! of the Bspline normalized between 0 and 1.
//! If rational computes the homogeneous Taylor expension
//! 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
//! of the Bspline normalized between 0 and 1.
//! 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
//! of the Bspline normalized between 0 and 1.
//! 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);
- 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);
//! evaluation of the Taylor expansion for beziercurves
//! at parameter 0.
//! 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
//! flat knots for bezier curve of the specified degree.
//! all u1 and u0 in the domain of the curve f(u)
//! | u1 - u0 | < UTolerance and
//! 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
//! all u1 and u0 in the domain of the curve f(u)
//! | u1 - u0 | < UTolerance and
//! 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
//! all u1 and u0 in the domain of the curve f(u)
//! | u1 - u0 | < UTolerance and
//! 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);
//purpose :
//=======================================================================
-inline TColStd_Array1OfReal& BSplCLib::NoWeights()
+inline TColStd_Array1OfReal* BSplCLib::NoWeights()
{
- return (*((TColStd_Array1OfReal*) NULL));
+ return NULL;
}
//=======================================================================
//purpose :
//=======================================================================
-inline TColStd_Array1OfInteger& BSplCLib::NoMults()
+inline TColStd_Array1OfInteger* BSplCLib::NoMults()
{
- return (*((TColStd_Array1OfInteger*) NULL));
+ return NULL;
}
//=======================================================================
inline void BSplCLib::CoefsD0(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P)
{
BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P);
inline void BSplCLib::CoefsD0(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P)
{
BSplCLib::CacheD0(U, Poles.Length() -1, 0., 1., Poles, Weights, P);
inline void BSplCLib::CoefsD1(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P,
gp_Vec& Vec)
{
inline void BSplCLib::CoefsD1(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P,
gp_Vec2d& Vec)
{
inline void BSplCLib::CoefsD2(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P,
gp_Vec& Vec1,
gp_Vec& Vec2)
inline void BSplCLib::CoefsD2(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P,
gp_Vec2d& Vec1,
gp_Vec2d& Vec2)
inline void BSplCLib::CoefsD3(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P,
gp_Vec& Vec1,
gp_Vec& Vec2,
inline void BSplCLib::CoefsD3(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P,
gp_Vec2d& Vec1,
gp_Vec2d& Vec2,
void BSplCLib::BuildEval(const Standard_Integer Degree,
const Standard_Integer Index,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
Standard_Real& LP)
{
Standard_Integer PLower = Poles.Lower();
Standard_Integer i;
Standard_Integer ip = PLower + Index - 1;
Standard_Real w, *pole = &LP;
- if (&Weights == NULL) {
+ if (Weights == NULL) {
for (i = 0; i <= Degree; i++) {
ip++;
for (i = 0; i <= Degree; i++) {
ip++;
if (ip > PUpper) ip = PLower;
- pole[1] = w = Weights(ip);
+ pole[1] = w = (*Weights)(ip);
pole[0] = Poles(ip) * w;
pole += 2;
}
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
BSplCLib_DataContainer& dc)
{
// Set the Index
// make the knots
BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots);
- if (&Mults == NULL)
+ if (Mults == NULL)
index -= Knots.Lower() + Degree;
else
- index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults);
+ index = BSplCLib::PoleIndex(Degree,index,Periodic,*Mults);
// check truly rational
- rational = (&Weights != NULL);
+ rational = (Weights != NULL);
if (rational) {
- Standard_Integer WLower = Weights.Lower() + index;
- rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree);
+ Standard_Integer WLower = Weights->Lower() + index;
+ rational = BSplCLib::IsRational(*Weights, WLower, WLower + Degree);
}
// make the poles
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Standard_Real& P)
{
Standard_Integer dim,index = Index;
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Standard_Real& P,
Standard_Real& V)
{
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Standard_Real& P,
Standard_Real& V1,
Standard_Real& V2)
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Standard_Real& P,
Standard_Real& V1,
Standard_Real& V2,
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColStd_Array1OfReal& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Standard_Real& VN)
{
Standard_Integer dim,index = Index;
void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt& NewPoles,
- TColStd_Array1OfReal& NewWeights)
+ TColStd_Array1OfReal* NewWeights)
{
Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg);
void BSplCLib::IncreaseDegree(const Standard_Integer NewDegree,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt2d& NewPoles,
- TColStd_Array1OfReal& NewWeights)
+ TColStd_Array1OfReal* NewWeights)
{
Standard_Integer deg = Poles.Length() - 1;
BSplCLib_BezierArrays bzarr(deg);
//=======================================================================
void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt& CachePoles,
- TColStd_Array1OfReal& CacheWeights)
+ TColStd_Array1OfReal* CacheWeights)
{
Standard_Integer deg = Poles.Length() - 1;
TColStd_Array1OfReal bidflatknots (FlatBezierKnots(deg), 1, 2*(deg+1));
//=======================================================================
void BSplCLib::PolesCoefficients(const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
TColgp_Array1OfPnt2d& CachePoles,
- TColStd_Array1OfReal& CacheWeights)
+ TColStd_Array1OfReal* CacheWeights)
{
Standard_Integer deg = Poles.Length() - 1;
TColStd_Array1OfReal bidflatknots (FlatBezierKnots(deg), 1, 2*(deg+1));
void BSplCLib::D0(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P)
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
//=======================================================================
void BSplCLib::D0(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P)
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
//=======================================================================
void BSplCLib::D1(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P,
gp_Vec& V)
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
//=======================================================================
void BSplCLib::D1(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P,
gp_Vec2d& V)
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
void BSplCLib::D2(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2)
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
//=======================================================================
void BSplCLib::D2(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2)
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
void BSplCLib::D3(const Standard_Real U,
const TColgp_Array1OfPnt& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
void BSplCLib::D3(const Standard_Real U,
const TColgp_Array1OfPnt2d& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
gp_Pnt2d& P,
gp_Vec2d& V1,
gp_Vec2d& V2,
{
Standard_Integer deg = Poles.Length() - 1;
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);
}
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d,
- const TColStd_Array1OfReal& theWeights)
+ const TColStd_Array1OfReal* theWeights)
{
Standard_Real aCacheParam = theFlatKnots.Value(theFlatKnots.Lower() + theDegree);
BuildCache(aCacheParam, theDegree, thePeriodic,
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt& thePoles,
- const TColStd_Array1OfReal& theWeights)
+ const TColStd_Array1OfReal* theWeights)
{
Standard_Real aCacheParam = theFlatKnots.Value(theFlatKnots.Lower() + theDegree);
BuildCache(aCacheParam, theDegree, thePeriodic,
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d,
- const TColStd_Array1OfReal& theWeights)
+ const TColStd_Array1OfReal* theWeights)
{
// Normalize theParameter for periodical B-splines
Standard_Real aNewParam = theParameter;
myFlatKnots.Nullify();
// Change the size of cached data if needed
- myIsRational = (&theWeights != NULL);
+ myIsRational = (theWeights != NULL);
Standard_Integer aPWColNumber = myIsRational ? 3 : 2;
if (theDegree > myDegree)
myPolesWeights = new TColStd_HArray2OfReal(1, theDegree + 1, 1, aPWColNumber);
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
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
Standard_Real aNewParam = theParameter;
myFlatKnots.Nullify();
// Change the size of cached data if needed
- myIsRational = (&theWeights != NULL);
+ myIsRational = (theWeights != NULL);
Standard_Integer aPWColNumber = myIsRational ? 4 : 3;
if (theDegree > myDegree)
myPolesWeights = new TColStd_HArray2OfReal(1, theDegree + 1, 1, aPWColNumber);
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
-#ifndef NOWEIGHTS_CURVE
-#define NOWEIGHTS_CURVE (*((TColStd_Array1OfReal*) NULL))
-#endif
-
//! \brief A cache class for B-spline curves.
//!
//! Defines all data, that can be cached on a span of B-spline curve.
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
const TColgp_Array1OfPnt2d& thePoles2d,
- const TColStd_Array1OfReal& theWeights = NOWEIGHTS_CURVE);
+ const TColStd_Array1OfReal* theWeights = NULL);
//! Constructor for caching of 3D curves
//! \param theDegree degree of the B-spline
//! \param thePeriodic identify the B-spline is periodic
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
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
//! \param theParameter parameter of the point placed in the span
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
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
//! \param theParameter the value on the knot's axis to identify the span
//! \param theDegree degree of the B-spline
const Standard_Boolean& thePeriodic,
const TColStd_Array1OfReal& theFlatKnots,
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
//! \param[in] theParameter parameter of calculation of the value
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights,
+ TColStd_Array1OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults,
const Standard_Real Tolerance)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim;
dim = Dimension_gen;
if (rational) dim++;
TColStd_Array1OfReal poles(1,dim*Poles.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);
if (!RemoveKnot(Index,Mult,Degree,Periodic,dim,
poles,Knots,Mults,newpoles,NewKnots,NewMults,Tolerance))
return Standard_False;
- if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights);
+ if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles);
return Standard_True;
}
(const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots,
- const TColStd_Array1OfInteger& AddMults,
+ const TColStd_Array1OfInteger* AddMults,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights,
+ TColStd_Array1OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults,
const Standard_Real Epsilon,
const Standard_Boolean Add)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim;
dim = Dimension_gen;
if (rational) dim++;
TColStd_Array1OfReal poles(1,dim*Poles.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);
InsertKnots(Degree,Periodic,dim,poles,Knots,Mults,
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);
}
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights)
+ TColStd_Array1OfReal* NewWeights)
{
TColStd_Array1OfReal k(1,1);
k(1) = U;
TColStd_Array1OfReal nk(1,Knots.Length()+1);
TColStd_Array1OfInteger nm(1,Knots.Length()+1);
InsertKnots(Degree,Periodic,Poles,Weights,Knots,Mults,
- k,m,NewPoles,NewWeights,nk,nm,Epsilon(U));
+ k,&m,NewPoles,NewWeights,nk,nm,Epsilon(U));
}
//=======================================================================
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights)
+ TColStd_Array1OfReal* NewWeights)
{
TColStd_Array1OfReal k(1,1);
k(1) = Knots(KnotIndex);
TColStd_Array1OfReal nk(1,Knots.Length());
TColStd_Array1OfInteger nm(1,Knots.Length());
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)));
}
//=======================================================================
const Standard_Integer NewDegree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights,
+ TColStd_Array1OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim;
dim = Dimension_gen;
if (rational) dim++;
TColStd_Array1OfReal poles(1,dim*Poles.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);
IncreaseDegree(Degree,NewDegree,Periodic,dim,poles,Knots,Mults,
newpoles,NewKnots,NewMults);
- if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights);
+ if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles);
}
const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& Knots,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
TColStd_Array1OfInteger& NewMults,
TColStd_Array1OfReal& NewKnots,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights)
+ TColStd_Array1OfReal* NewWeights)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim;
dim = Dimension_gen;
if (rational) dim++;
TColStd_Array1OfReal poles(1,dim*Poles.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);
Unperiodize(Degree, dim, Mults, Knots, poles,
NewMults,NewKnots, newpoles);
- if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights);
+ if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles);
}
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const Standard_Real U1,
const Standard_Real U2,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults,
Array1OfPoints& NewPoles,
- TColStd_Array1OfReal& NewWeights)
+ TColStd_Array1OfReal* NewWeights)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim;
dim = Dimension_gen;
if (rational) dim++;
TColStd_Array1OfReal poles(1,dim*Poles.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);
Trimming(Degree, Periodic, dim, Knots, Mults, poles, U1, U2,
NewKnots, NewMults, newpoles);
- if (rational) PLib::GetPoles(newpoles,NewPoles,NewWeights);
+ if (rational) PLib::GetPoles(newpoles,NewPoles,*NewWeights);
else PLib::GetPoles(newpoles,NewPoles);
}
void BSplCLib::BuildEval(const Standard_Integer Degree,
const Standard_Integer Index,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
Standard_Real& LP)
{
Standard_Real w, *pole = &LP;
Standard_Integer PUpper = Poles.Upper();
Standard_Integer i;
Standard_Integer ip = PLower + Index - 1;
- if (&Weights == NULL) {
+ if (Weights == NULL) {
for (i = 0; i <= Degree; i++) {
ip++;
if (ip > PUpper) ip = PLower;
ip++;
if (ip > PUpper) ip = PLower;
const Point& P = Poles(ip);
- pole[Dimension_gen] = w = Weights(ip);
+ pole[Dimension_gen] = w = (*Weights)(ip);
PointToCoords (pole, P, * w);
pole += Dimension_gen + 1;
}
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
BSplCLib_DataContainer& dc)
{
// Set the Index
// make the knots
BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*dc.knots);
- if (&Mults == NULL)
+ if (Mults == NULL)
index -= Knots.Lower() + Degree;
else
- index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults);
+ index = BSplCLib::PoleIndex(Degree,index,Periodic,*Mults);
// check truly rational
- rational = (&Weights != NULL);
+ rational = (Weights != NULL);
if (rational) {
- Standard_Integer WLower = Weights.Lower() + index;
- rational = BSplCLib::IsRational(Weights, WLower, WLower + Degree);
+ Standard_Integer WLower = Weights->Lower() + index;
+ rational = BSplCLib::IsRational(*Weights, WLower, WLower + Degree);
}
// make the poles
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Point& P)
{
// Standard_Integer k,dim,index = Index;
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Point& P,
Vector& V)
{
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Point& P,
Vector& V1,
Vector& V2)
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Point& P,
Vector& V1,
Vector& V2,
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
Vector& VN)
{
Standard_Integer dim,index = Index;
const Standard_Real CacheParameter,
const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray,
- const TColStd_Array1OfReal& WeightsArray,
+ const TColStd_Array1OfReal* WeightsArray,
Point& aPoint)
{
//
Degree * Dimension_gen,
PArray[0],
myPoint[0]) ;
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
+ const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real *
- WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+ WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::NoDerivativeEvalPolynomial(NewParameter,
Degree,
1,
const Standard_Real CacheParameter,
const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray,
- const TColStd_Array1OfReal& WeightsArray,
+ const TColStd_Array1OfReal* WeightsArray,
Point& aPoint,
Vector& aVector)
{
ModifyCoords (LocalPDerivatives + Dimension_gen, /= SpanLenght);
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
+ const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real *
- WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+ WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::EvalPolynomial(NewParameter,
1,
Degree,
const Standard_Real CacheParameter,
const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray,
- const TColStd_Array1OfReal& WeightsArray,
+ const TColStd_Array1OfReal* WeightsArray,
Point& aPoint,
Vector& aVector1,
Vector& aVector2)
Index += Dimension_gen;
}
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
+ const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real *
- WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+ WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::EvalPolynomial(NewParameter,
2,
const Standard_Real CacheParameter,
const Standard_Real SpanLenght,
const Array1OfPoints& PolesArray,
- const TColStd_Array1OfReal& WeightsArray,
+ const TColStd_Array1OfReal* WeightsArray,
Point& aPoint,
Vector& aVector1,
Vector& aVector2,
Index += Dimension_gen;
}
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
+ const TColStd_Array1OfReal& refWeights = *WeightsArray;
Standard_Real *
- WArray = (Standard_Real *) &WeightsArray(WeightsArray.Lower()) ;
+ WArray = (Standard_Real *) &refWeights(refWeights.Lower()) ;
PLib::EvalPolynomial(NewParameter,
3,
const Standard_Integer Degree,
const TColStd_Array1OfReal& FlatKnots,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
Array1OfPoints& CachePoles,
- TColStd_Array1OfReal& CacheWeights)
+ TColStd_Array1OfReal* CacheWeights)
{
Standard_Integer ii,
Dimension,
LocalIndex = Dimension_gen;
LocalValue = 1.0e0 ;
for (ii = 1 ; ii <= Degree + 1 ; ii++) {
- CacheWeights(ii) = dc.poles[LocalIndex] * LocalValue ;
+ (*CacheWeights)(ii) = dc.poles[LocalIndex] * LocalValue ;
LocalIndex += Dimension_gen + 1;
LocalValue *= SpanDomain / (Standard_Real) ii ;
}
LocalValue *= SpanDomain / (Standard_Real) ii ;
}
- if (&Weights != NULL) {
+ if (Weights != NULL) {
for (ii = 1 ; ii <= Degree + 1 ; ii++)
- CacheWeights(ii) = 0.0e0 ;
- CacheWeights(1) = 1.0e0 ;
+ (*CacheWeights)(ii) = 0.0e0 ;
+ (*CacheWeights)(1) = 1.0e0 ;
}
}
}
const Standard_Integer theDegree,
const TColStd_Array1OfReal& theFlatKnots,
const Array1OfPoints& thePoles,
- const TColStd_Array1OfReal& theWeights,
+ const TColStd_Array1OfReal* theWeights,
TColStd_Array2OfReal& theCacheArray)
{
Standard_Real aParam = theParameter;
//
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);
//=======================================================================
void BSplCLib::Resolution(const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const Standard_Integer NumPoles,
const TColStd_Array1OfReal& FlatKnots,
const Standard_Integer Degree,
const Standard_Boolean UPer,
const Standard_Boolean VPer,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
Standard_Real& u1, // first parameter to use
Standard_Real& u2, // second parameter to use
Standard_Integer& d1, // first degree
BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots1);
BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots2);
- if (&UMults == NULL)
+ if (UMults == NULL)
uindex -= UKLower + UDegree;
else
- uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults);
+ uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,*UMults);
- if (&VMults == NULL)
+ if (VMults == NULL)
vindex -= VKLower + VDegree;
else
- vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults);
+ vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,*VMults);
// get the poles
Standard_Integer i,j,ip,jp;
if(ip < PLowerRow) ip = PUpperRow;
if(jp < PLowerCol) jp = PUpperCol;
- w = Weights.Value(ip,jp);
+ w = Weights->Value(ip,jp);
Standard_Real eps = Epsilon(w);
Standard_Real dw;
for (j = 0; j <= VDegree && !rational; j++)
{
- dw = Weights.Value(ip,jp) - w;
+ dw = Weights->Value(ip,jp) - w;
if (dw < 0)
dw = - dw;
for (j = 0; j <= d2; j++)
{
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[1] = P.Y() * w;
pole[2] = P.Z() * w;
BSplCLib::BuildKnots(UDegree,uindex,UPer,UKnots,UMults,*dc.knots2);
BSplCLib::BuildKnots(VDegree,vindex,VPer,VKnots,VMults,*dc.knots1);
- if (&UMults == NULL)
+ if (UMults == NULL)
uindex -= UKLower + UDegree;
else
- uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,UMults);
+ uindex = BSplCLib::PoleIndex(UDegree,uindex,UPer,*UMults);
- if (&VMults == NULL)
+ if (VMults == NULL)
vindex -= VKLower + VDegree;
else
- vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,VMults);
+ vindex = BSplCLib::PoleIndex(VDegree,vindex,VPer,*VMults);
// get the poles
Standard_Integer i,j,ip,jp;
if(jp < PLowerCol)
jp = PUpperCol;
- w = Weights.Value(ip,jp);
+ w = Weights->Value(ip,jp);
Standard_Real eps = Epsilon(w);
Standard_Real dw;
for (j = 0; j <= VDegree && !rational; j++)
{
- dw = Weights.Value(ip,jp) - w;
+ dw = Weights->Value(ip,jp) - w;
if (dw < 0) dw = - dw;
rational = dw > eps;
for (j = 0; j <= d2; j++)
{
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[1] = P.Y() * w;
pole[2] = P.Z() * w;
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
const Standard_Integer UIndex,
const Standard_Integer VIndex,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
- const TColStd_Array1OfInteger& UMults,
- const TColStd_Array1OfInteger& VMults,
+ const TColStd_Array1OfInteger* UMults,
+ const TColStd_Array1OfInteger* VMults,
const Standard_Integer UDegree,
const Standard_Integer VDegree,
const Standard_Boolean URat,
void BSplSLib::Iso(const Standard_Real Param,
const Standard_Boolean IsU,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots,
- const TColStd_Array1OfInteger& Mults,
+ const TColStd_Array1OfInteger* Mults,
const Standard_Integer Degree,
const Standard_Boolean Periodic,
TColgp_Array1OfPnt& CPoles,
- TColStd_Array1OfReal& CWeights)
+ TColStd_Array1OfReal* CWeights)
{
Standard_Integer index = 0;
Standard_Real u = Param;
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = rational ? 4 : 3;
// compute local knots
NCollection_LocalArray<Standard_Real> locknots1 (2*Degree);
BSplCLib::LocateParameter(Degree,Knots,Mults,u,Periodic,index,u);
BSplCLib::BuildKnots(Degree,index,Periodic,Knots,Mults,*locknots1);
- if (&Mults == NULL)
+ if (Mults == NULL)
index -= Knots.Lower() + Degree;
else
- index = BSplCLib::PoleIndex(Degree,index,Periodic,Mults);
+ index = BSplCLib::PoleIndex(Degree,index,Periodic,*Mults);
// copy the local poles
const gp_Pnt& P = IsU ? Poles(index,j) : Poles(j,index);
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[1] = P.Y() * w;
pole[2] = P.Z() * w;
for (i = CPoles.Lower(); i <= CPoles.Upper(); i++) {
gp_Pnt& P = CPoles(i);
if (rational) {
- CWeights(i) = w = pole[3];
+ (*CWeights)(i) = w = pole[3];
P.SetX( pole[0] / w);
P.SetY( pole[1] / w);
P.SetZ( pole[2] / w);
}
// 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++)
- CWeights(i) = 1.;
+ for (i = CWeights->Lower(); i <= CWeights->Upper(); i++)
+ (*CWeights)(i) = 1.;
}
}
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& AddKnots,
- const TColStd_Array1OfInteger& AddMults,
+ const TColStd_Array1OfInteger* AddMults,
TColgp_Array2OfPnt& NewPoles,
- TColStd_Array2OfReal& NewWeights,
+ TColStd_Array2OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults,
const Standard_Real Epsilon,
const Standard_Boolean Add )
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3;
if (rational) dim++;
TColStd_Array1OfReal
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);
if (UDirection) {
AddKnots,AddMults,newpoles,NewKnots,NewMults,
Epsilon,Add);
- if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection);
+ if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection);
}
const Standard_Integer Degree,
const Standard_Boolean Periodic,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
TColgp_Array2OfPnt& NewPoles,
- TColStd_Array2OfReal& NewWeights,
+ TColStd_Array2OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults,
const Standard_Real Tolerance)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3;
if (rational) dim++;
TColStd_Array1OfReal
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);
if (UDirection) {
Tolerance))
return Standard_False;
- if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection);
+ if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection);
return Standard_True;
}
const Standard_Integer NewDegree,
const Standard_Boolean Periodic,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& Knots,
const TColStd_Array1OfInteger& Mults,
TColgp_Array2OfPnt& NewPoles,
- TColStd_Array2OfReal& NewWeights,
+ TColStd_Array2OfReal* NewWeights,
TColStd_Array1OfReal& NewKnots,
TColStd_Array1OfInteger& NewMults)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3;
if (rational) dim++;
TColStd_Array1OfReal
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);
if (UDirection) {
BSplCLib::IncreaseDegree(Degree,NewDegree,Periodic,dim,poles,Knots,Mults,
newpoles,NewKnots,NewMults);
- if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection);
+ if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection);
}
const TColStd_Array1OfInteger& Mults,
const TColStd_Array1OfReal& Knots,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
TColStd_Array1OfInteger& NewMults,
TColStd_Array1OfReal& NewKnots,
TColgp_Array2OfPnt& NewPoles,
- TColStd_Array2OfReal& NewWeights)
+ TColStd_Array2OfReal* NewWeights)
{
- Standard_Boolean rational = &Weights != NULL;
+ Standard_Boolean rational = Weights != NULL;
Standard_Integer dim = 3;
if (rational) dim++;
TColStd_Array1OfReal
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);
if (UDirection) {
BSplCLib::Unperiodize(Degree, dim, Mults, Knots, poles,
NewMults, NewKnots, newpoles);
- if (rational) GetPoles(newpoles,NewPoles,NewWeights,UDirection);
+ if (rational) GetPoles(newpoles,NewPoles,*NewWeights,UDirection);
else GetPoles(newpoles,NewPoles,UDirection);
}
const TColStd_Array1OfReal& UFlatKnots,
const TColStd_Array1OfReal& VFlatKnots,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
TColgp_Array2OfPnt& CachePoles,
- TColStd_Array2OfReal& CacheWeights)
+ TColStd_Array2OfReal* CacheWeights)
{
Standard_Boolean rational,rational_u,rational_v,flag_u_or_v;
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;
- if (&Weights != NULL)
+ if (Weights != NULL)
rational_u = rational_v = Standard_True;
else
rational_u = rational_v = Standard_False;
P.SetX( f * dc.poles[Index]); Index++;
P.SetY( 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[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
// locally polynomial but since the surface is constructed
for (ii = 1 ; ii <= d2p1 ; ii++) {
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 ;
}
}
}
const TColStd_Array1OfReal& theUFlatKnots,
const TColStd_Array1OfReal& theVFlatKnots,
const TColgp_Array2OfPnt& thePoles,
- const TColStd_Array2OfReal& theWeights,
+ const TColStd_Array2OfReal* theWeights,
TColStd_Array2OfReal& theCacheArray)
{
Standard_Boolean flag_u_or_v;
Standard_Integer d1, d2;
Standard_Real u1, u2;
- Standard_Boolean isRationalOnParam = (&theWeights != NULL);
+ Standard_Boolean isRationalOnParam = (theWeights != NULL);
Standard_Boolean isRational;
BSplSLib_DataContainer dc(theUDegree, theVDegree);
const Standard_Real USpanLenght,
const Standard_Real VSpanLenght,
const TColgp_Array2OfPnt& PolesArray,
- const TColStd_Array2OfReal& WeightsArray,
+ const TColStd_Array2OfReal* WeightsArray,
gp_Pnt& aPoint)
{
//
(min_degree << 1) + min_degree,
locpoles[0],
myPoint[0]) ;
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
dimension = min_degree + 1 ;
+ const TColStd_Array2OfReal& refWeights = *WeightsArray;
Standard_Real *
WArray = (Standard_Real *)
- &WeightsArray(WeightsArray.LowerCol(),WeightsArray.LowerRow()) ;
+ &refWeights(refWeights.LowerCol(),refWeights.LowerRow()) ;
PLib::NoDerivativeEvalPolynomial(new_parameter[0],
max_degree,
dimension,
const Standard_Real USpanLenght,
const Standard_Real VSpanLenght,
const TColgp_Array2OfPnt& PolesArray,
- const TColStd_Array2OfReal& WeightsArray,
+ const TColStd_Array2OfReal* WeightsArray,
gp_Pnt& aPoint,
gp_Vec& aVecU,
gp_Vec& aVecV)
// the coefficients
//
//
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
local_poles_array [0][0][0] = 0.0e0 ;
local_poles_array [0][0][1] = 0.0e0 ;
locpoles[dimension],
local_poles_array[1][0][0]) ;
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
dimension = min_degree + 1 ;
+ const TColStd_Array2OfReal& refWeights = *WeightsArray;
Standard_Real *
WArray = (Standard_Real *)
- &WeightsArray(WeightsArray.LowerCol(),WeightsArray.LowerRow()) ;
+ &refWeights(refWeights.LowerCol(),refWeights.LowerRow()) ;
PLib::EvalPolynomial(new_parameter[0],
1,
max_degree,
const Standard_Real USpanLenght,
const Standard_Real VSpanLenght,
const TColgp_Array2OfPnt& PolesArray,
- const TColStd_Array2OfReal& WeightsArray,
+ const TColStd_Array2OfReal* WeightsArray,
gp_Pnt& aPoint,
gp_Vec& aVecU,
gp_Vec& aVecV,
// 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][1] = 0.0e0 ;
locpoles[dimension + dimension],
local_poles_array[2][0][0]) ;
- if (&WeightsArray != NULL) {
+ if (WeightsArray != NULL) {
dimension = min_degree + 1 ;
+ const TColStd_Array2OfReal& refWeights = *WeightsArray;
Standard_Real *
WArray = (Standard_Real *)
- &WeightsArray(WeightsArray.LowerCol(),WeightsArray.LowerRow()) ;
+ &refWeights(refWeights.LowerCol(),refWeights.LowerRow()) ;
PLib::EvalPolynomial(new_parameter[0],
MinIndMax,
max_degree,
//=======================================================================
void BSplSLib::Resolution(const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UKnots,
const TColStd_Array1OfReal& VKnots,
const TColStd_Array1OfInteger& UMults,
PColLength = Poles.ColLength();
if (URational || VRational) {
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];
for (ii = 1 ; ii < Wsize ; ii++) {
upper[1] = jj + VD2 + 1;
if (upper[1] > num_poles[1]) upper[1] = num_poles[1];
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);
- Wmj = Weights.Value(ii_minus,jj_index);
+ Wmj = Weights->Value(ii_minus,jj_index);
Xij = Pij.X();
Yij = Pij.Y();
Zij = Pij.Z();
upper[1] = jj + UD2 + 1;
if (upper[1] > num_poles[0]) upper[1] = num_poles[0];
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);
- Wjm = Weights.Value(jj_index,ii_minus);
+ Wjm = Weights->Value(jj_index,ii_minus);
Xji = Pji.X();
Yji = Pji.Y();
Zji = Pji.Z();
const Standard_Integer VBSplineDegree,
const TColStd_Array1OfReal& UBSplineKnots,
const TColStd_Array1OfReal& VBSplineKnots,
- const TColStd_Array1OfInteger & UMults,
- const TColStd_Array1OfInteger & VMults,
+ const TColStd_Array1OfInteger * UMults,
+ const TColStd_Array1OfInteger * VMults,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
const TColStd_Array1OfReal& UFlatKnots,
const TColStd_Array1OfReal& VFlatKnots,
const Standard_Integer UNewDegree,
//! parametric U direction and the columns indice corresponds
//! 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 :
//! B-spline surface, Functions, Library
//!
//! 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 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
//! curve at parameter <Param> (UIso if <IsU> is True,
//! 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
//! the new first Row( Col) of Poles.
//! any and returns in P the Numerator value and
//! in W the Denominator value if Weights are present
//! 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
//! any and returns in P the Numerator value and
//! in W the Denominator value if Weights are present
//! 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.
Standard_EXPORT static void Reverse (TColStd_Array2OfReal& Weights, const Standard_Integer Last, const Standard_Boolean UDirection);
//! 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 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.
- static TColStd_Array2OfReal& NoWeights();
+ static TColStd_Array2OfReal* NoWeights();
//! Perform the evaluation of the Taylor expansion
//! of the Bspline normalized between 0 and 1.
//! If rational computes the homogeneous Taylor expension
//! 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
//! of the Bspline normalized between 0 and 1.
//! 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
//! the parameter must be normalized between
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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
//! the parameter must be normalized between
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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
//! the parameter must be normalized between
//! constructed the SpanLength is to normalize
//! the polynomial in the cache to avoid bad conditioning
//! 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
//! the method PolesCoefficients.
//! 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!!!
static void PolesCoefficients (const TColgp_Array2OfPnt& Poles, TColgp_Array2OfPnt& CachePoles);
//! evaluation of the Taylor expansion for beziersurfaces
//! at parameters 0.,0.;
//! 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
//! tolerances, one in U one in V such that for
//! | u1 - u0 | < UTolerance and
//! | v1 - v0 | < VTolerance
//! 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
//! the Poles array in the form
//! BSpline : the method used is interpolation at Schoenenberg
//! 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);
inline void BSplSLib::CoefsD0(const Standard_Real U,
const Standard_Real V,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
gp_Pnt& Point)
{
BSplSLib::CacheD0(U, V,
inline void BSplSLib::CoefsD1(const Standard_Real U,
const Standard_Real V,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
gp_Pnt& Point,
gp_Vec& VecU,
gp_Vec& VecV)
inline void BSplSLib::CoefsD2(const Standard_Real U,
const Standard_Real V,
const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
gp_Pnt& Point,
gp_Vec& VecU,
gp_Vec& VecV,
//purpose :
//=======================================================================
-inline TColStd_Array2OfReal& BSplSLib::NoWeights()
+inline TColStd_Array2OfReal* BSplSLib::NoWeights()
{
- return (*((TColStd_Array2OfReal*) NULL));
+ return NULL;
}
//=======================================================================
void BSplSLib::PolesCoefficients (const TColgp_Array2OfPnt& Poles,
- const TColStd_Array2OfReal& Weights,
+ const TColStd_Array2OfReal* Weights,
TColgp_Array2OfPnt& CachePoles,
- TColStd_Array2OfReal& CacheWeights)
+ TColStd_Array2OfReal* CacheWeights)
{
Standard_Integer i;
Standard_Integer uclas = Poles.ColLength();
uclas - 1,vclas - 1,0,0,
biduflatknots,bidvflatknots,
Poles,Weights,
- CPoles,CWeights);
- if (&Weights == NULL) {
+ CPoles,&CWeights);
+ if (Weights == NULL) {
for (ii = 1; ii <= uclas; ii++) {
for (jj = 1; jj <= vclas; jj++) {
CachePoles (ii, jj) = CPoles (jj, ii);
- CacheWeights(ii, jj) = CWeights(jj, ii);
+ (*CacheWeights)(ii, jj) = CWeights(jj, ii);
}
}
}
const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles,
- const TColStd_Array2OfReal& theWeights)
+ const TColStd_Array2OfReal* theWeights)
{
Standard_Real aU = theFlatKnotsU.Value(theFlatKnotsU.Lower() + theDegreeU);
Standard_Real aV = theFlatKnotsV.Value(theFlatKnotsV.Lower() + theDegreeV);
const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles,
- const TColStd_Array2OfReal& theWeights)
+ const TColStd_Array2OfReal* theWeights)
{
// Normalize the parameters for periodical B-splines
Standard_Real aNewParamU = theParameterU;
Standard_Integer aMaxDegree = Max(theDegreeU, theDegreeV);
// Change the size of cached data if needed
- myIsRational = (&theWeights != NULL);
+ myIsRational = (theWeights != NULL);
Standard_Integer aPWColNumber = myIsRational ? 4 : 3;
if (theDegreeU > myDegree[0] || theDegreeV > myDegree[1])
myPolesWeights = new TColStd_HArray2OfReal(1, aMaxDegree + 1, 1, aPWColNumber * (aMinDegree + 1));
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx>
-#ifndef NOWEIGHTS_SURF
-#define NOWEIGHTS_SURF (*((TColStd_Array2OfReal*) NULL))
-#endif
-
//! \brief A cache class for B-spline surfaces.
//!
//! Defines all data, that can be cached on a span of B-spline surface.
const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV,
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
//! \param theParameterU first parameter of the point placed in the span
const Standard_Boolean& thePeriodicV,
const TColStd_Array1OfReal& theFlatKnotsV,
const TColgp_Array2OfPnt& thePoles,
- const TColStd_Array2OfReal& theWeights = NOWEIGHTS_SURF);
+ const TColStd_Array2OfReal* theWeights = NULL);
//! Calculates the point on B-spline for specified parameters
//! \param[in] theU first parameter for calculation of the value
Inc = myDegree - Deg;
if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree,
- mySequence(i)->Array1(), PLib::NoWeights(),
- Points, PLib::NoWeights());
+ mySequence(i)->Array1(), BSplCLib::NoWeights(),
+ Points, BSplCLib::NoWeights());
}
else {
Points = mySequence(i)->Array1();
Inc = myDegree - Deg;
if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree,
- mySequence(i)->Array1(), PLib::NoWeights(),
- Points, PLib::NoWeights());
+ mySequence(i)->Array1(), BSplCLib::NoWeights(),
+ Points, BSplCLib::NoWeights());
}
else {
Points = mySequence(i)->Array1();
const Standard_Integer EvalDegree,
const TColgp_Array1OfPnt2d& EvalPoles,
const TColStd_Array1OfReal& EvalKnots,
- const TColStd_Array1OfInteger& EvalMults,
+ const TColStd_Array1OfInteger* EvalMults,
Standard_Real Result[2])
{
gp_Pnt2d a_point ;
// const TColStd_Array1OfReal& EvalKnots,
const TColStd_Array1OfReal& ,
// const TColStd_Array1OfInteger& EvalMults,
- const TColStd_Array1OfInteger& ,
+ const TColStd_Array1OfInteger* ,
Standard_Real Result[2])
{
Standard_Real
const Standard_Integer EvalDegree,
const TColgp_Array1OfPnt2d& EvalPoles,
const TColStd_Array1OfReal& EvalKnots,
- const TColStd_Array1OfInteger& EvalMults,
+ const TColStd_Array1OfInteger* EvalMults,
Convert_CosAndSinEvalFunction Evaluator,
TColStd_Array1OfReal& CosNumerator,
TColStd_Array1OfReal& SinNumerator,
temp_degree,
temp_poles,
temp_knots,
- temp_mults,
+ &temp_mults,
*EvaluatorPtr,
CosNumeratorPtr->ChangeArray1(),
SinNumeratorPtr->ChangeArray1(),
temp_degree,
Standard_False,
temp_cos_ptr->Array1(),
- temp_denominator_ptr->Array1(),
+ &temp_denominator_ptr->Array1(),
temp_knots_ptr->Array1(),
- temp_mults_ptr->Array1(),
+ &temp_mults_ptr->Array1(),
value1) ;
BSplCLib::D0(param,
temp_degree,
Standard_False,
temp_sin_ptr->Array1(),
- temp_denominator_ptr->Array1(),
+ &temp_denominator_ptr->Array1(),
temp_knots_ptr->Array1(),
- temp_mults_ptr->Array1(),
+ &temp_mults_ptr->Array1(),
value2) ;
BSplCLib::D0(param,
0,
temp_denominator_ptr->Array1(),
BSplCLib::NoWeights(),
temp_knots_ptr->Array1(),
- temp_mults_ptr->Array1(),
+ &temp_mults_ptr->Array1(),
value3) ;
contact_order_array(ii) = 0 ;
const Standard_Integer,
const TColgp_Array1OfPnt2d&,
const TColStd_Array1OfReal&,
- const TColStd_Array1OfInteger&,
+ const TColStd_Array1OfInteger*,
Standard_Real Result[2]) ;
#endif
Iknots->Array1(),
Imults->Array1(),
Npoles->ChangeArray1(),
- Nweight->ChangeArray1(),
+ &Nweight->ChangeArray1(),
Nknots->ChangeArray1(),
Nmults->ChangeArray1() );
BSplCLib::IncreaseDegree
(deg,Degree, periodic,
- poles->Array1(),weights->Array1(),
+ poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),nweights->ChangeArray1(),
+ npoles->ChangeArray1(),&nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
else {
poles->Array1(),BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(),
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(),
- Knots,Mults,nbpoles,nbknots,Epsilon,Add))
+ Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
Standard_ConstructionError::Raise("Geom_BSplineCurve::InsertKnots");
if (nbpoles == poles->Length()) return;
Handle(TColStd_HArray1OfReal) nweights =
new TColStd_HArray1OfReal(1,nbpoles);
BSplCLib::InsertKnots(deg,periodic,
- poles->Array1(), weights->Array1(),
+ poles->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(),
- Knots, Mults,
- npoles->ChangeArray1(), nweights->ChangeArray1(),
+ Knots, &Mults,
+ npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add);
weights = nweights;
BSplCLib::InsertKnots(deg,periodic,
poles->Array1(), BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add);
}
new TColStd_HArray1OfReal(1,npoles->Length());
if (!BSplCLib::RemoveKnot
(Index, M, deg, periodic,
- poles->Array1(),weights->Array1(),
+ poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(), nweights->ChangeArray1(),
+ npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
poles->Array1(), BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(),
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
BSplCLib::Unperiodize
(deg,mults->Array1(),knots->Array1(),poles->Array1(),
- weights->Array1(),nmults->ChangeArray1(),
+ &weights->Array1(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(),
- nweights->ChangeArray1());
+ &nweights->ChangeArray1());
}
else {
(deg,mults->Array1(),knots->Array1(),poles->Array1(),
BSplCLib::NoWeights(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
+ BSplCLib::NoWeights());
}
poles = npoles;
Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const;
//! 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.
Standard_EXPORT void Transform (const gp_Trsf& T);
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P);
}
else
{
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P);
}
}
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P, V1);
}
else
{
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P, V1);
}
}
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2);
}
else
{
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2);
}
}
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2, V3);
}
else
{
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2, V3);
}
}
gp_Vec V;
if (rational) {
BSplCLib::DN(U,N,0,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,V);
}
else {
BSplCLib::DN(U,N,0,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,V);
}
return V;
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) {
BSplCLib::D0(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P);
}
else {
BSplCLib::D0(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P);
}
}
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) {
BSplCLib::D1(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P,V1);
}
else {
BSplCLib::D1(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1);
}
}
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) {
BSplCLib::D2(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2);
}
else {
BSplCLib::D2(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2);
}
}
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
if (rational) {
BSplCLib::D3(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2,V3);
}
else {
BSplCLib::D3(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2,V3);
}
}
gp_Vec V;
if (rational) {
BSplCLib::DN(u,N,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,V);
}
else {
BSplCLib::DN(u,N,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,V);
}
return V;
}
}
-const TColStd_Array1OfReal& Geom_BSplineCurve::Weights() const
+const TColStd_Array1OfReal* Geom_BSplineCurve::Weights() const
{
if (IsRational())
- return weights->Array1();
+ return &weights->Array1();
return BSplCLib::NoWeights();
}
new_weights(ii) = weights->Array1()((ii-1) % poles->Length() + 1) ;
}
BSplCLib::Resolution(new_poles,
- new_weights,
+ &new_weights,
new_poles.Length(),
flatknots->Array1(),
deg,
}
else {
BSplCLib::Resolution(new_poles,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
new_poles.Length(),
flatknots->Array1(),
deg,
else {
if (rational) {
BSplCLib::Resolution(poles->Array1(),
- weights->Array1(),
+ &weights->Array1(),
poles->Length(),
flatknots->Array1(),
deg,
}
else {
BSplCLib::Resolution(poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
poles->Length(),
flatknots->Array1(),
deg,
BSplSLib::IncreaseDegree
(Standard_True, udeg, UDegree, uperiodic,
- poles->Array2(),weights->Array2(),
+ poles->Array2(),&weights->Array2(),
uknots->Array1(),umults->Array1(),
- npoles->ChangeArray2(),nweights->ChangeArray2(),
+ npoles->ChangeArray2(),&nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
else {
(Standard_True, udeg, UDegree, uperiodic,
poles->Array2(),BSplSLib::NoWeights(),
uknots->Array1(),umults->Array1(),
- npoles->ChangeArray2(),*((TColStd_Array2OfReal*) NULL),
+ npoles->ChangeArray2(),BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
udeg = UDegree;
BSplSLib::IncreaseDegree
(Standard_False, vdeg, VDegree, vperiodic,
- poles->Array2(),weights->Array2(),
+ poles->Array2(),&weights->Array2(),
vknots->Array1(),vmults->Array1(),
- npoles->ChangeArray2(),nweights->ChangeArray2(),
+ npoles->ChangeArray2(),&nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
else {
(Standard_False, vdeg, VDegree, vperiodic,
poles->Array2(),BSplSLib::NoWeights(),
vknots->Array1(),vmults->Array1(),
- npoles->ChangeArray2(),*((TColStd_Array2OfReal*) NULL),
+ npoles->ChangeArray2(),BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
vdeg = VDegree;
//! Returns the weights of the B-spline surface.
//! 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_Real aNewV = V;
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,
P);
}
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);
- 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);
- 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,
P, D1U, D1V);
}
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);
- 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);
- 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,
P, D1U, D1V, D2U, D2V, D2UV);
}
gp_Vec& D3UUV,
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,
P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
}
const Standard_Integer Nv ) const
{
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,
Vn);
return Vn;
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,
udeg,vdeg,urational,vrational,uperiodic,vperiodic,
P);
}
vindex,v);
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,
P,D1U,D1V);
}
vindex,v);
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,
P,D1U,D1V,D2U,D2V,D2UV);
}
vindex,v);
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,
P,D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV);
}
gp_Vec Vn;
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,
Vn);
return Vn;
Handle(Geom_BSplineCurve) C;
if ( urational || vrational) {
- BSplSLib::Iso(U,Standard_True,POLES,WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic,
- cpoles,cweights);
+ BSplSLib::Iso(U,Standard_True,POLES,&WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic,
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights,
vknots->Array1(),
vmults->Array1(),
}
else {
BSplSLib::Iso(U,Standard_True,POLES,
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
UFKNOTS,FMULTS,udeg,uperiodic,
- cpoles,cweights);
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,
vknots->Array1(),
vmults->Array1(),
Handle(Geom_BSplineCurve) C;
if ( urational || vrational) {
- BSplSLib::Iso(U,Standard_True,POLES,WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic,
- cpoles,cweights);
+ BSplSLib::Iso(U,Standard_True,POLES,&WEIGHTS,UFKNOTS,FMULTS,udeg,uperiodic,
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights,
vknots->Array1(),
vmults->Array1(),
}
else {
BSplSLib::Iso(U,Standard_True,POLES,
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
UFKNOTS,FMULTS,udeg,uperiodic,
- cpoles,cweights);
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,
vknots->Array1(),
vmults->Array1(),
if ( urational || vrational) {
BSplSLib::Iso(V,Standard_False,POLES,
- WEIGHTS,
+ &WEIGHTS,
VFKNOTS,FMULTS,vdeg,vperiodic,
- cpoles,cweights);
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights,
uknots->Array1(),
umults->Array1(),
}
else {
BSplSLib::Iso(V,Standard_False,POLES,
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
VFKNOTS,FMULTS,vdeg,vperiodic,
- cpoles,cweights);
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,
uknots->Array1(),
umults->Array1(),
if ( urational || vrational) {
BSplSLib::Iso(V,Standard_False,POLES,
- WEIGHTS,
+ &WEIGHTS,
VFKNOTS,FMULTS,vdeg,vperiodic,
- cpoles,cweights);
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,cweights,
uknots->Array1(),
umults->Array1(),
}
else {
BSplSLib::Iso(V,Standard_False,POLES,
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
VFKNOTS,FMULTS,vdeg,vperiodic,
- cpoles,cweights);
+ cpoles,&cweights);
C = new Geom_BSplineCurve(cpoles,
uknots->Array1(),
umults->Array1(),
W = weights->Array2();
}
-const TColStd_Array2OfReal& Geom_BSplineSurface::Weights() const
+const TColStd_Array2OfReal* Geom_BSplineSurface::Weights() const
{
if (urational || vrational)
- return weights->Array2();
+ return &weights->Array2();
return BSplSLib::NoWeights();
}
BSplSLib::Unperiodize(Standard_True , udeg,
umults->Array1() , uknots->Array1(),
- poles->Array2() , weights->Array2(),
+ poles->Array2() , &weights->Array2(),
nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(),
- nweights->ChangeArray2());
+ &nweights->ChangeArray2());
}
else {
poles->Array2() , BSplSLib::NoWeights(),
nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL));
+ BSplSLib::NoWeights());
}
poles = npoles;
weights = nweights;
BSplSLib::Unperiodize(Standard_False , vdeg,
vmults->Array1() , vknots->Array1(),
- poles->Array2() , weights->Array2(),
+ poles->Array2() , &weights->Array2(),
nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(),
- nweights->ChangeArray2());
+ &nweights->ChangeArray2());
}
else {
poles->Array2() , BSplSLib::NoWeights(),
nmults->ChangeArray1(), nknots->ChangeArray1(),
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL));
+ BSplSLib::NoWeights());
}
poles = npoles;
weights = nweights;
if ( !BSplCLib::PrepareInsertKnots(udeg,uperiodic,
uknots->Array1(),umults->Array1(),
- Knots,Mults,nbpoles,nbknots,
+ Knots,&Mults,nbpoles,nbknots,
ParametricTolerance,Add))
Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertUKnots");
if ( urational || vrational) {
BSplSLib::InsertKnots(Standard_True,
udeg, uperiodic,
- poles->Array2() , weights->Array2(),
+ poles->Array2() , &weights->Array2(),
uknots->Array1(), umults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray2(),
- nweights->ChangeArray2(),
+ &nweights->ChangeArray2(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add);
}
udeg, uperiodic,
poles->Array2() , BSplSLib::NoWeights(),
uknots->Array1(), umults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add);
}
if ( !BSplCLib::PrepareInsertKnots(vdeg,vperiodic,
vknots->Array1(),vmults->Array1(),
- Knots,Mults,nbpoles,nbknots,
+ Knots,&Mults,nbpoles,nbknots,
ParametricTolerance, Add))
Standard_ConstructionError::Raise("Geom_BSplineSurface::InsertVKnots");
if ( urational || vrational) {
BSplSLib::InsertKnots(Standard_False,
vdeg, vperiodic,
- poles->Array2() , weights->Array2(),
+ poles->Array2() , &weights->Array2(),
vknots->Array1(), vmults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray2(),
- nweights->ChangeArray2(),
+ &nweights->ChangeArray2(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add);
}
vdeg, vperiodic,
poles->Array2() , BSplSLib::NoWeights(),
vknots->Array1(), vmults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
ParametricTolerance, Add);
}
1, npoles->RowLength());
if (!BSplSLib::RemoveKnot(Standard_True,
Index,M,udeg,uperiodic,
- poles->Array2(),weights->Array2(),
+ poles->Array2(),&weights->Array2(),
uknots->Array1(),umults->Array1(),
npoles->ChangeArray2(),
- nweights->ChangeArray2(),
+ &nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
poles->Array2(),BSplSLib::NoWeights(),
uknots->Array1(),umults->Array1(),
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
if (!BSplSLib::RemoveKnot(Standard_False,
Index,M,vdeg,vperiodic,
- poles->Array2(),weights->Array2(),
+ poles->Array2(),&weights->Array2(),
vknots->Array1(),vmults->Array1(),
npoles->ChangeArray2(),
- nweights->ChangeArray2(),
+ &nweights->ChangeArray2(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
poles->Array2(),BSplSLib::NoWeights(),
vknots->Array1(),vmults->Array1(),
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
{
if(!maxderivinvok){
BSplSLib::Resolution(poles ->Array2(),
- weights->Array2(),
+ &weights->Array2(),
uknots ->Array1(),
vknots ->Array1(),
umults ->Array1(),
nweights = new TColStd_HArray1OfReal(1,Deg+1);
BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(),
- weights->Array1(),
+ &weights->Array1(),
bidknots, bidmults,
npoles->ChangeArray1(),
- nweights->ChangeArray1(),
+ &nweights->ChangeArray1(),
bidknots, bidmults);
}
else {
BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
bidknots, bidmults,
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
bidknots, bidmults);
}
if(!CoefficientsOK(0.)) UpdateCoefficients(0.);
if (IsRational()) {
PLib::Trimming(U1,U2,coeffs->ChangeArray1(),
- wcoeffs->ChangeArray1());
+ &wcoeffs->ChangeArray1());
PLib::CoefficientsPoles(coeffs->Array1(),
- wcoeffs->Array1(),
+ &wcoeffs->Array1(),
poles->ChangeArray1(),
- weights->ChangeArray1());
+ &weights->ChangeArray1());
}
else {
- PLib::Trimming(U1,U2,coeffs->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
- PLib::CoefficientsPoles(coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- poles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
+ PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::NoWeights());
+ PLib::CoefficientsPoles(coeffs->Array1(), PLib::NoWeights(),
+ poles->ChangeArray1(), PLib::NoWeights());
}
UpdateCoefficients();
}
if (IsRational())
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- wcoeffs->Array1(),
+ &wcoeffs->Array1(),
P);
else
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),P
- );
+ coeffs->Array1(), BSplCLib::NoWeights(), P);
}
//=======================================================================
if (IsRational())
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- wcoeffs->Array1(),
+ &wcoeffs->Array1(),
P,V1);
else
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
P,V1);
}
if (IsRational())
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- wcoeffs->Array1(),
+ &wcoeffs->Array1(),
P,V1,V2);
else
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
P,V1,V2);
}
if (IsRational())
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- wcoeffs->Array1(),
+ &wcoeffs->Array1(),
P,V1,V2,V3);
else
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
P,V1,V2,V3);
}
// BSplCLib::DN(U,N,0,Degree(),0.,
BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(),
- weights->Array1(),
- bidknots,bidmults,V);
+ &weights->Array1(),
+ bidknots,&bidmults,V);
else
// BSplCLib::DN(U,N,0,Degree(),0.,
BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- bidknots,bidmults,V);
+ BSplCLib::NoWeights(),
+ bidknots,&bidmults,V);
return V;
}
if (IsRational()) {
BSplCLib::Resolution(poles->Array1(),
- weights->Array1(),
+ &weights->Array1(),
poles->Length(),
bidflatknots,
Degree(),
if (IsRational())
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(),
- weights->Array1(),
+ &weights->Array1(),
coeffs->ChangeArray1(),
- wcoeffs->ChangeArray1());
+ &wcoeffs->ChangeArray1());
else
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
coeffs->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
+ BSplCLib::NoWeights());
validcache = 1;
}
BSplSLib::IncreaseDegree(1, oldUDeg, UDeg, 0,
poles->Array2(),
- weights->Array2(),
+ &weights->Array2(),
biduknots, bidumults,
npoles->ChangeArray2(),
- nweights->ChangeArray2(),
+ &nweights->ChangeArray2(),
biduknots, bidumults);
weights = nweights;
}
else {
BSplSLib::IncreaseDegree(1, oldUDeg, UDeg, 0,
poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
biduknots, bidumults,
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
biduknots, bidumults);
}
poles = npoles;
BSplSLib::IncreaseDegree(0, oldVDeg, VDeg, 0,
poles->Array2(),
- weights->Array2(),
+ &weights->Array2(),
bidvknots, bidvmults,
npoles->ChangeArray2(),
- nweights->ChangeArray2(),
+ &nweights->ChangeArray2(),
bidvknots, bidvmults);
weights = nweights;
}
else {
BSplSLib::IncreaseDegree(0, oldVDeg, VDeg, 0,
poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
bidvknots, bidvmults,
npoles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
bidvknots, bidvmults);
}
vlast = 2*(V2 - 0.5);
if (rat) {
PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(),
- WCoefs->ChangeArray2());
+ &WCoefs->ChangeArray2());
PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(),
- WCoefs->ChangeArray2());
+ &WCoefs->ChangeArray2());
PLib::CoefficientsPoles(Coefs->Array2(),
- WCoefs->Array2(),
+ &WCoefs->Array2(),
poles->ChangeArray2(),
- weights->ChangeArray2());
+ &weights->ChangeArray2());
}
else {
- PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL));
- PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL));
- PLib::CoefficientsPoles (Coefs->Array2(),
- *((TColStd_Array2OfReal*) NULL),
- poles->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL));
+ PLib::UTrimming (ufirst, ulast, Coefs->ChangeArray2(), PLib::NoWeights2());
+ PLib::VTrimming (vfirst, vlast, Coefs->ChangeArray2(), PLib::NoWeights2());
+ PLib::CoefficientsPoles (Coefs->Array2(), PLib::NoWeights2(),
+ poles->ChangeArray2(), PLib::NoWeights2());
}
UpdateCoefficients();
}
uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11,
coeffs->Array2(),
- wcoeffs->Array2(),
+ &wcoeffs->Array2(),
P);
}
else {
uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11,
coeffs->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
P);
}
}
TColStd_Array1OfInteger bidvmults(mult_v[0],1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) {
BSplSLib::D0(U, V, 1,1,poles->Array2(),
- weights->Array2(),
- biduknots,bidvknots,bidumults,bidvmults,
+ &weights->Array2(),
+ biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False,
P) ;
else {
BSplSLib::D0(U, V, 1,1,poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
- biduknots,bidvknots,bidumults,bidvmults,
+ BSplSLib::NoWeights(),
+ biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False,
P) ;
uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11,
coeffs->Array2(),
- wcoeffs->Array2(),
+ &wcoeffs->Array2(),
P, D1U, D1V);
}
else {
uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11,
coeffs->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
P, D1U, D1V);
}
}
TColStd_Array1OfInteger bidvmults(mult_v[0],1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) {
BSplSLib::D1(U, V, 1,1,poles->Array2(),
- weights->Array2(),
- biduknots,bidvknots,bidumults,bidvmults,
+ &weights->Array2(),
+ biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False,
P,D1U, D1V) ;
}
else {
BSplSLib::D1(U, V, 1,1,poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
- biduknots,bidvknots,bidumults,bidvmults,
+ BSplSLib::NoWeights(),
+ biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False,
P,D1U, D1V) ;
uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11,
coeffs->Array2(),
- wcoeffs->Array2(),
+ &wcoeffs->Array2(),
P, D1U, D1V, D2U, D2UV , D2V);
}
else {
uparameter_11, vparameter_11,
uspanlenght_11, vspanlenght_11,
coeffs->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
P, D1U, D1V, D2U, D2UV , D2V);
}
}
if (urational || vrational) {
//-- ATTENTION a l'ORDRE d'appel ds BSPLSLIB
BSplSLib::D2(U, V, 1,1,poles->Array2(),
- weights->Array2(),
- biduknots,bidvknots,bidumults,bidvmults,
+ &weights->Array2(),
+ biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False,
P,D1U, D1V, D2U, D2V , D2UV) ;
else {
//-- ATTENTION a l'ORDRE d'appel ds BSPLSLIB
BSplSLib::D2(U, V, 1,1,poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
- biduknots,bidvknots,bidumults,bidvmults,
+ BSplSLib::NoWeights(),
+ biduknots,bidvknots,&bidumults,&bidvmults,
UDegree(),VDegree(),
urational,vrational,Standard_False,Standard_False,
P,D1U, D1V, D2U, D2V, D2UV ) ;
TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) {
BSplSLib::D3 (U, V, 0, 0, poles->Array2(),
- weights->Array2(),
- biduknots, bidvknots, bidumults, bidvmults,
+ &weights->Array2(),
+ biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0,
P,
D1U, D1V,
}
else {
BSplSLib::D3 (U, V, 0, 0, poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
- biduknots, bidvknots, bidumults, bidvmults,
+ BSplSLib::NoWeights(),
+ biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0,
P,
D1U, D1V,
TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1);
if (urational || vrational) {
BSplSLib::DN (U, V, Nu, Nv, 0, 0, poles->Array2(),
- weights->Array2(),
- biduknots, bidvknots, bidumults, bidvmults,
+ &weights->Array2(),
+ biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0,
Derivative);
}
else {
BSplSLib::DN (U, V, Nu, Nv, 0, 0, poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
- biduknots, bidvknots, bidumults, bidvmults,
+ BSplSLib::NoWeights(),
+ biduknots, bidvknots, &bidumults, &bidvmults,
UDegree(), VDegree(), urational, vrational, 0, 0,
Derivative);
}
TColStd_Array1OfReal VCurveWeights
(Weights.LowerCol() , Weights.UpperCol());
BSplSLib::Iso (U, 1, Poles,
- Weights,
- biduknots, bidumults,
- UDegree(), 0, VCurvePoles, VCurveWeights);
+ &Weights,
+ biduknots, &bidumults,
+ UDegree(), 0, VCurvePoles, &VCurveWeights);
if (urational)
UIsoCurve = new Geom_BezierCurve (VCurvePoles, VCurveWeights);
else
}
else {
BSplSLib::Iso (U, 1, Poles,
- *((TColStd_Array2OfReal*) NULL),
- biduknots, bidumults,
+ BSplSLib::NoWeights(),
+ biduknots, &bidumults,
UDegree(), 0, VCurvePoles, PLib::NoWeights());
UIsoCurve = new Geom_BezierCurve (VCurvePoles);
}
TColStd_Array1OfReal VCurveWeights
(Weights.LowerRow() , Weights.UpperRow());
BSplSLib::Iso (V, 0, Poles,
- Weights,
- bidvknots, bidvmults,
- VDegree(), 0, VCurvePoles, VCurveWeights);
+ &Weights,
+ bidvknots, &bidvmults,
+ VDegree(), 0, VCurvePoles, &VCurveWeights);
if (vrational)
VIsoCurve = new Geom_BezierCurve (VCurvePoles, VCurveWeights);
else
}
else {
BSplSLib::Iso (V, 0, Poles,
- *((TColStd_Array2OfReal*) NULL),
- bidvknots, bidvmults,
+ BSplSLib::NoWeights(),
+ bidvknots, &bidvmults,
VDegree(), 0, VCurvePoles, PLib::NoWeights());
VIsoCurve = new Geom_BezierCurve (VCurvePoles);
}
TColStd_Array1OfInteger bidvmults(1,2); bidvmults.Init(VDegree() + 1);
if(urational || vrational){
BSplSLib::Resolution(poles->Array2(),
- weights->Array2(),
+ &weights->Array2(),
biduknots,
bidvknots,
bidumults,
}
else{
BSplSLib::Resolution(poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
biduknots,
bidvknots,
bidumults,
UDegree(),VDegree(),0,0,
biduflatknots,bidvflatknots,
poles->Array2(),
- weights->Array2(),
+ &weights->Array2(),
coeffs->ChangeArray2(),
- wcoeffs->ChangeArray2());
+ &wcoeffs->ChangeArray2());
}
else {
BSplSLib::BuildCache(uparameter_11,vparameter_11,
UDegree(),VDegree(),0,0,
biduflatknots,bidvflatknots,
poles->Array2(),
- *((TColStd_Array2OfReal*) NULL),
+ BSplSLib::NoWeights(),
coeffs->ChangeArray2(),
- *((TColStd_Array2OfReal*) NULL));
+ BSplSLib::NoWeights());
}
validcache = 1;
}
BSplCLib::IncreaseDegree
(deg,Degree, periodic,
- poles->Array1(),weights->Array1(),
+ poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),nweights->ChangeArray1(),
+ npoles->ChangeArray1(),&nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
else {
BSplCLib::IncreaseDegree
(deg,Degree, periodic,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(),
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1());
}
if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(),
- Knots,Mults,nbpoles,nbknots,Epsilon,Add))
+ Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
Standard_ConstructionError::Raise("Geom2d_BSplineCurve::InsertKnots");
if (nbpoles == poles->Length()) return;
Handle(TColStd_HArray1OfReal) nweights =
new TColStd_HArray1OfReal(1,nbpoles);
BSplCLib::InsertKnots(deg,periodic,
- poles->Array1(), weights->Array1(),
+ poles->Array1(), &weights->Array1(),
knots->Array1(), mults->Array1(),
- Knots, Mults,
- npoles->ChangeArray1(), nweights->ChangeArray1(),
+ Knots, &Mults,
+ npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon,Add);
weights = nweights;
else {
BSplCLib::InsertKnots(deg,periodic,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
knots->Array1(), mults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon,Add);
}
new TColStd_HArray1OfReal(1,npoles->Length());
if (!BSplCLib::RemoveKnot
(Index, M, deg, periodic,
- poles->Array1(),weights->Array1(),
+ poles->Array1(),&weights->Array1(),
knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(), nweights->ChangeArray1(),
+ npoles->ChangeArray1(), &nweights->ChangeArray1(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
if (!BSplCLib::RemoveKnot
(Index, M, deg, periodic,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
knots->Array1(),mults->Array1(),
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
nknots->ChangeArray1(),nmults->ChangeArray1(),
Tolerance))
return Standard_False;
BSplCLib::Unperiodize
(deg,mults->Array1(),knots->Array1(),poles->Array1(),
- weights->Array1(),nmults->ChangeArray1(),
+ &weights->Array1(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(),
- nweights->ChangeArray1());
+ &nweights->ChangeArray1());
}
else {
BSplCLib::Unperiodize
(deg,mults->Array1(),knots->Array1(),poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),nmults->ChangeArray1(),
+ BSplCLib::NoWeights(),nmults->ChangeArray1(),
nknots->ChangeArray1(),npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
+ BSplCLib::NoWeights());
}
poles = npoles;
Standard_EXPORT void Weights (TColStd_Array1OfReal& W) const;
//! 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.
Standard_EXPORT void Transform (const gp_Trsf2d& T);
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P);
}
else
{
BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P);
}
}
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P, V1);
}
else
{
BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P, V1);
}
}
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2);
}
else
{
BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2);
}
}
Standard_Integer aSpanIndex = 0;
Standard_Real aNewU(U);
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))
aSpanIndex--;
if (rational)
{
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
- weights->Array1(),
- knots->Array1(), mults->Array1(),
+ &weights->Array1(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2, V3);
}
else
{
BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
- knots->Array1(), mults->Array1(),
+ BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
P, V1, V2, V3);
}
}
if ( rational ) {
BSplCLib::DN(U,N,0,deg,periodic,POLES,
- weights->Array1(),
- FKNOTS,FMULTS,V);
+ &weights->Array1(),
+ FKNOTS,FMULTS, V);
}
else {
BSplCLib::DN(U,N,0,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,V);
}
return V;
if ( rational ) {
BSplCLib::D0(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P);
}
else {
BSplCLib::D0(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P);
}
}
if (rational) {
BSplCLib::D1(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P,V1);
}
else {
BSplCLib::D1(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1);
}
}
if ( rational ) {
BSplCLib::D2(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2);
}
else {
BSplCLib::D2(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2);
}
}
if ( rational ) {
BSplCLib::D3(u,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,P,V1,V2,V3);
}
else {
BSplCLib::D3(u,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,P,V1,V2,V3);
}
}
if ( rational ) {
BSplCLib::DN(u,N,index,deg,periodic,POLES,
- weights->Array1(),
+ &weights->Array1(),
FKNOTS,FMULTS,V);
}
else {
BSplCLib::DN(u,N,index,deg,periodic,POLES,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
FKNOTS,FMULTS,V);
}
return V;
}
}
-const TColStd_Array1OfReal& Geom2d_BSplineCurve::Weights() const
+const TColStd_Array1OfReal* Geom2d_BSplineCurve::Weights() const
{
if (IsRational())
- return weights->Array1();
+ return &weights->Array1();
return BSplCLib::NoWeights();
}
new_weights(ii) = weights->Array1()(((ii-1) % poles->Length()) + 1) ;
}
BSplCLib::Resolution(new_poles,
- new_weights,
+ &new_weights,
new_poles.Length(),
flatknots->Array1(),
deg,
}
else {
BSplCLib::Resolution(new_poles,
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
new_poles.Length(),
flatknots->Array1(),
deg,
else {
if (rational) {
BSplCLib::Resolution(poles->Array1(),
- weights->Array1(),
+ &weights->Array1(),
poles->Length(),
flatknots->Array1(),
deg,
}
else {
BSplCLib::Resolution(poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
poles->Length(),
flatknots->Array1(),
deg,
if (IsRational()) {
nweights = new TColStd_HArray1OfReal(1,Deg+1);
BSplCLib::IncreaseDegree(Degree(), Deg, 0,
- poles->Array1(),weights->Array1(),
+ poles->Array1(),&weights->Array1(),
bidknots, bidmults,
- npoles->ChangeArray1(),nweights->ChangeArray1(),
+ npoles->ChangeArray1(),&nweights->ChangeArray1(),
bidknots, bidmults);
}
else {
BSplCLib::IncreaseDegree(Degree(), Deg, 0,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
bidknots, bidmults,
npoles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
bidknots, bidmults);
}
//
if (IsRational()) {
- PLib::Trimming(U1,U2,coeffs->ChangeArray1(),wcoeffs->ChangeArray1());
- PLib::CoefficientsPoles(coeffs->Array1(),wcoeffs->Array1(),
- poles->ChangeArray1(),weights->ChangeArray1());
+ PLib::Trimming(U1,U2,coeffs->ChangeArray1(),&wcoeffs->ChangeArray1());
+ PLib::CoefficientsPoles(coeffs->Array1(),&wcoeffs->Array1(),
+ poles->ChangeArray1(),&weights->ChangeArray1());
}
else {
- PLib::Trimming(U1,U2,coeffs->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
- PLib::CoefficientsPoles(coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- poles->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
+ PLib::Trimming(U1,U2,coeffs->ChangeArray1(), PLib::NoWeights());
+ PLib::CoefficientsPoles(coeffs->Array1(), PLib::NoWeights(),
+ poles->ChangeArray1(), PLib::NoWeights());
}
UpdateCoefficients();
}
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational())
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),wcoeffs->Array1(),P);
+ coeffs->Array1(),&wcoeffs->Array1(),P);
else
BSplCLib::CacheD0(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- P);
+ coeffs->Array1(), BSplCLib::NoWeights(), P);
}
//=======================================================================
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational())
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),wcoeffs->Array1(),P,V1);
+ coeffs->Array1(),&wcoeffs->Array1(),P,V1);
else
BSplCLib::CacheD1(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- P,V1);
+ coeffs->Array1(), BSplCLib::NoWeights(), P,V1);
}
//=======================================================================
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational())
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),wcoeffs->Array1(),P,V1,V2);
+ coeffs->Array1(),&wcoeffs->Array1(),P,V1,V2);
else
BSplCLib::CacheD2(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- P,V1,V2);
+ coeffs->Array1(), BSplCLib::NoWeights(), P,V1,V2);
}
//=======================================================================
// ((Geom2d_BezierCurve*)(void*)this)->UpdateCoefficients(U);
if (IsRational())
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),wcoeffs->Array1(),P,V1,V2,V3);
+ coeffs->Array1(),&wcoeffs->Array1(),P,V1,V2,V3);
else
BSplCLib::CacheD3(U,Degree(),parametercache,spanlenghtcache,
- coeffs->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- P,V1,V2,V3);
+ coeffs->Array1(), BSplCLib::NoWeights(), P,V1,V2,V3);
}
//=======================================================================
if (IsRational())
BSplCLib::DN(U,N,0,Degree(),Standard_False,
- poles->Array1(),weights->Array1(),
- bidknots,bidmults,V);
+ poles->Array1(),&weights->Array1(),
+ bidknots,&bidmults,V);
else
BSplCLib::DN(U,N,0,Degree(),Standard_False,
poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
- bidknots,bidmults,V);
+ BSplCLib::NoWeights(),
+ bidknots,&bidmults,V);
return V;
}
if (IsRational()) {
BSplCLib::Resolution(poles->Array1(),
- weights->Array1(),
+ &weights->Array1(),
poles->Length(),
bidflatknots,
Degree(),
}
else {
BSplCLib::Resolution(poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
poles->Length(),
bidflatknots,
Degree(),
1, 2*(Degree()+1));
if (IsRational())
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
- bidflatknots,poles->Array1(),weights->Array1(),
- coeffs->ChangeArray1(),wcoeffs->ChangeArray1());
+ bidflatknots,poles->Array1(),&weights->Array1(),
+ coeffs->ChangeArray1(),&wcoeffs->ChangeArray1());
else
BSplCLib::BuildCache(parametercache,spanlenghtcache,0,Degree(),
bidflatknots,poles->Array1(),
- *((TColStd_Array1OfReal*) NULL),
+ BSplCLib::NoWeights(),
coeffs->ChangeArray1(),
- *((TColStd_Array1OfReal*) NULL));
+ BSplCLib::NoWeights());
validcache = 1;
}
// insert the Knots
BSplCLib::InsertKnots(Degree,Standard_False,1,
NewTempPoles,NewTempKnots,NewTempMults,
- TheCurve.Knots(),TheCurve.Multiplicities(),
+ TheCurve.Knots(),&TheCurve.Multiplicities(),
XPoles,Knots,Mults,
Epsilon(1));
// insert the Knots
BSplCLib::InsertKnots(VDegree,Standard_False,1,
NewTempPoles,NewTempKnots,NewTempMults,
- TheCurve.Knots(),TheCurve.Multiplicities(),
+ TheCurve.Knots(),&TheCurve.Multiplicities(),
YPoles,VKnots,VMults,
Epsilon(1));
// insert the Knots
BSplCLib::InsertKnots(UDegree,Standard_False,1,
NewTempPoles2,NewTempKnots,NewTempMults,
- TheCurve2.Knots(),TheCurve2.Multiplicities(),
+ TheCurve2.Knots(),&TheCurve2.Multiplicities(),
XPoles,UKnots,UMults,
Epsilon(1));
Standard_Integer NP,NK;
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)) {
TColgp_Array1OfPnt NewP(1, NP);
TColStd_Array1OfReal NewW(1, NP);
TColStd_Array1OfReal NewK(1, NK);
TColStd_Array1OfInteger NewM(1, NK);
BSplCLib::InsertKnots(C1->Degree(),Standard_False,
- P1,W1,K1,M1,K2,M2,
- NewP,NewW,NewK,NewM,Precision::PConfusion(),
+ P1,&W1,K1,M1,K2,&M2,
+ NewP,&NewW,NewK,NewM,Precision::PConfusion(),
Standard_False);
if ( C1->IsRational()) {
C1 = new Geom_BSplineCurve(NewP,NewW,NewK,NewM,C1->Degree());
C1 = new Geom_BSplineCurve(NewP,NewK,NewM,C1->Degree());
}
BSplCLib::InsertKnots(C2->Degree(),Standard_False,
- P2,W2,K2,M2,K1,M1,
- NewP,NewW,NewK,NewM,Precision::PConfusion(),
+ P2,&W2,K2,M2,K1,&M1,
+ NewP,&NewW,NewK,NewM,Precision::PConfusion(),
Standard_False);
if ( C2->IsRational()) {
C2 = new Geom_BSplineCurve(NewP,NewW,NewK,NewM,C2->Degree());
if(BSplCLib::PrepareInsertKnots(degree[1],0,
knots[1]->Array1(),
mults[1]->Array1(),
- addk,addm,nbnp,nbnk,tolk,0)){
+ addk,&addm,nbnp,nbnk,tolk,0)){
nm[1] = new TColStd_HArray1OfInteger(1,nbnk);
nk[1] = new TColStd_HArray1OfReal(1,nbnk);
ncpol[1] = new TColgp_HArray1OfPnt(1,nbnp);
ncpol[3] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[1],0,
- curvpol[1]->Array1(),PLib::NoWeights(),
+ curvpol[1]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(),
- addk,addm,
- ncpol[1]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ncpol[1]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0);
BSplCLib::InsertKnots(degree[1],0,
- curvpol[3]->Array1(),PLib::NoWeights(),
+ curvpol[3]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(),
- addk,addm,
- ncpol[3]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ncpol[3]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0);
if(!tgtepol[1].IsNull()){
ntpol[1] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[1],0,
- tgtepol[1]->Array1(),PLib::NoWeights(),
+ tgtepol[1]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(),
- addk,addm,
- ntpol[1]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ntpol[1]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0);
}
if(!tgtepol[3].IsNull()){
ntpol[3] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[1],0,
- tgtepol[3]->Array1(),PLib::NoWeights(),
+ tgtepol[3]->Array1(),BSplCLib::NoWeights(),
knots[1]->Array1(),mults[1]->Array1(),
- addk,addm,
- ntpol[3]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ntpol[3]->ChangeArray1(),BSplCLib::NoWeights(),
nk[1]->ChangeArray1(),nm[1]->ChangeArray1(),
tolk,0);
}
if(BSplCLib::PrepareInsertKnots(degree[0],0,
knots[0]->Array1(),
mults[0]->Array1(),
- addk,addm,nbnp,nbnk,tolk,0)){
+ addk,&addm,nbnp,nbnk,tolk,0)){
nm[0] = new TColStd_HArray1OfInteger(1,nbnk);
nk[0] = new TColStd_HArray1OfReal(1,nbnk);
ncpol[0] = new TColgp_HArray1OfPnt(1,nbnp);
ncpol[2] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[0],0,
- curvpol[0]->Array1(),PLib::NoWeights(),
+ curvpol[0]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(),
- addk,addm,
- ncpol[0]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ncpol[0]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0);
BSplCLib::InsertKnots(degree[0],0,
- curvpol[2]->Array1(),PLib::NoWeights(),
+ curvpol[2]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(),
- addk,addm,
- ncpol[2]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ncpol[2]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0);
if(!tgtepol[0].IsNull()){
ntpol[0] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[0],0,
- tgtepol[0]->Array1(),PLib::NoWeights(),
+ tgtepol[0]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(),
- addk,addm,
- ntpol[0]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ntpol[0]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0);
}
if(!tgtepol[2].IsNull()){
ntpol[2] = new TColgp_HArray1OfPnt(1,nbnp);
BSplCLib::InsertKnots(degree[0],0,
- tgtepol[2]->Array1(),PLib::NoWeights(),
+ tgtepol[2]->Array1(),BSplCLib::NoWeights(),
knots[0]->Array1(),mults[0]->Array1(),
- addk,addm,
- ntpol[2]->ChangeArray1(),PLib::NoWeights(),
+ addk,&addm,
+ ntpol[2]->ChangeArray1(),BSplCLib::NoWeights(),
nk[0]->ChangeArray1(),nm[0]->ChangeArray1(),
tolk,0);
}
uu /= nbp;
pbound = bou->Value(uu);
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) {
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());
vbound = bou->Norm(uu);
if(vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15){
PLib::CoefficientsPoles(Coef, PLib::NoWeights(),
Pole, PLib::NoWeights());
if (NPolU > 4) {
- BSplCLib::IncreaseDegree(NPolU-1, Pole, PLib::NoWeights(),
- CoefU, PLib::NoWeights());
+ BSplCLib::IncreaseDegree(NPolU-1, Pole, BSplCLib::NoWeights(),
+ CoefU, BSplCLib::NoWeights());
}
else {
CoefU = Pole;
}
if (NPolV > 4) {
- BSplCLib::IncreaseDegree(NPolV-1, Pole, PLib::NoWeights(),
- CoefV, PLib::NoWeights());
+ BSplCLib::IncreaseDegree(NPolV-1, Pole, BSplCLib::NoWeights(),
+ CoefV, BSplCLib::NoWeights());
}
else {
CoefV = Pole;
BSurf->VDegree(),
surface_u_knots,
surface_v_knots,
- surface_u_mults,
- surface_v_mults,
+ &surface_u_mults,
+ &surface_v_mults,
surface_poles,
- surface_weights,
+ &surface_weights,
newuflatknots,
newvflatknots,
BSurf->UDegree()+3,
BSplSLib::HomogeneousD1(mySurface->UKnot(mySurface->LastUKnotIndex()),VParameter,
0,0,
surface_poles,
- surface_weights,
+ &surface_weights,
surface_u_knots,surface_v_knots,
- surface_u_mults,surface_v_mults,
+ &surface_u_mults,&surface_v_mults,
udegree,vdegree,
mySurface->IsURational(),mySurface->IsVRational(),
mySurface->IsUPeriodic(),mySurface->IsVPeriodic(),
BSplSLib::HomogeneousD1(mySurface->UKnot(1),VParameter,
0,0,
surface_poles,
- surface_weights,
+ &surface_weights,
surface_u_knots,surface_v_knots,
- surface_u_mults,surface_v_mults,
+ &surface_u_mults,&surface_v_mults,
udegree,vdegree,
mySurface->IsURational(),mySurface->IsVRational(),
mySurface->IsUPeriodic(),mySurface->IsVPeriodic(),
Index0 = BS->FirstUKnotIndex();
Index1 = BS->LastUKnotIndex()-1;
- 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(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);
TAB(0) = 1/Denom0; //Hermit coefficients
TAB(1) = -Deriv0/(Denom0*Denom0);
TAB(2) = -Deriv1/(Denom1*Denom1);
Index0 = BS->FirstUKnotIndex();
Index1 = BS->LastUKnotIndex()-1;
- 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(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);
TAB(0) = 1/Denom0; //Hermit coefficients
TAB(1) = -Deriv0/(Denom0*Denom0);
TAB(2) = -Deriv1/(Denom1*Denom1);
if (!BSplCLib::PrepareInsertKnots(deg,periodic,
knots->Array1(),mults->Array1(),
- Knots,Mults,nbpoles,nbknots,Epsilon,Add))
+ Knots,&Mults,nbpoles,nbknots,Epsilon,Add))
Standard_ConstructionError::Raise("Law_BSpline::InsertKnots");
if (nbpoles == poles->Length()) return;
TColStd_Array1OfReal adimnpol(1,2*npoles->Upper());
BSplCLib::InsertKnots(deg,periodic,2,adimpol,
knots->Array1(), mults->Array1(),
- Knots, Mults,adimnpol,
+ Knots, &Mults,adimnpol,
nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add);
GetPoles(adimnpol,npoles->ChangeArray1(),nweights->ChangeArray1());
else {
BSplCLib::InsertKnots(deg,periodic,1,poles->Array1(),
knots->Array1(), mults->Array1(),
- Knots, Mults,
+ Knots, &Mults,
npoles->ChangeArray1(),
nknots->ChangeArray1(), nmults->ChangeArray1(),
Epsilon, Add);
Standard_Real NewU = U ;
PeriodicNormalization(NewU) ;
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 {
BSplCLib::D0(NewU,0,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P);
Standard_Real NewU = U ;
PeriodicNormalization(NewU) ;
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) ;
}
else {
Standard_Real NewU = U ;
PeriodicNormalization(NewU) ;
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) ;
}
else {
Standard_Real NewU = U ;
PeriodicNormalization(NewU) ;
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) ;
}
else {
{
Standard_Real V;
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 {
BSplCLib::DN(U,N,0,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,V);
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic,FromK1,ToK2, index,u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
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 {
BSplCLib::D0(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P);
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
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 {
BSplCLib::D1(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1);
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
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 {
BSplCLib::D2(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1,V2);
BSplCLib::LocateParameter(deg, FKNOTS, U, periodic, FromK1,ToK2, index, u);
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
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 {
BSplCLib::D3(u,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,P,V1,V2,V3);
Standard_Real V;
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 {
BSplCLib::DN(u,N,index,deg,periodic,POLES,BSplCLib::NoWeights(),FKNOTS,FMULTS,V);
Standard_Real* bidr = (Standard_Real*)bid;
if (rational) {
BSplCLib::Resolution(*bidr,1,poles->Length(),
- weights->Array1(),FKNOTS,deg,
+ &weights->Array1(),FKNOTS,deg,
Tolerance3D,
UTolerance) ;
}
PLib.cxx
PLib.hxx
-PLib.lxx
PLib_Base.cxx
PLib_Base.hxx
PLib_DoubleJacobiPolynomial.cxx
//=======================================================================
void PLib::CoefficientsPoles (const TColgp_Array1OfPnt& Coefs,
- const TColStd_Array1OfReal& WCoefs,
+ const TColStd_Array1OfReal* WCoefs,
TColgp_Array1OfPnt& Poles,
- TColStd_Array1OfReal& Weights)
+ TColStd_Array1OfReal* Weights)
{
TColStd_Array1OfReal tempC(1,3*Coefs.Length());
PLib::SetPoles(Coefs,tempC);
//=======================================================================
void PLib::CoefficientsPoles (const TColgp_Array1OfPnt2d& Coefs,
- const TColStd_Array1OfReal& WCoefs,
+ const TColStd_Array1OfReal* WCoefs,
TColgp_Array1OfPnt2d& Poles,
- TColStd_Array1OfReal& Weights)
+ TColStd_Array1OfReal* Weights)
{
TColStd_Array1OfReal tempC(1,2*Coefs.Length());
PLib::SetPoles(Coefs,tempC);
//=======================================================================
void PLib::CoefficientsPoles (const TColStd_Array1OfReal& Coefs,
- const TColStd_Array1OfReal& WCoefs,
+ const TColStd_Array1OfReal* WCoefs,
TColStd_Array1OfReal& Poles,
- TColStd_Array1OfReal& Weights)
+ TColStd_Array1OfReal* Weights)
{
PLib::CoefficientsPoles(1,Coefs,WCoefs,Poles,Weights);
}
void PLib::CoefficientsPoles (const Standard_Integer dim,
const TColStd_Array1OfReal& Coefs,
- const TColStd_Array1OfReal& WCoefs,
+ const TColStd_Array1OfReal* WCoefs,
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 lop = Poles.Lower();
Standard_Integer lowc=0;
Standard_Integer i,j,k;
//Les Extremites.
if (rat) {
- lowc = WCoefs.Lower(); lowp = Weights.Lower();
- upwc = WCoefs.Upper(); upwp = Weights.Upper();
+ lowc = WCoefs->Lower(); lowp = Weights->Lower();
+ upwc = WCoefs->Upper(); upwp = Weights->Upper();
}
for (i = 0; i < dim; i++){
Poles (upp - i) = Coefs (upc - i);
}
if (rat) {
- Weights (lowp) = WCoefs (lowc);
- Weights (upwp) = WCoefs (upwc);
+ (*Weights) (lowp) = (*WCoefs) (lowc);
+ (*Weights) (upwp) = (*WCoefs) (upwc);
}
Standard_Real Cnp;
for (i = 2; i < reflen; i++ ) {
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++){
Poles(lop + dim * (i-1) + j)= Coefs(loc + dim * (i-1) + j) / Cnp;
for (i = 1; i <= reflen - 1; i++) {
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++){
Poles(lop + dim * j + k) += Poles(lop + dim * (j - 1) + k);
for (i = 1; i <= reflen; i++) {
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);
}
}
}
void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2,
TColgp_Array1OfPnt& Coefs,
- TColStd_Array1OfReal& WCoefs)
+ TColStd_Array1OfReal* WCoefs)
{
TColStd_Array1OfReal temp(1,3*Coefs.Length());
PLib::SetPoles(Coefs,temp);
void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2,
TColgp_Array1OfPnt2d& Coefs,
- TColStd_Array1OfReal& WCoefs)
+ TColStd_Array1OfReal* WCoefs)
{
TColStd_Array1OfReal temp(1,2*Coefs.Length());
PLib::SetPoles(Coefs,temp);
void PLib::Trimming(const Standard_Real U1,
const Standard_Real U2,
TColStd_Array1OfReal& Coefs,
- TColStd_Array1OfReal& WCoefs)
+ TColStd_Array1OfReal* WCoefs)
{
PLib::Trimming(U1,U2,1,Coefs,WCoefs);
}
const Standard_Real U2,
const Standard_Integer dim,
TColStd_Array1OfReal& Coefs,
- TColStd_Array1OfReal& WCoefs)
+ TColStd_Array1OfReal* WCoefs)
{
// principe :
Standard_Integer indc, indw=0;
Standard_Integer upc = Coefs.Upper() - dim + 1, upw=0;
Standard_Integer len = Coefs.Length()/dim;
- Standard_Boolean rat = &WCoefs != NULL;
+ Standard_Boolean rat = WCoefs != NULL;
if (rat) {
- if(len != WCoefs.Length())
+ if(len != WCoefs->Length())
Standard_Failure::Raise("PLib::Trimming : nbcoefs/dim != nbweights !!!");
- upw = WCoefs.Upper();
+ upw = WCoefs->Upper();
}
len --;
for( j = 0; j < dim; 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 :
}
if (rat) {
indw ++;
- WCoefs(indw - 1) = U1 * WCoefs(indw) + lsp * WCoefs(indw - 1);
+ (*WCoefs)(indw - 1) = U1 * (*WCoefs)(indw) + lsp * (*WCoefs)(indw - 1);
}
}
for(j = 0; j < dim; j++){
Coefs(upc + j) *= lsp;
}
- if (rat) WCoefs(upw) *= lsp;
+ if (rat) (*WCoefs)(upw) *= lsp;
}
}
//=======================================================================
void PLib::CoefficientsPoles (const TColgp_Array2OfPnt& Coefs,
- const TColStd_Array2OfReal& WCoefs,
+ const TColStd_Array2OfReal* WCoefs,
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 UpperRow = Poles.UpperRow();
Standard_Integer LowerCol = Poles.LowerCol();
for (NPoleu = LowerRow; NPoleu <= UpperRow; NPoleu++){
Poles (NPoleu, LowerCol) = Coefs (NPoleu, LowerCol);
if (rat) {
- Weights (NPoleu, LowerCol) = WCoefs (NPoleu, LowerCol);
+ (*Weights) (NPoleu, LowerCol) = (*WCoefs) (NPoleu, LowerCol);
}
for (Col = LowerCol + 1; Col <= UpperCol - 1; Col++) {
Temp.Divide (Cnp);
Poles (NPoleu, Col).SetXYZ (Temp);
if (rat) {
- Weights (NPoleu, Col) = WCoefs (NPoleu, Col) / Cnp;
+ (*Weights) (NPoleu, Col) = (*WCoefs) (NPoleu, Col) / Cnp;
}
}
Poles (NPoleu, UpperCol) = Coefs (NPoleu, UpperCol);
if (rat) {
- Weights (NPoleu, UpperCol) = WCoefs (NPoleu, UpperCol);
+ (*Weights) (NPoleu, UpperCol) = (*WCoefs) (NPoleu, UpperCol);
}
for (I1 = 1; I1 <= RowLength - 1; I1++) {
Temp.SetLinearForm
(Poles (NPoleu, I2).XYZ(), Poles (NPoleu, I2-1).XYZ());
Poles (NPoleu, I2).SetXYZ (Temp);
- if (rat) Weights(NPoleu, I2) += Weights(NPoleu, I2-1);
+ if (rat) (*Weights)(NPoleu, I2) += (*Weights)(NPoleu, I2-1);
}
}
}
Temp = Poles (Row, NPolev).XYZ();
Temp.Divide (Cnp);
Poles (Row, NPolev).SetXYZ (Temp);
- if (rat) Weights(Row, NPolev) /= Cnp;
+ if (rat) (*Weights)(Row, NPolev) /= Cnp;
}
for (I1 = 1; I1 <= ColLength - 1; I1++) {
Temp.SetLinearForm
(Poles (I2, NPolev).XYZ(), Poles (I2-1, NPolev).XYZ());
Poles (I2, NPolev).SetXYZ (Temp);
- if (rat) Weights(I2, NPolev) += Weights(I2-1, NPolev);
+ if (rat) (*Weights)(I2, NPolev) += (*Weights)(I2-1, NPolev);
}
}
}
for (Row = LowerRow; Row <= UpperRow; Row++) {
for (Col = LowerCol; Col <= UpperCol; Col++) {
- W = Weights (Row, Col);
+ W = (*Weights) (Row, Col);
Temp = Poles(Row, Col).XYZ();
Temp.Divide (W);
Poles(Row, Col).SetXYZ (Temp);
void PLib::UTrimming(const Standard_Real U1,
const Standard_Real U2,
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 ur = Coeffs.UpperRow();
Standard_Integer lc = Coeffs.LowerCol();
Standard_Integer irow ;
for ( irow = lr; irow <= ur; irow++) {
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());
for (irow = lr; irow <= ur; irow++) {
Coeffs (irow, icol) = Temp (irow);
- if (rat) WCoeffs (irow, icol) = Temw (irow);
+ if (rat) (*WCoeffs) (irow, icol) = Temw (irow);
}
}
}
void PLib::VTrimming(const Standard_Real V1,
const Standard_Real V2,
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 ur = Coeffs.UpperRow();
Standard_Integer lc = Coeffs.LowerCol();
Standard_Integer icol ;
for ( icol = lc; icol <= uc; 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());
for (icol = lc; icol <= uc; icol++) {
Coeffs (irow, icol) = Temp (icol);
- if (rat) WCoeffs (irow, icol) = Temw (icol);
+ if (rat) (*WCoeffs) (irow, icol) = Temw (icol);
}
}
}
//! PLib means Polynomial functions library. This pk
//! provides basic computation functions for
//! 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
{
public:
//! 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
- static TColStd_Array2OfReal& NoWeights2();
-
+ inline static TColStd_Array2OfReal* NoWeights2()
+ {
+ return NULL;
+ }
+
//! Copy in FP the coordinates of the poles.
Standard_EXPORT static void SetPoles (const TColgp_Array1OfPnt& Poles, TColStd_Array1OfReal& FP);
//! / (|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 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
//! polynomial satisfying the given constraints
};
-
-#include <PLib.lxx>
-
-
-
-
-
#endif // _PLib_HeaderFile
+++ /dev/null
-// 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 ));
-}
Standard_Integer Inc = MaxDeg - MC.Degree();
if ( Inc > 0) {
// BSplCLib::IncreaseDegree( Inc, Poles2d, PLib::NoWeights(),
- BSplCLib::IncreaseDegree( MaxDeg, Poles2d, PLib::NoWeights(),
- TempPoles, PLib::NoWeights());
+ BSplCLib::IncreaseDegree( MaxDeg, Poles2d, BSplCLib::NoWeights(),
+ TempPoles, BSplCLib::NoWeights());
//update of tops of the PCurve
for (Standard_Integer k = 1 ; k <= MaxDeg + 1; k++) {
Poles.SetValue( Compt, TempPoles( k));
//Augmentation eventuelle du degre
Standard_Integer Inc = MaxDeg - MC.Degree();
if ( Inc > 0) {
- BSplCLib::IncreaseDegree(Inc, Poles, PLib::NoWeights(),
- TempPoles, PLib::NoWeights());
+ BSplCLib::IncreaseDegree(Inc, Poles, BSplCLib::NoWeights(),
+ TempPoles, BSplCLib::NoWeights());
//mise a jour des poles de la PCurve
for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) {
Poles.SetValue( Compt, TempPoles( j));
//Augmentation eventuelle du degre
Standard_Integer Inc = MaxDeg - MC.Degree();
if ( Inc > 0) {
- BSplCLib::IncreaseDegree( Inc, LocalPoles, PLib::NoWeights(),
- TempPoles, PLib::NoWeights());
+ BSplCLib::IncreaseDegree( Inc, LocalPoles, BSplCLib::NoWeights(),
+ TempPoles, BSplCLib::NoWeights());
//mise a jour des poles de la PCurve
for (Standard_Integer j = 1 ; j <= MaxDeg + 1; j++) {
Poles.SetValue( Compt, TempPoles( j));
Inc = myDegree - Deg;
if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree,
- mySequence(i)->Array1(), PLib::NoWeights(),
- Points, PLib::NoWeights());
+ mySequence(i)->Array1(), BSplCLib::NoWeights(),
+ Points, BSplCLib::NoWeights());
}
else {
Points = mySequence(i)->Array1();
Inc = myDegree - Deg;
if ( Inc > 0) {
BSplCLib::IncreaseDegree(myDegree,
- mySequence(i)->Array1(), PLib::NoWeights(),
- Points, PLib::NoWeights());
+ mySequence(i)->Array1(), BSplCLib::NoWeights(),
+ Points, BSplCLib::NoWeights());
}
else {
Points = mySequence(i)->Array1();