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

0031671: Coding Rules - eliminate warnings issued by clang 11

Fixed -Wdeprecated-copy warning by removing trivial operator=.
Fixed formatting issues in places producing -Wmisleading-indentation warning.
This commit is contained in:
kgv 2020-07-17 15:12:49 +03:00 committed by bugmaster
parent 7465bfa65e
commit 99ee8f1a83
11 changed files with 221 additions and 253 deletions

View File

@ -353,53 +353,73 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min,
// (critere sureleve => Non minimisation ) // (critere sureleve => Non minimisation )
for(i = 0; i <= 2; i++) for(i = 0; i <= 2; i++)
{
if((ValCri[i] < 0.8 * myEstimation[i]) && (myEstimation[i] > JEsMin[i])) { if((ValCri[i] < 0.8 * myEstimation[i]) && (myEstimation[i] > JEsMin[i])) {
if(ICDANA < 1) ICDANA = 1; if(ICDANA < 1) ICDANA = 1;
if(ValCri[i] < 0.1 * myEstimation[i]) ICDANA = 2; if(ValCri[i] < 0.1 * myEstimation[i]) ICDANA = 2;
myEstimation[i] = Max(1.05*ValCri[i], JEsMin[i]); myEstimation[i] = Max(1.05*ValCri[i], JEsMin[i]);
} }
}
// (3) Mise a jours des Estimation // (3) Mise a jours des Estimation
// (critere sous-estimer => mauvais conditionement) // (critere sous-estimer => mauvais conditionement)
if (ValCri[0] > myEstimation[0] * 2)
if (ValCri[0] > myEstimation[0] * 2) { {
myEstimation[0] += ValCri[0] * .1; myEstimation[0] += ValCri[0] * .1;
if (ICDANA == 0) { if (ICDANA == 0)
if (ValCri[0] > myEstimation[0] * 10) { {
ICDANA = 2; if (ValCri[0] > myEstimation[0] * 10)
} {
else ICDANA = 1; ICDANA = 2;
} }
else { else
ICDANA = 2; {
} ICDANA = 1;
}
} }
if (ValCri[1] > myEstimation[1] * 20) { else
myEstimation[1] += ValCri[1] * .1; {
if (ICDANA == 0) { ICDANA = 2;
if (ValCri[1] > myEstimation[1] * 100) {
ICDANA = 2;
}
else ICDANA = 1;
}
else {
ICDANA = 2;
}
} }
if (ValCri[2] > myEstimation[2] * 20) { }
myEstimation[2] += ValCri[2] * .05; if (ValCri[1] > myEstimation[1] * 20)
if (ICDANA == 0) { {
if (ValCri[2] > myEstimation[2] * 100) { myEstimation[1] += ValCri[1] * .1;
ICDANA = 2; if (ICDANA == 0)
} {
else ICDANA = 1; if (ValCri[1] > myEstimation[1] * 100)
} {
else { ICDANA = 2;
ICDANA = 2; }
} else
{
ICDANA = 1;
}
} }
else
{
ICDANA = 2;
}
}
if (ValCri[2] > myEstimation[2] * 20)
{
myEstimation[2] += ValCri[2] * .05;
if (ICDANA == 0)
{
if (ValCri[2] > myEstimation[2] * 100)
{
ICDANA = 2;
}
else
{
ICDANA = 1;
}
}
else
{
ICDANA = 2;
}
}
return ICDANA; return ICDANA;
} }

View File

@ -27,24 +27,6 @@
#include <TColStd_Array1OfReal.hxx> #include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfReal.hxx> #include <TColStd_Array2OfReal.hxx>
#define D1uD1vRatioIsNull CSLib_D1uD1vRatioIsNull
#define D1vD1uRatioIsNull CSLib_D1vD1uRatioIsNull
#define D1uIsParallelD1v CSLib_D1uIsParallelD1v
#define D1IsNull CSLib_D1IsNull
#define D1uIsNull CSLib_D1uIsNull
#define D1vIsNull CSLib_D1vIsNull
#define Done CSLib_Done
#define D1NuIsNull CSLib_D1NuIsNull
#define D1NvIsNull CSLib_D1NvIsNull
#define D1NuIsParallelD1Nv CSLib_D1NuIsParallelD1Nv
#define D1NIsNull CSLib_D1NIsNull
#define D1NuNvRatioIsNull CSLib_D1NuNvRatioIsNull
#define D1NvNuRatioIsNull CSLib_D1NvNuRatioIsNull
#define InfinityOfSolutions CSLib_InfinityOfSolutions
#define Defined CSLib_Defined
#define Singular CSLib_Singular
void CSLib::Normal ( void CSLib::Normal (
const gp_Vec& D1U, const gp_Vec& D1U,
@ -61,18 +43,18 @@ gp_Dir& Normal
gp_Vec D1UvD1V = D1U.Crossed(D1V); gp_Vec D1UvD1V = D1U.Crossed(D1V);
if (D1UMag <= gp::Resolution() && D1VMag <= gp::Resolution()) { if (D1UMag <= gp::Resolution() && D1VMag <= gp::Resolution()) {
theStatus = D1IsNull; theStatus = CSLib_D1IsNull;
} }
else if (D1UMag <= gp::Resolution()) theStatus = D1uIsNull; else if (D1UMag <= gp::Resolution()) theStatus = CSLib_D1uIsNull;
else if (D1VMag <= gp::Resolution()) theStatus = D1vIsNull; else if (D1VMag <= gp::Resolution()) theStatus = CSLib_D1vIsNull;
// else if ((D1VMag / D1UMag) <= RealEpsilon()) theStatus = D1vD1uRatioIsNull; // else if ((D1VMag / D1UMag) <= RealEpsilon()) theStatus = CSLib_D1vD1uRatioIsNull;
// else if ((D1UMag / D1VMag) <= RealEpsilon()) theStatus = D1uD1vRatioIsNull; // else if ((D1UMag / D1VMag) <= RealEpsilon()) theStatus = CSLib_D1uD1vRatioIsNull;
else { else {
Standard_Real Sin2 = Standard_Real Sin2 =
D1UvD1V.SquareMagnitude() / (D1UMag * D1VMag); D1UvD1V.SquareMagnitude() / (D1UMag * D1VMag);
if (Sin2 < (SinTol * SinTol)) { theStatus = D1uIsParallelD1v; } if (Sin2 < (SinTol * SinTol)) { theStatus = CSLib_D1uIsParallelD1v; }
else { Normal = gp_Dir (D1UvD1V); theStatus = Done; } else { Normal = gp_Dir (D1UvD1V); theStatus = CSLib_Done; }
} }
} }
@ -107,25 +89,25 @@ gp_Dir& Normal
if (LD1Nu <= RealEpsilon() && LD1Nv <= RealEpsilon()) { if (LD1Nu <= RealEpsilon() && LD1Nv <= RealEpsilon()) {
theStatus = D1NIsNull; theStatus = CSLib_D1NIsNull;
Done = Standard_False; Done = Standard_False;
} }
else if (LD1Nu < RealEpsilon()) { else if (LD1Nu < RealEpsilon()) {
theStatus = D1NuIsNull; theStatus = CSLib_D1NuIsNull;
Done = Standard_True; Done = Standard_True;
Normal = gp_Dir (D1Nv); Normal = gp_Dir (D1Nv);
} }
else if (LD1Nv < RealEpsilon()) { else if (LD1Nv < RealEpsilon()) {
theStatus = D1NvIsNull; theStatus = CSLib_D1NvIsNull;
Done = Standard_True; Done = Standard_True;
Normal = gp_Dir (D1Nu); Normal = gp_Dir (D1Nu);
} }
else if ((LD1Nv / LD1Nu) <= RealEpsilon()) { else if ((LD1Nv / LD1Nu) <= RealEpsilon()) {
theStatus = D1NvNuRatioIsNull; theStatus = CSLib_D1NvNuRatioIsNull;
Done = Standard_False; Done = Standard_False;
} }
else if ((LD1Nu / LD1Nv) <= RealEpsilon()) { else if ((LD1Nu / LD1Nv) <= RealEpsilon()) {
theStatus = D1NuNvRatioIsNull; theStatus = CSLib_D1NuNvRatioIsNull;
Done = Standard_False; Done = Standard_False;
} }
else { else {
@ -133,12 +115,12 @@ gp_Dir& Normal
Standard_Real Sin2 = D1NCross.SquareMagnitude() / (LD1Nu * LD1Nv); Standard_Real Sin2 = D1NCross.SquareMagnitude() / (LD1Nu * LD1Nv);
if (Sin2 < (SinTol * SinTol)) { if (Sin2 < (SinTol * SinTol)) {
theStatus = D1NuIsParallelD1Nv; theStatus = CSLib_D1NuIsParallelD1Nv;
Done = Standard_True; Done = Standard_True;
Normal = gp_Dir (D1Nu); Normal = gp_Dir (D1Nu);
} }
else { else {
theStatus = InfinityOfSolutions; theStatus = CSLib_InfinityOfSolutions;
Done = Standard_False; Done = Standard_False;
} }
} }
@ -161,7 +143,7 @@ gp_Dir& Normal
if (NMag <= MagTol || D1UMag <= MagTol || D1VMag <= MagTol ) { if (NMag <= MagTol || D1UMag <= MagTol || D1VMag <= MagTol ) {
theStatus = Singular; theStatus = CSLib_Singular;
// if (D1UMag <= MagTol || D1VMag <= MagTol && NMag > MagTol) MagTol = 2* NMag; // if (D1UMag <= MagTol || D1VMag <= MagTol && NMag > MagTol) MagTol = 2* NMag;
} }
else else
@ -170,7 +152,7 @@ gp_Dir& Normal
gp_Dir aD1U(D1U); gp_Dir aD1U(D1U);
gp_Dir aD1V(D1V); gp_Dir aD1V(D1V);
Normal = gp_Dir(aD1U.Crossed(aD1V)); Normal = gp_Dir(aD1U.Crossed(aD1V));
theStatus = Defined; theStatus = CSLib_Defined;
} }
@ -219,7 +201,7 @@ void CSLib::Normal(const Standard_Integer MaxOrder,
{ {
if(Order == 0) if(Order == 0)
{ {
theStatus = Defined; theStatus = CSLib_Defined;
Normal=D.Normalized(); Normal=D.Normalized();
} }
else else
@ -373,16 +355,16 @@ void CSLib::Normal(const Standard_Integer MaxOrder,
//Polynom is always negative //Polynom is always negative
SP=-1; SP=-1;
if(SP==0) if(SP==0)
theStatus = InfinityOfSolutions; theStatus = CSLib_InfinityOfSolutions;
else else
{ {
theStatus = Defined; theStatus = CSLib_Defined;
Normal=SP*Vk0.Normalized(); Normal=SP*Vk0.Normalized();
} }
} }
else else
{ {
theStatus = Defined; theStatus = CSLib_Defined;
Normal=D.Normalized(); Normal=D.Normalized();
} }
} }
@ -439,120 +421,126 @@ gp_Vec CSLib::DNNormal(const Standard_Integer Nu,
const Standard_Integer Iduref, const Standard_Integer Iduref,
const Standard_Integer Idvref) const Standard_Integer Idvref)
{ {
Standard_Integer Kderiv; const Standard_Integer Kderiv = Nu + Nv;
Kderiv=Nu+Nv; TColgp_Array2OfVec DerVecNor(0,Kderiv,0,Kderiv);
TColgp_Array2OfVec DerVecNor(0,Kderiv,0,Kderiv); TColStd_Array2OfReal TabScal(0,Kderiv,0,Kderiv);
TColStd_Array2OfReal TabScal(0,Kderiv,0,Kderiv); TColStd_Array2OfReal TabNorm(0,Kderiv,0,Kderiv);
TColStd_Array2OfReal TabNorm(0,Kderiv,0,Kderiv); gp_Vec DerNor = (DerNUV.Value (Iduref, Idvref)).Normalized();
Standard_Integer Ideriv,Jderiv,Mderiv,Pderiv,Qderiv; DerVecNor.SetValue(0,0,DerNor);
Standard_Real Scal,Dnorm; Standard_Real Dnorm = DerNUV.Value (Iduref, Idvref) * DerVecNor.Value (0, 0);
gp_Vec DerNor; TabNorm.SetValue(0,0,Dnorm);
DerNor=(DerNUV.Value(Iduref,Idvref)).Normalized(); TabScal.SetValue(0,0,0.);
DerVecNor.SetValue(0,0,DerNor);
Dnorm=DerNUV.Value(Iduref,Idvref)*DerVecNor.Value(0,0); for (Standard_Integer Mderiv = 1; Mderiv <= Kderiv; Mderiv++)
TabNorm.SetValue(0,0,Dnorm); {
TabScal.SetValue(0,0,0.); for (Standard_Integer Pderiv = 0; Pderiv <= Mderiv; Pderiv++)
for ( Mderiv = 1;Mderiv <= Kderiv; Mderiv++) {
for ( Pderiv = 0 ; Pderiv <= Mderiv ; Pderiv++) const Standard_Integer Qderiv = Mderiv - Pderiv;
if (Pderiv > Nu || Qderiv > Nv)
{
continue;
}
// Compute n . derivee(p,q) of n
Standard_Real Scal = 0.;
if (Pderiv > Qderiv)
{
for (Standard_Integer Jderiv = 1; Jderiv <= Qderiv; Jderiv++)
{ {
Qderiv = Mderiv - Pderiv; Scal = Scal - PLib::Bin (Qderiv, Jderiv)
if (Pderiv <= Nu && Qderiv <= Nv) * (DerVecNor.Value (0, Jderiv) * DerVecNor.Value (Pderiv, Qderiv - Jderiv));
{
//
// Compute n . derivee(p,q) of n
Scal = 0.;
if ( Pderiv > Qderiv )
{
for (Jderiv=1 ; Jderiv <=Qderiv;Jderiv++)
Scal=Scal
-PLib::Bin(Qderiv,Jderiv)*
(DerVecNor.Value(0,Jderiv)*DerVecNor.Value(Pderiv,Qderiv-Jderiv));
for (Jderiv=0 ; Jderiv < Qderiv ; Jderiv++)
Scal=Scal
-PLib::Bin(Qderiv,Jderiv)*
(DerVecNor.Value(Pderiv,Jderiv)*DerVecNor.Value(0,Qderiv-Jderiv));
for (Ideriv=1 ; Ideriv < Pderiv;Ideriv++)
for (Jderiv =0 ; Jderiv <=Qderiv ; Jderiv++)
Scal= Scal
- PLib::Bin(Pderiv,Ideriv)
*PLib::Bin(Qderiv,Jderiv)
*(DerVecNor.Value(Ideriv,Jderiv)
*DerVecNor.Value(Pderiv-Ideriv,Qderiv-Jderiv));
}
else
{
for (Ideriv = 1 ; Ideriv <= Pderiv ; Ideriv++)
Scal = Scal - PLib::Bin(Pderiv,Ideriv)*
DerVecNor.Value(Ideriv,0)*DerVecNor.Value(Pderiv-Ideriv,Qderiv);
for (Ideriv = 0 ; Ideriv < Pderiv ; Ideriv++)
Scal = Scal - PLib::Bin(Pderiv,Ideriv)*
DerVecNor.Value(Ideriv,Qderiv)*DerVecNor.Value(Pderiv-Ideriv,0);
for (Ideriv=0 ; Ideriv <= Pderiv;Ideriv++)
for (Jderiv =1 ; Jderiv <Qderiv ; Jderiv++)
Scal= Scal
- PLib::Bin(Pderiv,Ideriv)
*PLib::Bin(Qderiv,Jderiv)
*(DerVecNor.Value(Ideriv,Jderiv)
*DerVecNor.Value(Pderiv-Ideriv,Qderiv-Jderiv));
}
TabScal.SetValue(Pderiv,Qderiv,Scal/2.);
//
// Compute the derivative (n,p) of NUV Length
//
Dnorm=(DerNUV.Value(Pderiv+Iduref,Qderiv+Idvref))*DerVecNor.Value(0,0);
for (Jderiv = 0 ; Jderiv < Qderiv ; Jderiv++)
Dnorm = Dnorm - PLib::Bin(Qderiv+Idvref,Jderiv+Idvref)
*TabNorm.Value(Pderiv,Jderiv)
*TabScal.Value(0,Qderiv-Jderiv);
for (Ideriv = 0 ; Ideriv < Pderiv ; Ideriv++)
for (Jderiv = 0 ; Jderiv <= Qderiv ; Jderiv++)
Dnorm = Dnorm - PLib::Bin(Pderiv+Iduref,Ideriv+Iduref)
*PLib::Bin(Qderiv+Idvref,Jderiv+Idvref)
*TabNorm.Value(Ideriv,Jderiv)
*TabScal.Value(Pderiv-Ideriv,Qderiv-Jderiv);
TabNorm.SetValue(Pderiv,Qderiv,Dnorm);
//
// Compute derivative (p,q) of n
//
DerNor = DerNUV.Value(Pderiv+Iduref,Qderiv+Idvref);
for (Jderiv = 1 ; Jderiv <= Qderiv ; Jderiv++)
DerNor = DerNor - PLib::Bin(Pderiv+Iduref,Iduref)
*PLib::Bin(Qderiv+Idvref,Jderiv+Idvref)
*TabNorm.Value(0,Jderiv)
*DerVecNor.Value(Pderiv,Qderiv-Jderiv);
for (Ideriv = 1 ; Ideriv <= Pderiv ; Ideriv++)
for (Jderiv = 0 ; Jderiv <= Qderiv ; Jderiv++)
DerNor = DerNor - PLib::Bin(Pderiv+Iduref,Ideriv+Iduref)
*PLib::Bin(Qderiv+Idvref,Jderiv+Idvref)
*TabNorm.Value(Ideriv,Jderiv)
*DerVecNor.Value(Pderiv-Ideriv,Qderiv-Jderiv);
DerNor = DerNor / PLib::Bin(Pderiv+Iduref,Iduref)
/ PLib::Bin(Qderiv+Idvref,Idvref)
/ TabNorm.Value(0,0);
DerVecNor.SetValue(Pderiv,Qderiv,DerNor);
}
} }
return DerVecNor.Value(Nu,Nv);
for (Standard_Integer Jderiv = 0; Jderiv < Qderiv; Jderiv++)
{
Scal = Scal - PLib::Bin (Qderiv, Jderiv)
* (DerVecNor.Value (Pderiv, Jderiv) * DerVecNor.Value (0, Qderiv - Jderiv));
}
for (Standard_Integer Ideriv = 1; Ideriv < Pderiv; Ideriv++)
{
for (Standard_Integer Jderiv = 0; Jderiv <= Qderiv; Jderiv++)
{
Scal = Scal - PLib::Bin (Pderiv, Ideriv)
* PLib::Bin (Qderiv, Jderiv)
* (DerVecNor.Value (Ideriv, Jderiv) * DerVecNor.Value (Pderiv - Ideriv, Qderiv - Jderiv));
}
}
}
else
{
for (Standard_Integer Ideriv = 1; Ideriv <= Pderiv; Ideriv++)
{
Scal = Scal - PLib::Bin (Pderiv, Ideriv)
* DerVecNor.Value (Ideriv, 0)
* DerVecNor.Value (Pderiv - Ideriv, Qderiv);
}
for (Standard_Integer Ideriv = 0; Ideriv < Pderiv; Ideriv++)
{
Scal = Scal - PLib::Bin (Pderiv, Ideriv)
* DerVecNor.Value (Ideriv, Qderiv)
* DerVecNor.Value (Pderiv - Ideriv, 0);
}
for (Standard_Integer Ideriv = 0; Ideriv <= Pderiv; Ideriv++)
{
for (Standard_Integer Jderiv = 1; Jderiv < Qderiv; Jderiv++)
{
Scal = Scal - PLib::Bin (Pderiv, Ideriv)
* PLib::Bin (Qderiv, Jderiv)
* (DerVecNor.Value (Ideriv, Jderiv) * DerVecNor.Value (Pderiv - Ideriv, Qderiv - Jderiv));
}
}
}
TabScal.SetValue (Pderiv, Qderiv, Scal/2.);
// Compute the derivative (n,p) of NUV Length
Dnorm = (DerNUV.Value (Pderiv + Iduref, Qderiv + Idvref)) * DerVecNor.Value (0, 0);
for (Standard_Integer Jderiv = 0; Jderiv < Qderiv; Jderiv++)
{
Dnorm = Dnorm - PLib::Bin (Qderiv + Idvref, Jderiv + Idvref)
* TabNorm.Value (Pderiv, Jderiv)
* TabScal.Value (0, Qderiv - Jderiv);
}
for (Standard_Integer Ideriv = 0; Ideriv < Pderiv; Ideriv++)
{
for (Standard_Integer Jderiv = 0; Jderiv <= Qderiv; Jderiv++)
{
Dnorm = Dnorm - PLib::Bin (Pderiv + Iduref, Ideriv + Iduref)
* PLib::Bin (Qderiv + Idvref, Jderiv + Idvref)
* TabNorm.Value (Ideriv, Jderiv)
* TabScal.Value (Pderiv - Ideriv, Qderiv - Jderiv);
}
}
TabNorm.SetValue (Pderiv, Qderiv, Dnorm);
// Compute derivative (p,q) of n
DerNor = DerNUV.Value (Pderiv + Iduref, Qderiv + Idvref);
for (Standard_Integer Jderiv = 1; Jderiv <= Qderiv; Jderiv++)
{
DerNor = DerNor - PLib::Bin (Pderiv + Iduref, Iduref)
* PLib::Bin (Qderiv + Idvref, Jderiv + Idvref)
* TabNorm.Value (0, Jderiv)
* DerVecNor.Value (Pderiv, Qderiv - Jderiv);
}
for (Standard_Integer Ideriv = 1; Ideriv <= Pderiv; Ideriv++)
{
for (Standard_Integer Jderiv = 0; Jderiv <= Qderiv; Jderiv++)
{
DerNor = DerNor - PLib::Bin (Pderiv + Iduref, Ideriv + Iduref)
* PLib::Bin (Qderiv + Idvref, Jderiv + Idvref)
* TabNorm.Value (Ideriv, Jderiv)
* DerVecNor.Value (Pderiv - Ideriv, Qderiv - Jderiv);
}
}
DerNor = DerNor / PLib::Bin (Pderiv + Iduref, Iduref)
/ PLib::Bin (Qderiv + Idvref, Idvref)
/ TabNorm.Value (0, 0);
DerVecNor.SetValue (Pderiv, Qderiv, DerNor);
}
}
return DerVecNor.Value(Nu,Nv);
} }
#undef D1uD1vRatioIsNull
#undef D1vD1uRatioIsNull
#undef D1uIsParallelD1v
#undef D1uIsNull
#undef D1vIsNull
#undef D1IsNull
#undef Done
#undef D1NuIsNull
#undef D1NvIsNull
#undef D1NuIsParallelD1Nv
#undef D1NIsNull
#undef D1NuNvRatioIsNull
#undef D1NvNuRatioIsNull
#undef InfinityOfSolutions
#undef Resolution

View File

@ -23,6 +23,8 @@
// numerically as &#x..; // numerically as &#x..;
//#define LDOM_ALLOW_LATIN_1 //#define LDOM_ALLOW_LATIN_1
namespace
{
const int NORMAL_C = 0; const int NORMAL_C = 0;
const int CHAR_REF = -1; const int CHAR_REF = -1;
const int ENTI_AMP = 1; const int ENTI_AMP = 1;
@ -31,12 +33,13 @@ const int ENTI_GT = 3;
const int ENTI_QUOT = 4; const int ENTI_QUOT = 4;
//const int ENTI_APOS = 5; //const int ENTI_APOS = 5;
struct entityRef { struct entityRef
const char * name; {
const int length; const char* name;
int length;
entityRef (const char * aName, const int aLen) : name(aName), length(aLen) {} entityRef (const char * aName, const int aLen) : name(aName), length(aLen) {}
void operator= (const entityRef&);
}; };
}
//======================================================================= //=======================================================================
//function : Decode //function : Decode

View File

@ -443,7 +443,9 @@ static Standard_Boolean StaticPath(const Handle(TCollection_HAsciiString)& val)
if (theintup < num) theintup = num; if (theintup < num) theintup = num;
if (theenums->Value(num).Length() == 0) if (theenums->Value(num).Length() == 0)
{
theenums->SetValue(num,TCollection_AsciiString(val)); theenums->SetValue(num,TCollection_AsciiString(val));
}
// On met AUSSI dans le dictionnaire // On met AUSSI dans le dictionnaire
// else { // else {
theeadds.Bind (val,num); theeadds.Bind (val,num);

View File

@ -66,23 +66,13 @@ public:
// ******** More // ******** More
Standard_Boolean More (void) const Standard_Boolean More (void) const
{ return (myCurrent!=NULL); } { return (myCurrent!=NULL); }
// ******** Assignment operator
Iterator& operator= (const Iterator& theIt)
{
if (&theIt != this)
{
myCurrent = theIt.myCurrent;
myPrevious = theIt.myPrevious;
}
return * this;
}
//skt----------------------------------------------------
// ******** Comparison operator // ******** Comparison operator
Standard_Boolean operator== (const Iterator& theIt) const Standard_Boolean operator== (const Iterator& theIt) const
{ {
return myCurrent == theIt.myCurrent; return myCurrent == theIt.myCurrent;
} }
//-------------------------------------------------------
//! Performs comparison of two iterators //! Performs comparison of two iterators
Standard_Boolean IsEqual (const Iterator& theOther) const Standard_Boolean IsEqual (const Iterator& theOther) const
{ {

View File

@ -75,13 +75,6 @@ public:
myPrevious = (isStart ? NULL : theSeq.myLastItem); myPrevious = (isStart ? NULL : theSeq.myLastItem);
} }
//! Assignment
Iterator& operator = (const Iterator& theOther)
{
myCurrent = theOther.myCurrent;
myPrevious = theOther.myPrevious;
return *this;
}
//! Switch to previous element; note that it will reset //! Switch to previous element; note that it will reset
void Previous() void Previous()
{ {

View File

@ -14,23 +14,10 @@
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <NCollection_BaseVector.hxx> #include <NCollection_BaseVector.hxx>
#include <Standard_RangeError.hxx> #include <Standard_RangeError.hxx>
#include <cstdlib> #include <cstdlib>
//=======================================================================
//function : NCollection_BaseVector::Iterator::copyV
//purpose : Copy from another iterator
//=======================================================================
void NCollection_BaseVector::Iterator::copyV (const NCollection_BaseVector::Iterator& theOth)
{
myVector = theOth.myVector;
myICurBlock = theOth.myICurBlock;
myIEndBlock = theOth.myIEndBlock;
myCurIndex = theOth.myCurIndex;
myEndIndex = theOth.myEndIndex;
}
//======================================================================= //=======================================================================
//function : initV //function : initV
//purpose : Initialisation of iterator by a vector //purpose : Initialisation of iterator by a vector

View File

@ -79,15 +79,8 @@ protected:
initV (theVector, theToEnd); initV (theVector, theToEnd);
} }
Iterator (const Iterator& theVector)
{
copyV (theVector);
}
Standard_EXPORT void initV (const NCollection_BaseVector& theVector, Standard_Boolean theToEnd = Standard_False); Standard_EXPORT void initV (const NCollection_BaseVector& theVector, Standard_Boolean theToEnd = Standard_False);
Standard_EXPORT void copyV (const Iterator&);
Standard_Boolean moreV() const Standard_Boolean moreV() const
{ {
return (myICurBlock < myIEndBlock || myCurIndex < myEndIndex); return (myICurBlock < myIEndBlock || myCurIndex < myEndIndex);
@ -136,6 +129,7 @@ protected:
return &myVector->myData[myICurBlock]; return &myVector->myData[myICurBlock];
} }
protected:
const NCollection_BaseVector* myVector; //!< the Master vector const NCollection_BaseVector* myVector; //!< the Master vector
Standard_Integer myICurBlock; //!< # of the current block Standard_Integer myICurBlock; //!< # of the current block
Standard_Integer myIEndBlock; Standard_Integer myIEndBlock;

View File

@ -61,23 +61,12 @@ public:
Iterator (const NCollection_Vector& theVector, Standard_Boolean theToEnd = Standard_False) Iterator (const NCollection_Vector& theVector, Standard_Boolean theToEnd = Standard_False)
: NCollection_BaseVector::Iterator (theVector, theToEnd) {} : NCollection_BaseVector::Iterator (theVector, theToEnd) {}
//! Copy constructor
Iterator (const Iterator& theOther)
: NCollection_BaseVector::Iterator (theOther) {}
//! Initialisation //! Initialisation
void Init (const NCollection_Vector& theVector) void Init (const NCollection_Vector& theVector)
{ {
initV (theVector); initV (theVector);
} }
//! Assignment
Iterator& operator= (const Iterator& theOther)
{
copyV (theOther);
return *this;
}
//! Check end //! Check end
Standard_Boolean More() const Standard_Boolean More() const
{ {

View File

@ -35,27 +35,25 @@
IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_ViewerSelector, Standard_Transient) IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_ViewerSelector, Standard_Transient)
namespace { namespace
// Comparison operator for sorting selection results {
//! Comparison operator for sorting selection results
class CompareResults class CompareResults
{ {
public: public:
CompareResults (const SelectMgr_IndexedDataMapOfOwnerCriterion& aMapOfCriterion) CompareResults (const SelectMgr_IndexedDataMapOfOwnerCriterion& theMapOfCriterion)
: myMapOfCriterion (aMapOfCriterion) : myMapOfCriterion (&theMapOfCriterion)
{ {
} }
Standard_Boolean operator() (Standard_Integer theLeft, Standard_Integer theRight) const Standard_Boolean operator() (Standard_Integer theLeft, Standard_Integer theRight) const
{ {
return myMapOfCriterion.FindFromIndex(theLeft) > myMapOfCriterion.FindFromIndex(theRight); return myMapOfCriterion->FindFromIndex (theLeft) > myMapOfCriterion->FindFromIndex (theRight);
} }
private: private:
void operator = (const CompareResults&); const SelectMgr_IndexedDataMapOfOwnerCriterion* myMapOfCriterion;
private:
const SelectMgr_IndexedDataMapOfOwnerCriterion& myMapOfCriterion;
}; };
static const Graphic3d_Mat4d SelectMgr_ViewerSelector_THE_IDENTITY_MAT; static const Graphic3d_Mat4d SelectMgr_ViewerSelector_THE_IDENTITY_MAT;

View File

@ -128,8 +128,12 @@ Standard_Boolean ShapeAnalysis_Geom::NearestPlane(const TColgp_Array1OfPnt& Pnts
gp_GTrsf gtrsf; gp_GTrsf gtrsf;
for (Standard_Integer i = 1; i <= 3; i ++) for (Standard_Integer i = 1; i <= 3; i ++)
{
for (Standard_Integer j = 1; j <= 4; j ++) for (Standard_Integer j = 1; j <= 4; j ++)
{
gtrsf.SetValue (i,j, coefs->Value(i,j)); gtrsf.SetValue (i,j, coefs->Value(i,j));
}
}
//try { //szv#4:S4163:12Mar99 waste try //try { //szv#4:S4163:12Mar99 waste try
//// trsf = gtrsf.Trsf(); //// trsf = gtrsf.Trsf();