if((N!=Bound1)&&(N!=Bound2)) {
if(Abs(Der) > Tol ) {
if(Der>0) {Bound1=N;Bound2= N+1;}
- else
- if(Der<0){Bound1=N-1;Bound2=N;}
+ else {Bound1=N-1;Bound2=N;}
DerNull = Standard_False;
}
if(Abs(Der) <=Tol ) {
integer i2rdu, i2rdv;
doublereal errnu, errnv;
integer ii, nd, jj, nu, nv;
- doublereal bid0, bid1;
/* **********************************************************************
*/
/* ---------------- by U, the degree by V is fixed to NV -----------------
*/
- bid0 = 0.;
if (nv > *mindgv) {
- bid0 = xmaxjv[nv - i2rdv];
+ doublereal bid0 = xmaxjv[nv - i2rdv];
i__1 = *ndimen;
for (nd = 1; nd <= i__1; ++nd) {
- bid1 = 0.;
+ doublereal bid1 = 0.;
i__2 = nu;
for (ii = i2rdu; ii <= i__2; ++ii) {
bid1 += (d__1 = patjac[ii + (nv + nd * patjac_dim2) *
/* ---------------- by V, the degree by U is fixed to NU -----------------
*/
- bid0 = 0.;
if (nu > *mindgu) {
- bid0 = xmaxju[nu - i2rdu];
+ doublereal bid0 = xmaxju[nu - i2rdu];
i__1 = *ndimen;
for (nd = 1; nd <= i__1; ++nd) {
- bid1 = 0.;
+ doublereal bid1 = 0.;
i__2 = nv;
for (jj = i2rdv; jj <= i__2; ++jj) {
bid1 += (d__1 = patjac[nu + (jj + nd * patjac_dim2) *
Standard_Integer& ErrorCode)
{
// Standard_Real EpsPar = Precision::Confusion();
- Standard_Integer IDIM, NUPIL,TheDeg;
+ Standard_Integer NUPIL,TheDeg;
#ifdef OCCT_DEBUG
Standard_Integer NDIMEN = TotalDimension;
#endif
//--> La dimension totale doit etre la somme des dimensions des
// sous-espaces
- IDIM=0;
+ Standard_Integer IDIM=0;
for ( Standard_Integer I=1; I<=TotalNumSS; I++) {IDIM += LocalDimension(I);}
if (IDIM != TotalDimension)
{ErrorCode=1;
//---------- Calcul du degre de la courbe et de l' erreur max ----------
- IDIM=0;
NumCoeffPerCurveArray(NumCurves + 1)=0;
// L'erreur doit etre satisfaite sur tous les sous-espaces sinon, on decoupe
{
Standard_Real t;
Standard_Real UFirst, ULast;
- Standard_Integer ipnt;
UFirst = myCurve->Knots()(Element);
ULast = myCurve->Knots()(Element + 1);
IF = 0;
- for(ipnt = myParameters->Lower(); ipnt <= myParameters->Upper(); ipnt++) {
+ for(Standard_Integer ipnt = myParameters->Lower(); ipnt <= myParameters->Upper(); ipnt++) {
t = myParameters->Value(ipnt);
if((t > UFirst && t <= ULast) || (Element == 1 && t == UFirst)) {
if (IF == 0) IF=ipnt;
if (IF != 0) {
Handle(PLib_Base) myBase = myCurve->Base();
- Standard_Integer order = myBase->WorkDegree()+1, ii;
+ Standard_Integer order = myBase->WorkDegree()+1;
myCache = new TColStd_HArray1OfReal (1, (IL-IF+1)*(order));
-
- ii =1;
- for(ipnt = IF, ii=1; ipnt <= IL; ipnt++, ii+=order) {
+
+ for(Standard_Integer ipnt = IF, ii=1; ipnt <= IL; ipnt++, ii+=order) {
Standard_Real * cache = &myCache->ChangeValue(ii);
TColStd_Array1OfReal BasicValue(cache[0], 0, order-1);
t = myParameters->Value(ipnt);
//---------------------------------------------------------------------
- Standard_Integer jp2d,jp3d,index,ipole,
+ Standard_Integer jp2d,jp3d,ipole,
NbElem = TheCurve->NbElements();
TColgp_Array1OfPnt TabP3d(1, Max(1,myNbP3d));
gp_Pnt2d P2d;
gp_Pnt P3d;
-
- index=0;
-
{
Handle(TColStd_HArray2OfReal) PolynomialIntervalsPtr =
new TColStd_HArray2OfReal(1,NbElem,1,2) ;
for (ipole=PolesPtr->LowerRow();ipole<=PolesPtr->UpperRow();ipole++)
{
- index=PolesPtr->LowerCol();
+ Standard_Integer index = PolesPtr->LowerCol();
/* if(myNbP2d !=0 )
{
for (jp2d=1;jp2d<=myNbP2d;jp2d++)
Handle(TColStd_HArray1OfReal) CurrentTi, NewTi, OldTi;
Handle(TColStd_HArray2OfInteger) Dependence;
- Standard_Boolean lestim, lconst, ToOptim, iscut;
+ Standard_Boolean lestim, ToOptim, iscut;
Standard_Boolean isnear = Standard_False, again = Standard_True;
Standard_Integer NbEst, ICDANA, NumPnt, Iter;
Standard_Integer MaxNbEst =5;
// (1) Loop Optimization / Estimation
lestim = Standard_True;
- lconst = Standard_True;
+ Standard_Boolean lconst = Standard_True;
NbEst = 0;
J->SetCurve(CCurrent);
if ( Abs(divizor) > Toler )
Inverse = 1.0e0 / divizor ;
else {
- Inverse = 1.0e0;
-// std::cout << " BSplCLib::SolveBandedSystem() : zero determinant " << std::endl;
ReturnCode = 1;
goto FINISH;
}
// knots for bezier (using stack allocation)
//=======================================================================
-class BSplCLib_BezierArrays
+class BSplCLib_BezierArrays
{
- public:
- BSplCLib_BezierArrays (Standard_Integer Degree)
- : knots (aKnots[0], 1, 2), mults (aMults[0], 1, 2)
- {
- aKnots[0] = 0.;
- aKnots[1] = 1.;
- aMults[0] = aMults[1] = Degree + 1;
- }
-
- private:
- Standard_Real aKnots[2];
+public:
+ BSplCLib_BezierArrays(Standard_Integer Degree)
+ : aKnots{0., 1.},
+ aMults{Degree + 1, Degree + 1},
+ knots(aKnots[0], 1, 2),
+ mults(aMults[0], 1, 2)
+ {}
+
+private:
+ Standard_Real aKnots[2];
Standard_Integer aMults[2];
-
- public:
+
+public:
TColStd_Array1OfReal knots;
TColStd_Array1OfInteger mults;
};
-
+
//=======================================================================
//function : IncreaseDegree
//purpose :
void PerformOptimal(const Standard_Real Tol);
+ // Keep myT1 and myT2 unchanged
void Clear();
Standard_Integer ErrorStatus() const;
temp_degree,
pivot_index_problem,
num_flat_knots,
- num_knots,
- order ;
+ num_knots;
if (Parameterisation != Convert_TgtThetaOver2 &&
Parameterisation != Convert_RationalC1) {
Degree = 4 ;
- order = Degree + 1 ;
num_knots = 5 ;
num_flat_knots = (Degree -1) * num_knots + 2 * 2 ;
- num_poles = num_flat_knots - order ;
+ num_poles = num_flat_knots - Degree - 1 ;
num_periodic_poles = num_poles - 2 ;
TColStd_Array1OfReal flat_knots(1,num_flat_knots) ;
CosNumeratorPtr =
KnotsPtr->SetValue(ii, (ii-1) * half_pi) ;
MultsPtr->SetValue(ii, Degree-1) ;
}
- order = degree + 1 ;
TColStd_Array1OfReal parameters(1,num_poles) ;
TColgp_Array1OfPnt poles_array(1,num_poles) ;
gp_Pnt Pp = P.Translated(OZ.Multiplied(-Zp));
gp_Vec OPp(O, Pp);
if (OPp.SquareMagnitude() < Tol * Tol) return;
- Standard_Real B, U1, V1, U2, V2;
+ Standard_Real U1, V1, U2, V2;
Standard_Boolean Same = DirZ.Dot(MP) >= 0.0;
U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-M_PI<U1<M_PI
if (U1 > -ExtPElS_MyEps && U1 < ExtPElS_MyEps) { U1 = 0.; }
- B = MP.Angle(DirZ);
if (!Same) { U1 += M_PI; }
U2 = U1 + M_PI;
if (U1 < 0.) { U1 += 2. * M_PI; }
if (U2 > 2.*M_PI) { U2 -= 2. * M_PI; }
- B = MP.Angle(DirZ);
+ Standard_Real B = MP.Angle(DirZ);
A = Abs(A);
Standard_Real L = sqrt(L2);
if (!Same) {
void Extrema_GenExtPS::BuildGrid(const gp_Pnt &thePoint)
{
- Standard_Integer NoU, NoV;
-
//if grid was already built skip its creation
if (!myInit) {
//build parametric grid in case of a complex surface geometry (BSpline and Bezier surfaces)
U0 = U0/2. + myumin;
myUParams = new TColStd_HArray1OfReal(1,myusample );
Standard_Real U = U0;
- for ( NoU = 1 ; NoU <= myusample; NoU++, U += PasU)
+ for (Standard_Integer NoU = 1; NoU <= myusample; NoU++, U += PasU)
myUParams->SetValue(NoU, U);
}
myVParams = new TColStd_HArray1OfReal(1,myvsample );
Standard_Real V = V0;
-
- for ( NoV = 1, V = V0; NoV <= myvsample; NoV++, V += PasV)
+ for (Standard_Integer NoV = 1; NoV <= myvsample; NoV++, V += PasV)
myVParams->SetValue(NoV, V);
}
myPoints.Resize (0, myusample + 1, 0, myvsample + 1, false);
// Calculation of distances
- for ( NoU = 1 ; NoU <= myusample; NoU++ ) {
- for ( NoV = 1 ; NoV <= myvsample; NoV++) {
+ for (Standard_Integer NoU = 1 ; NoU <= myusample; NoU++ ) {
+ for (Standard_Integer NoV = 1 ; NoV <= myvsample; NoV++) {
gp_Pnt aP1 = myS->Value(myUParams->Value(NoU), myVParams->Value(NoV));
Extrema_POnSurfParams aParam
(myUParams->Value(NoU), myVParams->Value(NoV), aP1);
// Fill boundary with negative square distance.
// It is used for computation of Maximum.
- for (NoV = 0; NoV <= myvsample + 1; NoV++) {
+ for (Standard_Integer NoV = 0; NoV <= myvsample + 1; NoV++) {
myPoints.ChangeValue(0, NoV).SetSqrDistance(-1.);
myPoints.ChangeValue(myusample + 1, NoV).SetSqrDistance(-1.);
}
- for (NoU = 1; NoU <= myusample; NoU++) {
+ for (Standard_Integer NoU = 1; NoU <= myusample; NoU++) {
myPoints.ChangeValue(NoU, 0).SetSqrDistance(-1.);
myPoints.ChangeValue(NoU, myvsample + 1).SetSqrDistance(-1.);
}
// Compute distances to mesh.
// Step 1. Compute distances to nodes.
- for ( NoU = 1 ; NoU <= myusample; NoU++ ) {
- for ( NoV = 1 ; NoV <= myvsample; NoV++) {
+ for (Standard_Integer NoU = 1 ; NoU <= myusample; NoU++ ) {
+ for (Standard_Integer NoV = 1 ; NoV <= myvsample; NoV++) {
Extrema_POnSurfParams &aParam = myPoints.ChangeValue(NoU, NoV);
aParam.SetSqrDistance(thePoint.SquareDistance(aParam.Value()));
// Step 2. Compute distances to edges.
// Assume UEdge(i, j) = { Point(i, j); Point(i + 1, j ) }
// Assume VEdge(i, j) = { Point(i, j); Point(i, j + 1) }
- for ( NoU = 1 ; NoU <= myusample; NoU++ )
+ for (Standard_Integer NoU = 1 ; NoU <= myusample; NoU++ )
{
- for ( NoV = 1 ; NoV <= myvsample; NoV++)
+ for (Standard_Integer NoV = 1 ; NoV <= myvsample; NoV++)
{
const Extrema_POnSurfParams &aParam0 = myPoints.Value(NoU, NoV);
Standard_Real aDiffDist;
Standard_Boolean isOut;
- for ( NoU = 1 ; NoU < myusample; NoU++ ) {
- for ( NoV = 1 ; NoV < myvsample; NoV++) {
+ for (Standard_Integer NoU = 1 ; NoU < myusample; NoU++ ) {
+ for (Standard_Integer NoV = 1 ; NoV < myvsample; NoV++) {
const Extrema_POnSurfParams &aUE0 = myUEdgePntParams.Value(NoU, NoV);
const Extrema_POnSurfParams &aUE1 = myUEdgePntParams.Value(NoU, NoV+1);
const Extrema_POnSurfParams &aVE0 = myVEdgePntParams.Value(NoU, NoV);
}
// Fill boundary with RealLast square distance.
- for (NoV = 0; NoV <= myvsample; NoV++) {
+ for (Standard_Integer NoV = 0; NoV <= myvsample; NoV++) {
myFacePntParams.ChangeValue(0, NoV).SetSqrDistance(RealLast());
myFacePntParams.ChangeValue(myusample, NoV).SetSqrDistance(RealLast());
}
- for (NoU = 1; NoU < myusample; NoU++) {
+ for (Standard_Integer NoU = 1; NoU < myusample; NoU++) {
myFacePntParams.ChangeValue(NoU, 0).SetSqrDistance(RealLast());
myFacePntParams.ChangeValue(NoU, myvsample).SetSqrDistance(RealLast());
}
Standard_Real U = U0, V = V0;
for ( NoU = 1 ; NoU <= myusample; NoU++, U += PasU)
myUParams->SetValue(NoU, U);
- for ( NoV = 1, V = V0; NoV <= myvsample; NoV++, V += PasV)
+ for ( NoV = 1 ; NoV <= myvsample; NoV++, V += PasV)
myVParams->SetValue(NoV, V);
// Calculation of distances
Storage_Error FSD_BinaryFile::BeginReadTypeSection()
{
if (!fseek(myStream,myHeader.btype,SEEK_SET)) return Storage_VSOk;
- else return Storage_VSSectionNotFound;
+ else return Storage_VSSectionNotFound;
}
//=======================================================================
Storage_Error FSD_BinaryFile::EndReadTypeSection()
{
- if (!fseek(myStream,myHeader.etype,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.etype,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
Storage_Error FSD_BinaryFile::BeginReadRootSection()
{
- if (!fseek(myStream,myHeader.broot,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.broot,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
Storage_Error FSD_BinaryFile::EndReadRootSection()
{
- if (!fseek(myStream,myHeader.eroot,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.eroot,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
Storage_Error FSD_BinaryFile::BeginReadRefSection()
{
- if (!fseek(myStream,myHeader.bref,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.bref,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
Storage_Error FSD_BinaryFile::EndReadRefSection()
{
- if (!fseek(myStream,myHeader.eref,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.eref,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
Storage_Error FSD_BinaryFile::BeginReadDataSection()
{
- if (!fseek(myStream,myHeader.bdata,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.bdata,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
Storage_Error FSD_BinaryFile::EndReadDataSection()
{
- if (!fseek(myStream,myHeader.edata,SEEK_SET)) return Storage_VSOk;
+ if (!fseek(myStream,myHeader.edata,SEEK_SET)) return Storage_VSOk;
else return Storage_VSSectionNotFound;
}
SetName(aName);
if (OpenMode() == Storage_VSNone) {
- std::ios_base::openmode anOpenMode = std::ios_base::openmode(0);
+ std::ios_base::openmode anOpenMode = std::ios_base::openmode{};
switch (aMode)
{
case Storage_VSNone:
if (OpenMode() == Storage_VSNone)
{
- std::ios_base::openmode anOpenMode = std::ios_base::openmode(0);
+ std::ios_base::openmode anOpenMode = std::ios_base::openmode{};
switch (aMode)
{
case Storage_VSNone:
void FSD_File::ReadExtendedLine(TCollection_ExtendedString& buffer)
{
char c = '\0';
- Standard_ExtCharacter i = 0,j,count = 0;
+ Standard_ExtCharacter i = 0,count = 0;
Standard_Boolean fin = Standard_False;
Standard_CString tg = ENDOFNORMALEXTENDEDSECTION;
if (c == tg[count]) count++;
else count = 0;
if (count < SIZEOFNORMALEXTENDEDSECTION) {
- j = 0;
i = (Standard_ExtCharacter)c;
if (c == '\0') fin = Standard_True;
i = (i << 8);
if (c == tg[count]) count++;
else count = 0;
if (count < SIZEOFNORMALEXTENDEDSECTION) {
- j = (Standard_ExtCharacter)c;
if (c != '\n') {
fin = Standard_False;
- i |= (0x00FF & j);
+ i |= (0x00FF & (Standard_ExtCharacter)c);
buffer += (Standard_ExtCharacter)i;
}
}
throw Standard_ConstructionError();
}
- Standard_Integer Row = PoleWeights.LowerRow();
Standard_Integer Col = PoleWeights.LowerCol();
while (Col <= PoleWeights.UpperCol()) {
- Row = PoleWeights.LowerRow();
+ Standard_Integer Row = PoleWeights.LowerRow();
while (Row <= PoleWeights.UpperRow()) {
if (PoleWeights(Row, Col) <= gp::Resolution()) {
throw Standard_ConstructionError();
Standard_Boolean isCircle = (!isLine);
if (isLine)
aLin2d = aGeomLine->Lin2d();
-
else {
Handle(Geom2d_Circle) aGeomCircle =
Handle(Geom2d_Circle)::DownCast(aCurve1);
aParameterCurve = ElCLib::Parameter(aCirc2d, aPointAdaptor);
aProjPoint = ElCLib::Value(aParameterCurve, aCirc2d);
}
- else isLess = Standard_False;
isLess = (aProjPoint.Distance(aPointAdaptor) <
myTolerance + Precision::PConfusion());
void GeomAdaptor_Surface::UIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
{
- Standard_Integer myNbUIntervals = 1;
-
switch (mySurfaceType)
{
case GeomAbs_BSplineSurface:
{
GeomAdaptor_Curve myBasisCurve
(myBSplineSurface->VIso(myBSplineSurface->VKnot(myBSplineSurface->FirstVKnotIndex())),myUFirst,myULast);
- myNbUIntervals = myBasisCurve.NbIntervals(S);
myBasisCurve.Intervals(T,S);
return;
}
(Handle(Geom_SurfaceOfLinearExtrusion)::DownCast (mySurface)->BasisCurve(),myUFirst,myULast);
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
{
- myNbUIntervals = myBasisCurve.NbIntervals(S);
myBasisCurve.Intervals(T,S);
return;
}
}
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
GeomAdaptor_Surface Sur(myOffSurf->BasisSurface(), myUFirst, myULast, myVFirst, myVLast);
- myNbUIntervals = Sur.NbUIntervals(BaseS);
Sur.UIntervals(T, BaseS);
return;
}
}
T(T.Lower()) = myUFirst;
- T(T.Lower() + myNbUIntervals) = myULast;
+ T(T.Lower() + 1) = myULast;
}
//=======================================================================
void GeomAdaptor_Surface::VIntervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
{
- Standard_Integer myNbVIntervals = 1;
-
switch (mySurfaceType)
{
case GeomAbs_BSplineSurface:
{
GeomAdaptor_Curve myBasisCurve
(myBSplineSurface->UIso(myBSplineSurface->UKnot(myBSplineSurface->FirstUKnotIndex())),myVFirst,myVLast);
- myNbVIntervals = myBasisCurve.NbIntervals(S);
myBasisCurve.Intervals(T,S);
return;
}
GeomAdaptor_Curve myBasisCurve(myRevSurf->BasisCurve(), myVFirst, myVLast);
if (myBasisCurve.GetType() == GeomAbs_BSplineCurve)
{
- myNbVIntervals = myBasisCurve.NbIntervals(S);
myBasisCurve.Intervals(T,S);
return;
}
}
Handle(Geom_OffsetSurface) myOffSurf = Handle(Geom_OffsetSurface)::DownCast(mySurface);
GeomAdaptor_Surface Sur(myOffSurf->BasisSurface(), myUFirst, myULast, myVFirst, myVLast);
- myNbVIntervals = Sur.NbVIntervals(BaseS);
Sur.VIntervals(T, BaseS);
return;
}
}
T(T.Lower()) = myVFirst;
- T(T.Lower() + myNbVIntervals) = myVLast;
+ T(T.Lower() + 1) = myVLast;
}
//=======================================================================
local_distance_squared =
Point1.SquareDistance (Point2) ;
- local_distance_squared =
- Point1.SquareDistance (Point2) ;
-
if (local_distance_squared > tolerance_squared) {
// Standard_Boolean rational = ( InU && BS->IsURational() )
// || ( !InU && BS->IsVRational() ) ;
Standard_Boolean rational = (BS->IsURational() || BS->IsVRational());
- Standard_Boolean NullWeight;
constexpr Standard_Real EpsW = 10*Precision::PConfusion();
Standard_Integer gap = 3;
if ( rational ) gap++;
TColStd_Array2OfReal& NewW = NewWeights->ChangeArray2();
if (!rational) NewW.Init(1.);
- NullWeight= Standard_False;
+ Standard_Boolean NullWeight= Standard_False;
if (InU) {
for (ii=1; ii<=NU && !NullWeight; ii++) {
std::cout << "Echec de l'Extension rationnelle" << std::endl;
#endif
lambmin /= 3.;
- NullWeight = Standard_False;
}
else {
ExtOk = Standard_True;
Standard_Real ref2=Ox2.Angle(ax); // Resultat entre -PI et +PI
Standard_Real l1=(d*d + R1*R1 -R2*R2)/(2.0*d);
- Standard_Real aDet = R1*R1-l1*l1;
- if(aDet < 0.) {
- aDet = 0.;
+ if(R1*R1-l1*l1 < 0.) {
l1 = (l1 > 0 ? R1 : - R1);
}
Standard_Real h= Sqrt(R1*R1-l1*l1);
aFormatType = Msg_StringType;
break;
default:
- aFormatType = Msg_IndefiniteType;
continue;
}
mySeqOfFormats.Append (Standard_Integer(aFormatType)); // type
return;
}
- const char* aCode = "\e[0m";
+ const char* aCode;
switch (theTextColor)
{
case Message_ConsoleColor_Default:
#include <NCollection_IndexedIterator.hxx>
#include <algorithm>
-#include <array>
-#include <vector>
//! The class NCollection_Array1 represents unidimensional arrays of fixed size known at run time.
//! The range of the index is user defined.
throw Standard_ProgramError ("OSD_File::Build(): no name was given");
}
- const char* anFDOpenMode = "r";
+ const char* anFDOpenMode;
Standard_Integer anOpenMode = O_CREAT | O_TRUNC;
switch (theMode)
{
throw Standard_ProgramError ("OSD_File::Append(): no name was given");
}
- const char* anFDOpenMode = "r";
+ const char* anFDOpenMode;
Standard_Integer anOpenMode = O_APPEND;
switch (theMode)
{
throw Standard_ProgramError ("OSD_File::Open(): no name was given");
}
- const char* anFDOpenMode = "r";
+ const char* anFDOpenMode;
Standard_Integer anOpenMode = 0;
switch (theMode)
{
trek = buffer.Token("[]");
if (trek.Value(1) == '.') trek.Remove(1,1); // Removes first '.'
- else trek.Insert(1,'|'); // Add root
+ else trek.Insert(1,'|'); // Add root
trek.ChangeAll('.','|'); // Translates to portable syntax
trek.ChangeAll('-','^');
}
if (Way.Length()!=0)
- FullName = FullName + Way + "\\";
+ FullName = FullName + Way + "\\";
FullName += myName;
FullName += myExtension;
TCollection_AsciiString EmptyString = "" ;
TCollection_AsciiString FilePath ;
Standard_Integer len ;
- Standard_Integer i, n ;
Standard_Boolean Wnt = 0 ;
FilePath = aAbsFilePath ;
TCollection_AsciiString DirToken, FileToken ;
Standard_Boolean Sibling = 0 ;
- for (i = n = 1 ;; n++) {
+ for (Standard_Integer n = 1 ;; n++) {
DirToken = aDirPath.Token("/\\",n) ;
if (DirToken.IsEmpty())
return FilePath ;
if (!Sibling) {
len = FilePath.Length() ;
- i = FilePath.Search("/") ;
+ Standard_Integer i = FilePath.Search("/") ;
if (i > 0) {
if (i == len)
return EmptyString ;
tostr.Insert(0, curext3);
tostr.Insert(0, curext2);
tostr.Insert(0, curext1);
- gb1 = 0;
- gb2 = 0;
- gb3 = 0;
return Standard_False;
}
TCollection_ExtendedString curext1(((char) gb2));
tostr.Insert(0, curext2);
tostr.Insert(0, curext1);
- gb1 = 0;
- gb2 = 0;
return Standard_False;
}
else if (gb1 != 0x00)
}
else {
tostr[nbtrans] = '\0';
- nbtrans = maxsize-1;
return Standard_False;
}
}
}
if (nbtrans >= (maxsize - 1)) {
tostr[maxsize-1] = '\0';
- finished = Standard_True;
return Standard_False;
}
}
}
else {
tostr[nbtrans-1] = '\0';
- nbtrans = maxsize-1;
return Standard_False;
}
}
}
if (nbtrans >= (maxsize - 1)) {
tostr[maxsize-1] = '\0';
- finished = Standard_True;
return Standard_False;
}
}
}
else {
tostr[nbtrans-1] = '\0';
- nbtrans = maxsize-1;
return Standard_False;
}
}
}
if (nbtrans >= (maxsize - 1)) {
tostr[maxsize-1] = '\0';
- finished = Standard_True;
return Standard_False;
}
}
}
if (nbtrans >= (maxsize - 1)) {
tostr[maxsize-1] = '\0';
- finished = Standard_True;
return Standard_False;
}
}
TCollection_AsciiString aValueText = aSubText.SubString (aStreamPos, aNextPos - 1);
if (!aValueText.IsRealValue())
+ {
+ va_end(vl);
return Standard_False;
+ }
Standard_Real aValue = aValueText.RealValue();
*(va_arg(vl, Standard_Real*)) = aValue;
}
const Standard_Size aLen = strlen (theString);
- StringRef* aStrPtr = (StringRef* )malloc (aLen + sizeof(Standard_Integer) + 1);
+ StringRef* aStrPtr = (StringRef*)Standard::AllocateOptimal (aLen + sizeof(Standard_Integer) + 1);
if (aStrPtr != NULL)
{
strcpy ((char* )&aStrPtr->Message[0], theString);
{
if (--theString->Counter == 0)
{
- free ((void* )theString);
+ Standard::Free ((void* )theString);
}
}
}
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b3);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b4);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b5);
- tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b6);
+ Standard_GUID_GetValue8(tmpBuffer,my8b6);
}
Standard_GUID::Standard_GUID(const Standard_ExtString aGuid)
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b3);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b4);
tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b5);
- tmpBuffer = Standard_GUID_GetValue8(tmpBuffer,my8b6);
+ Standard_GUID_GetValue8(tmpBuffer,my8b6);
}
Standard_GUID::Standard_GUID(const Standard_Integer a32b,
}
if(unit2[0]) {
- j = 0;
for(j=1;j<=theunitssequence->Length();j++)
if(theunitssequence->Value(j) == unit2)break;
aNewMat[1][2] = -(myMat[0][0] * myMat[1][2] - myMat[1][0] * myMat[0][2]);
aNewMat[2][2] = myMat[0][0] * myMat[1][1] - myMat[0][1] * myMat[1][0];
Standard_Real aDet = myMat[0][0] * aNewMat[0][0] + myMat[0][1]* aNewMat[1][0] + myMat[0][2] * aNewMat[2][0];
- Standard_Real aVal = aDet;
- if (aVal < 0) aVal = -aVal;
- Standard_ConstructionError_Raise_if (aVal <= gp::Resolution(), "gp_Mat::Invert() - matrix has zero determinant");
+ Standard_ConstructionError_Raise_if (Abs(aDet) <= gp::Resolution(), "gp_Mat::Invert() - matrix has zero determinant");
aDet = 1.0e0 / aDet;
myMat[0][0] = aNewMat[0][0];
myMat[1][0] = aNewMat[1][0];
aNewMat.myMat[1][2] = -(myMat[0][0] * myMat[1][2] - myMat[1][0] * myMat[0][2]);
aNewMat.myMat[2][2] = myMat[0][0] * myMat[1][1] - myMat[0][1] * myMat[1][0];
Standard_Real aDet = myMat[0][0] * aNewMat.myMat[0][0] + myMat[0][1]* aNewMat.myMat[1][0] + myMat[0][2] * aNewMat.myMat[2][0];
- Standard_Real aVal = aDet;
- if (aVal < 0) aVal = -aVal;
- Standard_ConstructionError_Raise_if (aVal <= gp::Resolution(), "gp_Mat::Inverted() - matrix has zero determinant");
+ Standard_ConstructionError_Raise_if (Abs(aDet) <= gp::Resolution(), "gp_Mat::Inverted() - matrix has zero determinant");
aDet = 1.0e0 / aDet;
aNewMat.Multiply (aDet);
return aNewMat;
aNewMat[1][0] = -myMat[1][0];
aNewMat[1][1] = myMat[0][0];
Standard_Real aDet = aNewMat[0][0] * aNewMat[1][1] - aNewMat[0][1] * aNewMat[1][0];
- Standard_Real val = aDet;
- if (val < 0) val = - val;
- Standard_ConstructionError_Raise_if (val <= gp::Resolution(), "gp_Mat2d::Invert() - matrix has zero determinant");
+ Standard_ConstructionError_Raise_if (Abs(aDet) <= gp::Resolution(), "gp_Mat2d::Invert() - matrix has zero determinant");
aDet = 1.0 / aDet;
myMat[0][0] = aNewMat[0][0] * aDet;
myMat[1][0] = aNewMat[1][0] * aDet;
Standard_Boolean GOOD;
Standard_Integer j;
Standard_Real dxold, fh, fl;
- Standard_Real swap, temp, xh, xl;
+ Standard_Real temp, xh, xl;
GOOD = F.Values(Bound1, fl, df);
if(!GOOD) {
else {
xl = Bound2;
xh = Bound1;
- swap = fl;
- fl = fh;
- fh = swap;
}
// Modified by Sergey KHROMOV - Wed Jan 22 12:06:49 2003 End
x = 0.5 * (Bound1 + Bound2);
}
if(f < 0.0) {
xl = x;
- fl = f;
}
else if(f > 0.0) {
xh = x;
- fh = f;
}
else {
TheStatus = math_OK;
const Standard_Real EPS) {
Standard_Integer i, j, k, n, l, m;
- Standard_Real scale, f, g, h = 0., alfaii;
+ Standard_Real f, g, h = 0., alfaii;
Standard_Real qki;
Standard_Real cj;
n = Q.ColNumber();
// Traitement de chaque colonne de A:
for (i = 1; i <= n; i++) {
- h = scale = 0.0;
+ h = 0.0;
for (k = i; k <= l; k++) {
qki = Q(k, i);
h += qki*qki; // = ||a||*||a|| = EUAI
h -= f*g; // = (v*v)/2 = C1
alfaii = g-f; // = v = ALFAII
for (j =i+1; j <= n; j++) {
- scale = 0.0;
+ Standard_Real scale = 0.0;
for (k = i; k <= l; k++) {
scale += Q(k,i)* Q(k,j); // = SCAL
}
// Modification de B:
for (j = 1; j <= m; j++) {
- scale= Q(i,i)*B2(i,j);
+ Standard_Real scale= Q(i,i)*B2(i,j);
for (k = i+1; k <= l; k++) {
scale += Q(k,i)*B2(k,j);
}
for (j = 1; j <= m; j++) {
Sol(n,j) = B2(n,j)/Q(n,n);
for (i = n -1; i >=1; i--) {
- scale= 0.0;
+ Standard_Real scale= 0.0;
for(k = i+1; k <= n; k++) {
scale += Q(i,k) * Sol(k,j);
}
math_Vector Point2(1, F.NbVariables());
math_Vector* precedent = &Point1;
math_Vector* suivant = &Point2;
- math_Vector* auxiliaire = precedent;
Standard_Boolean Ok = Standard_True;
Standard_Integer NbConv = 0, ii, Nreduction;
}
if (VItere <= VPrecedent) {
- auxiliaire = precedent;
+ math_Vector* auxiliaire = precedent;
precedent = suivant;
suivant = auxiliaire;
PreviousMinimum = VPrecedent;
math_Vector& rv1) {
Standard_Integer flag, i, its, j, jj, k, l=0, nm=0;
- Standard_Real ar, aw, aik, aki, c, f, h, s, x, y, z;
+ Standard_Real ar, aw, aik, aki, f, h, s, x, y, z;
Standard_Real anorm = 0.0, g = 0.0, scale = 0.0;
Standard_Integer m = a.RowNumber();
Standard_Integer n = a.ColNumber();
if(fabs(w(nm)) + anorm == anorm) break;
}
if(flag) {
- c = 0.0;
s = 1.0;
for(i = l; i <= k; i++) {
f = s * rv1(i);
h = PYTHAG(f, g);
w(i) = h;
h = 1.0 / h;
- c = g * h;
+ Standard_Real c = g * h;
s = (-f * h);
for(j = 1; j <= m; j++) {
y = a(j,nm);
g = PYTHAG(f, 1.0);
f = ((x - z) * (x + z) + h * ((y / ( f + SIGN(g, f))) - h)) / x;
- c = s = 1.0;
+ Standard_Real c = s = 1.0;
for(j = l; j <= nm; j++) {
i = j + 1;
g = rv1(i);