Approx_SweepApproximation::Perform() now creates empty arrays.
GeomAdaptor_SurfaceOfRevolution::UTrim() - fixed No_Exception misuse.
StdPrs_ShadedShape - fixed defining an invalid reference to Poly_Triangulation::UVNodes().
BSplCLib::MovePoint() and BSplCLib::MovePointAndTangent() now take optional
weights parameter as pointer consistent to other methods like BSplCLib::BuildEval().
myDWeigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
myD2Weigths = new (TColStd_HArray1OfReal)(1, Num3DSS);
- if (Num2DSS>0) {
+ if (Num2DSS>0)
+ {
myPoles2d = new (TColgp_HArray1OfPnt2d)(1, Num2DSS);
myDPoles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
myD2Poles2d = new (TColgp_HArray1OfVec2d)(1, Num2DSS);
COnSurfErr = new (TColStd_HArray1OfReal)(1, Num2DSS);
}
+ else
+ {
+ myPoles2d = new TColgp_HArray1OfPnt2d();
+ myDPoles2d = new TColgp_HArray1OfVec2d();
+ myD2Poles2d = new TColgp_HArray1OfVec2d();
+ COnSurfErr = new TColStd_HArray1OfReal();
+ }
+
// Checks if myFunc->D2 is implemented
if (continuity >= GeomAbs_C2) {
Standard_Boolean B;
//! (3, NbPoles-2) -> the ends and the tangency are enforced
//! if Problem in BSplineBasis calculation, no change for the curve
//! and FirstIndex, LastIndex = 0
- Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec2d& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const Standard_Boolean Rational, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt2d& NewPoles);
+ Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec2d& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt2d& NewPoles);
//! Find the new poles which allows an old point (with a
//! given u as parameter) to reach a new position
//! (3, NbPoles-2) -> the ends and the tangency are enforced
//! if Problem in BSplineBasis calculation, no change for the curve
//! and FirstIndex, LastIndex = 0
- Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const Standard_Boolean Rational, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt& NewPoles);
+ Standard_EXPORT static void MovePoint (const Standard_Real U, const gp_Vec& Displ, const Standard_Integer Index1, const Standard_Integer Index2, const Standard_Integer Degree, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Integer& FirstIndex, Standard_Integer& LastIndex, TColgp_Array1OfPnt& NewPoles);
//! This is the dimension free version of the utility
//! U is the parameter must be within the first FlatKnots and the
//! = ...
//! Same holds for EndingCondition
//! Poles are the poles of the curve
- //! Weights are the weights of the curve if Rational = Standard_True
+ //! Weights are the weights of the curve if not NULL
//! NewPoles are the poles of the deformed curve
//! ErrorStatus will be 0 if no error happened
//! 1 if there are not enough knots/poles
//! If StartCondition = 1 and EndCondition = 1 then you need at least
//! 4 + 2 = 6 poles so for example to have a C1 cubic you will need
//! have at least 2 internal knots.
- Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const Standard_Integer ArrayDimension, Standard_Real& Delta, Standard_Real& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Boolean Rational, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, Standard_Real& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Real& NewPoles, Standard_Integer& ErrorStatus);
+ Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const Standard_Integer ArrayDimension, Standard_Real& Delta, Standard_Real& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, Standard_Real& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, Standard_Real& NewPoles, Standard_Integer& ErrorStatus);
//! This is the dimension free version of the utility
//! U is the parameter must be within the first FlatKnots and the
//! = ...
//! Same holds for EndingCondition
//! Poles are the poles of the curve
- //! Weights are the weights of the curve if Rational = Standard_True
+ //! Weights are the weights of the curve if not NULL
//! NewPoles are the poles of the deformed curve
//! ErrorStatus will be 0 if no error happened
//! 1 if there are not enough knots/poles
//! If StartCondition = 1 and EndCondition = 1 then you need at least
//! 4 + 2 = 6 poles so for example to have a C1 cubic you will need
//! have at least 2 internal knots.
- Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec& Delta, const gp_Vec& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Boolean Rational, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt& NewPoles, Standard_Integer& ErrorStatus);
+ Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec& Delta, const gp_Vec& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt& NewPoles, Standard_Integer& ErrorStatus);
//! This is the dimension free version of the utility
//! U is the parameter must be within the first FlatKnots and the
//! = ...
//! Same holds for EndingCondition
//! Poles are the poles of the curve
- //! Weights are the weights of the curve if Rational = Standard_True
+ //! Weights are the weights of the curve if not NULL
//! NewPoles are the poles of the deformed curve
//! ErrorStatus will be 0 if no error happened
//! 1 if there are not enough knots/poles
//! If StartCondition = 1 and EndCondition = 1 then you need at least
//! 4 + 2 = 6 poles so for example to have a C1 cubic you will need
//! have at least 2 internal knots.
- Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec2d& Delta, const gp_Vec2d& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Boolean Rational, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal& Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt2d& NewPoles, Standard_Integer& ErrorStatus);
+ Standard_EXPORT static void MovePointAndTangent (const Standard_Real U, const gp_Vec2d& Delta, const gp_Vec2d& DeltaDerivative, const Standard_Real Tolerance, const Standard_Integer Degree, const Standard_Integer StartingCondition, const Standard_Integer EndingCondition, const TColgp_Array1OfPnt2d& Poles, const TColStd_Array1OfReal* Weights, const TColStd_Array1OfReal& FlatKnots, TColgp_Array1OfPnt2d& NewPoles, Standard_Integer& ErrorStatus);
//! given a tolerance in 3D space returns a
Standard_Real &DeltaDerivatives,
const Standard_Real Tolerance,
const Standard_Integer Degree,
- const Standard_Boolean Rational,
const Standard_Integer StartingCondition,
const Standard_Integer EndingCondition,
Standard_Real& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& FlatKnots,
Standard_Real& NewPoles,
Standard_Integer& ErrorStatus)
ErrorStatus = 0 ;
weights_array = NULL ;
- if (Rational) {
- weights_array = (Standard_Real *) &Weights(Weights.Lower()) ;
+ if (Weights != NULL) {
+ weights_array = const_cast<Standard_Real*>(&Weights->First());
}
poles_array = &Poles ;
extrap_mode[0] = Degree ;
extrap_mode[1] = Degree ;
- if (Rational) {
+ if (Weights != NULL) {
//
// evaluate in homogenised form
//
const Standard_Integer Index1,
const Standard_Integer Index2,
const Standard_Integer Degree,
- const Standard_Boolean Rational,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& FlatKnots,
Standard_Integer& FirstIndex,
Standard_Integer& LastIndex,
for (i = 1; i <= Degree+1; i++) {
ii = i + FirstNonZeroBsplineIndex - 1;
- if (Rational) {
- hN = Weights(ii)*BSplineBasis(1, i);
+ if (Weights != NULL) {
+ hN = Weights->Value(ii)*BSplineBasis(1, i);
D2 += hN;
}
else {
}
}
- if (Rational) {
+ if (Weights != NULL) {
Coef = D2/D1;
}
else {
const Vector& DeltaDerivatives,
const Standard_Real Tolerance,
const Standard_Integer Degree,
- const Standard_Boolean Rational,
const Standard_Integer StartingCondition,
const Standard_Integer EndingCondition,
const Array1OfPoints& Poles,
- const TColStd_Array1OfReal& Weights,
+ const TColStd_Array1OfReal* Weights,
const TColStd_Array1OfReal& FlatKnots,
Array1OfPoints& NewPoles,
Standard_Integer & ErrorStatus)
delta_derivative_array[0],
Tolerance,
Degree,
- Rational,
StartingCondition,
EndingCondition,
poles_array[0],
new TColStd_HArray1OfInteger(1,nbknots);
Handle(TColStd_HArray1OfReal) nweights;
-
- if (IsRational()) {
-
+ if (IsRational())
+ {
nweights = new TColStd_HArray1OfReal(1,npoles->Upper());
-
- BSplCLib::IncreaseDegree
- (deg,Degree, periodic,
- poles->Array1(),&weights->Array1(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),&nweights->ChangeArray1(),
- nknots->ChangeArray1(),nmults->ChangeArray1());
}
- else {
- BSplCLib::IncreaseDegree
- (deg,Degree, periodic,
- poles->Array1(),BSplCLib::NoWeights(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),
- BSplCLib::NoWeights(),
- nknots->ChangeArray1(),nmults->ChangeArray1());
- }
-
+ BSplCLib::IncreaseDegree (deg, Degree, periodic,
+ poles->Array1(), !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), mults->Array1(),
+ npoles->ChangeArray1(), !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights(),
+ nknots->ChangeArray1(),nmults->ChangeArray1());
deg = Degree;
poles = npoles;
weights = nweights;
knots = nknots;
mults = nmults;
UpdateKnots();
-
}
//=======================================================================
nmults = new TColStd_HArray1OfInteger(1,nbknots);
}
- if (rational) {
- Handle(TColStd_HArray1OfReal) nweights =
- new TColStd_HArray1OfReal(1,nbpoles);
- BSplCLib::InsertKnots(deg,periodic,
- poles->Array1(), &weights->Array1(),
- knots->Array1(), mults->Array1(),
- Knots, &Mults,
- npoles->ChangeArray1(), &nweights->ChangeArray1(),
- nknots->ChangeArray1(), nmults->ChangeArray1(),
- Epsilon, Add);
- weights = nweights;
- }
- else {
- BSplCLib::InsertKnots(deg,periodic,
- poles->Array1(), BSplCLib::NoWeights(),
- knots->Array1(), mults->Array1(),
- Knots, &Mults,
- npoles->ChangeArray1(),
- BSplCLib::NoWeights(),
- nknots->ChangeArray1(), nmults->ChangeArray1(),
- Epsilon, Add);
+ Handle(TColStd_HArray1OfReal) nweights;
+ if (rational)
+ {
+ nweights = new TColStd_HArray1OfReal(1,nbpoles);
}
+ BSplCLib::InsertKnots (deg, periodic,
+ poles->Array1(), !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), mults->Array1(),
+ Knots, &Mults,
+ npoles->ChangeArray1(), !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights(),
+ nknots->ChangeArray1(), nmults->ChangeArray1(),
+ Epsilon, Add);
+ weights = nweights;
poles = npoles;
knots = nknots;
mults = nmults;
UpdateKnots();
-
}
//=======================================================================
nmults = new TColStd_HArray1OfInteger(1,knots->Length()-1);
}
- if (IsRational()) {
- Handle(TColStd_HArray1OfReal) nweights =
- new TColStd_HArray1OfReal(1,npoles->Length());
- if (!BSplCLib::RemoveKnot
- (Index, M, deg, periodic,
- poles->Array1(),&weights->Array1(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(), &nweights->ChangeArray1(),
- nknots->ChangeArray1(),nmults->ChangeArray1(),
- Tolerance))
- return Standard_False;
- weights = nweights;
+ Handle(TColStd_HArray1OfReal) nweights;
+ if (IsRational())
+ {
+ nweights = new TColStd_HArray1OfReal(1,npoles->Length());
}
- else {
- if (!BSplCLib::RemoveKnot
- (Index, M, deg, periodic,
- poles->Array1(), BSplCLib::NoWeights(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),
- BSplCLib::NoWeights(),
- nknots->ChangeArray1(),nmults->ChangeArray1(),
- Tolerance))
- return Standard_False;
+
+ if (!BSplCLib::RemoveKnot (Index, M, deg, periodic,
+ poles->Array1(), !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(),mults->Array1(),
+ npoles->ChangeArray1(), !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights(),
+ nknots->ChangeArray1(),nmults->ChangeArray1(),
+ Tolerance))
+ {
+ return Standard_False;
}
-
+
+ weights = nweights;
poles = npoles;
knots = nknots;
mults = nmults;
= new TColStd_HArray1OfInteger(1,NbKnots);
Handle(TColStd_HArray1OfReal) nweights;
-
- if (IsRational()) {
-
+ if (IsRational())
+ {
nweights = new TColStd_HArray1OfReal(1,NbPoles);
-
- BSplCLib::Unperiodize
- (deg,mults->Array1(),knots->Array1(),poles->Array1(),
- &weights->Array1(),nmults->ChangeArray1(),
- nknots->ChangeArray1(),npoles->ChangeArray1(),
- &nweights->ChangeArray1());
-
- }
- else {
-
- BSplCLib::Unperiodize
- (deg,mults->Array1(),knots->Array1(),poles->Array1(),
- BSplCLib::NoWeights(),nmults->ChangeArray1(),
- nknots->ChangeArray1(),npoles->ChangeArray1(),
- BSplCLib::NoWeights());
-
}
+
+ BSplCLib::Unperiodize (deg,
+ mults->Array1(), knots->Array1(), poles->Array1(),
+ !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ nmults->ChangeArray1(), nknots->ChangeArray1(), npoles->ChangeArray1(),
+ !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights());
poles = npoles;
weights = nweights;
mults = nmults;
gp_Pnt P0;
D0(U, P0);
gp_Vec Displ(P0, P);
- BSplCLib::MovePoint(U, Displ, Index1, Index2, deg, rational, poles->Array1(),
- weights->Array1(), flatknots->Array1(),
- FirstModifiedPole, LastmodifiedPole, npoles);
+ BSplCLib::MovePoint (U, Displ, Index1, Index2, deg, poles->Array1(),
+ rational ? &weights->Array1() : BSplCLib::NoWeights(), flatknots->Array1(),
+ FirstModifiedPole, LastmodifiedPole, npoles);
if (FirstModifiedPole) {
poles->ChangeArray1() = npoles;
maxderivinvok = 0;
delta_derivative,
Tolerance,
deg,
- rational,
StartingCondition,
EndingCondition,
poles->Array1(),
- weights->Array1(),
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
flatknots->Array1(),
new_poles,
ErrorStatus) ;
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(),
- P);
- }
- else
- {
- BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P);
- }
+
+ BSplCLib::D0 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P);
}
//=======================================================================
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(),
- P, V1);
- }
- else
- {
- BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P, V1);
- }
+
+ BSplCLib::D1 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P, V1);
}
//=======================================================================
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(),
- P, V1, V2);
- }
- else
- {
- BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P, V1, V2);
- }
+
+ BSplCLib::D2 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P, V1, V2);
}
//=======================================================================
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(),
- P, V1, V2, V3);
- }
- else
- {
- BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P, V1, V2, V3);
- }
+
+ BSplCLib::D3 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P, V1, V2, V3);
}
//=======================================================================
const Standard_Integer N) const
{
gp_Vec V;
- if (rational) {
- 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::DN (U, N, 0, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, V);
return V;
}
Standard_Integer index = 0;
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);
- }
- else {
- BSplCLib::D0(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P);
- }
+ BSplCLib::D0 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, P);
}
//=======================================================================
Standard_Integer index = 0;
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);
- }
- else {
- BSplCLib::D1(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P,V1);
- }
+ BSplCLib::D1 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS,FMULTS,P,V1);
}
//=======================================================================
Standard_Integer index = 0;
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);
- }
- else {
- BSplCLib::D2(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P,V1,V2);
- }
+ BSplCLib::D2 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, P, V1, V2);
}
//=======================================================================
Standard_Integer index = 0;
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);
- }
- else {
- BSplCLib::D3(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P,V1,V2,V3);
- }
+ BSplCLib::D3 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, P, V1, V2, V3);
}
//=======================================================================
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
gp_Vec V;
- if (rational) {
- 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);
- }
+ BSplCLib::DN (u, N, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, V);
return V;
}
//purpose :
//=======================================================================
-void Geom_BSplineCurve::Resolution(const Standard_Real Tolerance3D,
- Standard_Real & UTolerance)
+void Geom_BSplineCurve::Resolution (const Standard_Real Tolerance3D,
+ Standard_Real& UTolerance)
{
- Standard_Integer ii;
- if(!maxderivinvok){
- if ( periodic) {
+ if (!maxderivinvok)
+ {
+ if (periodic)
+ {
Standard_Integer NbKnots, NbPoles;
- BSplCLib::PrepareUnperiodize( deg,
- mults->Array1(),
- NbKnots,
- NbPoles);
- TColgp_Array1OfPnt new_poles(1,NbPoles) ;
- TColStd_Array1OfReal new_weights(1,NbPoles) ;
- for(ii = 1 ; ii <= NbPoles ; ii++) {
- new_poles(ii) = poles->Array1()((ii-1) % poles->Length() + 1) ;
- }
- if (rational) {
- for(ii = 1 ; ii <= NbPoles ; ii++) {
- new_weights(ii) = weights->Array1()((ii-1) % poles->Length() + 1) ;
- }
- BSplCLib::Resolution(new_poles,
- &new_weights,
- new_poles.Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
+ BSplCLib::PrepareUnperiodize (deg, mults->Array1(), NbKnots, NbPoles);
+ TColgp_Array1OfPnt new_poles (1, NbPoles);
+ TColStd_Array1OfReal new_weights(1, NbPoles);
+ for (Standard_Integer ii = 1; ii <= NbPoles; ii++)
+ {
+ new_poles(ii) = poles->Array1()((ii-1) % poles->Length() + 1);
}
- else {
- BSplCLib::Resolution(new_poles,
- BSplCLib::NoWeights(),
- new_poles.Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
+ if (rational)
+ {
+ for (Standard_Integer ii = 1; ii <= NbPoles; ii++)
+ {
+ new_weights(ii) = weights->Array1()((ii-1) % poles->Length() + 1);
+ }
}
-
+ BSplCLib::Resolution (new_poles,
+ rational ? &new_weights : BSplCLib::NoWeights(),
+ new_poles.Length(),
+ flatknots->Array1(),
+ deg,
+ 1.,
+ maxderivinv);
}
- else {
- if (rational) {
- BSplCLib::Resolution(poles->Array1(),
- &weights->Array1(),
- poles->Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
- }
- else {
- BSplCLib::Resolution(poles->Array1(),
- BSplCLib::NoWeights(),
- poles->Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
- }
+ else
+ {
+ BSplCLib::Resolution (poles->Array1(),
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ poles->Length(),
+ flatknots->Array1(),
+ deg,
+ 1.,
+ maxderivinv);
}
maxderivinvok = 1;
}
Handle(TColStd_HArray1OfReal) nweights;
if (IsRational()) {
-
nweights = new TColStd_HArray1OfReal(1,npoles->Upper());
-
- BSplCLib::IncreaseDegree
- (deg,Degree, periodic,
- poles->Array1(),&weights->Array1(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),&nweights->ChangeArray1(),
- nknots->ChangeArray1(),nmults->ChangeArray1());
}
- else {
- BSplCLib::IncreaseDegree
- (deg,Degree, periodic,
- poles->Array1(),
- BSplCLib::NoWeights(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),
- BSplCLib::NoWeights(),
- nknots->ChangeArray1(),nmults->ChangeArray1());
- }
+ BSplCLib::IncreaseDegree (deg, Degree, periodic,
+ poles->Array1(), !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), mults->Array1(),
+ npoles->ChangeArray1(), !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights(),
+ nknots->ChangeArray1(), nmults->ChangeArray1());
deg = Degree;
poles = npoles;
nmults = new TColStd_HArray1OfInteger(1,nbknots);
}
- if (rational) {
- Handle(TColStd_HArray1OfReal) nweights =
- new TColStd_HArray1OfReal(1,nbpoles);
- BSplCLib::InsertKnots(deg,periodic,
- poles->Array1(), &weights->Array1(),
- knots->Array1(), mults->Array1(),
- Knots, &Mults,
- npoles->ChangeArray1(), &nweights->ChangeArray1(),
- nknots->ChangeArray1(), nmults->ChangeArray1(),
- Epsilon,Add);
- weights = nweights;
- }
- else {
- BSplCLib::InsertKnots(deg,periodic,
- poles->Array1(),
- BSplCLib::NoWeights(),
- knots->Array1(), mults->Array1(),
- Knots, &Mults,
- npoles->ChangeArray1(),
- BSplCLib::NoWeights(),
- nknots->ChangeArray1(), nmults->ChangeArray1(),
- Epsilon,Add);
+ Handle(TColStd_HArray1OfReal) nweights;
+ if (rational)
+ {
+ nweights = new TColStd_HArray1OfReal (1, nbpoles);
}
+ BSplCLib::InsertKnots (deg, periodic,
+ poles->Array1(), !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), mults->Array1(),
+ Knots, &Mults,
+ npoles->ChangeArray1(), !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights(),
+ nknots->ChangeArray1(), nmults->ChangeArray1(),
+ Epsilon, Add);
+ weights = nweights;
poles = npoles;
knots = nknots;
mults = nmults;
UpdateKnots();
-
}
//=======================================================================
nmults = new TColStd_HArray1OfInteger(1,knots->Length()-1);
}
- if (IsRational()) {
- Handle(TColStd_HArray1OfReal) nweights =
- new TColStd_HArray1OfReal(1,npoles->Length());
- if (!BSplCLib::RemoveKnot
- (Index, M, deg, periodic,
- poles->Array1(),&weights->Array1(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(), &nweights->ChangeArray1(),
- nknots->ChangeArray1(),nmults->ChangeArray1(),
- Tolerance))
- return Standard_False;
- weights = nweights;
+ Handle(TColStd_HArray1OfReal) nweights;
+ if (IsRational())
+ {
+ nweights = new TColStd_HArray1OfReal(1,npoles->Length());
}
- else {
- if (!BSplCLib::RemoveKnot
- (Index, M, deg, periodic,
- poles->Array1(),
- BSplCLib::NoWeights(),
- knots->Array1(),mults->Array1(),
- npoles->ChangeArray1(),
- BSplCLib::NoWeights(),
- nknots->ChangeArray1(),nmults->ChangeArray1(),
- Tolerance))
- return Standard_False;
+
+ if (!BSplCLib::RemoveKnot (Index, M, deg, periodic,
+ poles->Array1(), !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(),mults->Array1(),
+ npoles->ChangeArray1(), !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights(),
+ nknots->ChangeArray1(),nmults->ChangeArray1(),
+ Tolerance))
+ {
+ return Standard_False;
}
-
+
+ weights = nweights;
poles = npoles;
knots = nknots;
mults = nmults;
= new TColStd_HArray1OfInteger(1,NbKnots);
Handle(TColStd_HArray1OfReal) nweights;
-
if (IsRational()) {
-
nweights = new TColStd_HArray1OfReal(1,NbPoles);
-
- BSplCLib::Unperiodize
- (deg,mults->Array1(),knots->Array1(),poles->Array1(),
- &weights->Array1(),nmults->ChangeArray1(),
- nknots->ChangeArray1(),npoles->ChangeArray1(),
- &nweights->ChangeArray1());
-
- }
- else {
-
- BSplCLib::Unperiodize
- (deg,mults->Array1(),knots->Array1(),poles->Array1(),
- BSplCLib::NoWeights(),nmults->ChangeArray1(),
- nknots->ChangeArray1(),npoles->ChangeArray1(),
- BSplCLib::NoWeights());
-
}
+
+ BSplCLib::Unperiodize (deg,
+ mults->Array1(), knots->Array1(), poles->Array1(),
+ !nweights.IsNull() ? &weights->Array1() : BSplCLib::NoWeights(),
+ nmults->ChangeArray1(), nknots->ChangeArray1(), npoles->ChangeArray1(),
+ !nweights.IsNull() ? &nweights->ChangeArray1() : BSplCLib::NoWeights());
poles = npoles;
weights = nweights;
mults = nmults;
gp_Pnt2d P0;
D0(U, P0);
gp_Vec2d Displ(P0, P);
- BSplCLib::MovePoint(U, Displ, Index1, Index2, deg, rational, poles->Array1(),
- weights->Array1(), flatknots->Array1(),
- FirstModifiedPole, LastmodifiedPole, npoles);
+
+ BSplCLib::MovePoint (U, Displ, Index1, Index2, deg, poles->Array1(),
+ rational ? &weights->Array1() : BSplCLib::NoWeights(), flatknots->Array1(),
+ FirstModifiedPole, LastmodifiedPole, npoles);
if (FirstModifiedPole) {
poles->ChangeArray1() = npoles;
maxderivinvok = 0;
delta_derivative.SetCoord(ii,
Tangent.Coord(ii)- delta_derivative.Coord(ii)) ;
}
- BSplCLib::MovePointAndTangent(U,
- delta,
- delta_derivative,
- Tolerance,
- deg,
- rational,
- StartingCondition,
- EndingCondition,
- poles->Array1(),
- weights->Array1(),
- flatknots->Array1(),
- new_poles,
- ErrorStatus) ;
+
+ BSplCLib::MovePointAndTangent (U,
+ delta,
+ delta_derivative,
+ Tolerance,
+ deg,
+ StartingCondition,
+ EndingCondition,
+ poles->Array1(),
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ flatknots->Array1(),
+ new_poles,
+ ErrorStatus);
if (!ErrorStatus) {
poles->ChangeArray1() = new_poles;
maxderivinvok = 0;
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(),
- P);
- }
- else
- {
- BSplCLib::D0(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P);
- }
+
+ BSplCLib::D0 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P);
}
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(),
- P, V1);
- }
- else
- {
- BSplCLib::D1(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P, V1);
- }
+
+ BSplCLib::D1 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P, V1);
}
//=======================================================================
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(),
- P, V1, V2);
- }
- else
- {
- BSplCLib::D2(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P, V1, V2);
- }
+
+ BSplCLib::D2 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P, V1, V2);
}
//=======================================================================
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(),
- P, V1, V2, V3);
- }
- else
- {
- BSplCLib::D3(aNewU,aSpanIndex,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- knots->Array1(), &mults->Array1(),
- P, V1, V2, V3);
- }
+
+ BSplCLib::D3 (aNewU, aSpanIndex, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ knots->Array1(), &mults->Array1(),
+ P, V1, V2, V3);
}
//=======================================================================
const Standard_Integer N) const
{
gp_Vec2d V;
-
- if ( rational ) {
- 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::DN (U, N, 0, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, V);
return 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);
- }
- else {
- BSplCLib::D0(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P);
- }
+ BSplCLib::D0 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : 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);
- }
- else {
- BSplCLib::D1(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P,V1);
- }
+ BSplCLib::D1 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : 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);
- }
- else {
- BSplCLib::D2(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P,V1,V2);
- }
+ BSplCLib::D2 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : 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);
- }
- else {
- BSplCLib::D3(u,index,deg,periodic,POLES,
- BSplCLib::NoWeights(),
- FKNOTS,FMULTS,P,V1,V2,V3);
- }
+ BSplCLib::D3 (u, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, P, V1, V2, V3);
}
//=======================================================================
index = BSplCLib::FlatIndex(deg,index,mults->Array1(),periodic);
gp_Vec2d V;
-
- if ( rational ) {
- 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);
- }
+ BSplCLib::DN (u, N, index, deg, periodic, POLES,
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ FKNOTS, FMULTS, V);
return V;
}
//purpose :
//=======================================================================
-void Geom2d_BSplineCurve::Resolution(const Standard_Real ToleranceUV,
- Standard_Real & UTolerance)
+void Geom2d_BSplineCurve::Resolution (const Standard_Real ToleranceUV,
+ Standard_Real& UTolerance)
{
- Standard_Integer ii ;
- if(!maxderivinvok){
- if ( periodic) {
+ if (!maxderivinvok)
+ {
+ if (periodic)
+ {
Standard_Integer NbKnots, NbPoles;
- BSplCLib::PrepareUnperiodize( deg,
- mults->Array1(),
- NbKnots,
- NbPoles);
- TColgp_Array1OfPnt2d new_poles(1,NbPoles) ;
- TColStd_Array1OfReal new_weights(1,NbPoles) ;
- for(ii = 1 ; ii <= NbPoles ; ii++) {
- new_poles(ii) = poles->Array1()(((ii-1) % poles->Length()) + 1) ;
- }
- if (rational) {
- for(ii = 1 ; ii <= NbPoles ; ii++) {
- new_weights(ii) = weights->Array1()(((ii-1) % poles->Length()) + 1) ;
- }
- BSplCLib::Resolution(new_poles,
- &new_weights,
- new_poles.Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
+ BSplCLib::PrepareUnperiodize (deg, mults->Array1(), NbKnots, NbPoles);
+ TColgp_Array1OfPnt2d new_poles (1, NbPoles);
+ TColStd_Array1OfReal new_weights (1, NbPoles);
+ for (Standard_Integer ii = 1; ii <= NbPoles ; ii++)
+ {
+ new_poles (ii) = poles->Array1()(((ii-1) % poles->Length()) + 1);
}
- else {
- BSplCLib::Resolution(new_poles,
- BSplCLib::NoWeights(),
- new_poles.Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
+ if (rational)
+ {
+ for (Standard_Integer ii = 1; ii <= NbPoles; ii++)
+ {
+ new_weights (ii) = weights->Array1()(((ii-1) % poles->Length()) + 1);
+ }
}
+ BSplCLib::Resolution (new_poles,
+ rational ? &new_weights : BSplCLib::NoWeights(),
+ new_poles.Length(),
+ flatknots->Array1(),
+ deg,
+ 1.,
+ maxderivinv);
}
- else {
- if (rational) {
- BSplCLib::Resolution(poles->Array1(),
- &weights->Array1(),
- poles->Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
- }
- else {
- BSplCLib::Resolution(poles->Array1(),
- BSplCLib::NoWeights(),
- poles->Length(),
- flatknots->Array1(),
- deg,
- 1.,
- maxderivinv) ;
- }
+ else
+ {
+ BSplCLib::Resolution (poles->Array1(),
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ poles->Length(),
+ flatknots->Array1(),
+ deg,
+ 1.,
+ maxderivinv);
}
maxderivinvok = 1;
}
//purpose :
//=======================================================================
-Handle(Adaptor3d_HSurface) GeomAdaptor_SurfaceOfRevolution::UTrim
-(const Standard_Real
-#ifndef No_Exception
- First
-#endif
- ,const Standard_Real
-#ifndef No_Exception
- Last
-#endif
- ,const Standard_Real
- ) const
-{
-#ifndef No_Exception
- Standard_Real Eps = Precision::PConfusion();
-#endif
+Handle(Adaptor3d_HSurface) GeomAdaptor_SurfaceOfRevolution::UTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
+{
+ const Standard_Real Eps = Precision::PConfusion();
+ (void )Eps; (void )First; (void )Last; (void )Tol;
Standard_OutOfRange_Raise_if
( Abs(First) > Eps || Abs(Last - 2.*M_PI) > Eps,
"GeomAdaptor_SurfaceOfRevolution : UTrim : Parameters out of range");
&poles->Array1()(1) ;
new_poles_array = (Standard_Real *)
&new_poles(1) ;
- BSplCLib::MovePointAndTangent(U,
- dimension,
- delta,
- delta_derivative,
- Tolerance,
- deg,
- rational,
- StartingCondition,
- EndingCondition,
- poles_array[0],
- weights->Array1(),
- flatknots->Array1(),
- new_poles_array[0],
- ErrorStatus) ;
+ BSplCLib::MovePointAndTangent (U,
+ dimension,
+ delta,
+ delta_derivative,
+ Tolerance,
+ deg,
+ StartingCondition,
+ EndingCondition,
+ poles_array[0],
+ rational ? &weights->Array1() : BSplCLib::NoWeights(),
+ flatknots->Array1(),
+ new_poles_array[0],
+ ErrorStatus);
if (!ErrorStatus) {
poles->ChangeArray1() = new_poles;
}
public: \
DEFINE_STANDARD_ALLOC \
DEFINE_NCOLLECTION_ALLOC \
+ HClassName () : _Array1Type_ () {} \
HClassName (const Standard_Integer theLower, \
const Standard_Integer theUpper) : \
_Array1Type_ (theLower,theUpper) {} \
// Extracts vertices & normals from nodes
const TColgp_Array1OfPnt& aNodes = aT->Nodes();
- const TColgp_Array1OfPnt2d& aUVNodes = aT->UVNodes();
+ const TColgp_Array1OfPnt2d* aUVNodes = theHasTexels && aT->HasUVNodes() && aT->UVNodes().Upper() == aNodes.Upper()
+ ? &aT->UVNodes()
+ : NULL;
StdPrs_ToolTriangulatedShape::ComputeNormals (aFace, aT);
const TShort_Array1OfShortReal& aNormals = aT->Normals();
const Standard_ShortReal* aNormArr = &aNormals.First();
aNorm.Transform (aTrsf);
}
- if (theHasTexels && aUVNodes.Upper() == aNodes.Upper())
+ if (aUVNodes != NULL)
{
const gp_Pnt2d aTexel = (dUmax == 0.0 || dVmax == 0.0)
- ? aUVNodes (aNodeIter)
- : gp_Pnt2d ((-theUVOrigin.X() + (theUVRepeat.X() * (aUVNodes(aNodeIter).X() - aUmin)) / dUmax) / theUVScale.X(),
- (-theUVOrigin.Y() + (theUVRepeat.Y() * (aUVNodes(aNodeIter).Y() - aVmin)) / dVmax) / theUVScale.Y());
+ ? aUVNodes->Value (aNodeIter)
+ : gp_Pnt2d ((-theUVOrigin.X() + (theUVRepeat.X() * (aUVNodes->Value (aNodeIter).X() - aUmin)) / dUmax) / theUVScale.X(),
+ (-theUVOrigin.Y() + (theUVRepeat.Y() * (aUVNodes->Value (aNodeIter).Y() - aVmin)) / dVmax) / theUVScale.Y());
anArray->AddVertex (aPoint, aNorm, aTexel);
}
else