diff --git a/src/AppDef/AppDef_LinearCriteria.cxx b/src/AppDef/AppDef_LinearCriteria.cxx index 9a138851d4..6b098f753d 100644 --- a/src/AppDef/AppDef_LinearCriteria.cxx +++ b/src/AppDef/AppDef_LinearCriteria.cxx @@ -353,53 +353,73 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min, // (critere sureleve => Non minimisation ) for(i = 0; i <= 2; i++) + { if((ValCri[i] < 0.8 * myEstimation[i]) && (myEstimation[i] > JEsMin[i])) { if(ICDANA < 1) ICDANA = 1; if(ValCri[i] < 0.1 * myEstimation[i]) ICDANA = 2; myEstimation[i] = Max(1.05*ValCri[i], JEsMin[i]); } - + } // (3) Mise a jours des Estimation // (critere sous-estimer => mauvais conditionement) - - if (ValCri[0] > myEstimation[0] * 2) { - myEstimation[0] += ValCri[0] * .1; - if (ICDANA == 0) { - if (ValCri[0] > myEstimation[0] * 10) { - ICDANA = 2; - } - else ICDANA = 1; - } - else { - ICDANA = 2; - } + if (ValCri[0] > myEstimation[0] * 2) + { + myEstimation[0] += ValCri[0] * .1; + if (ICDANA == 0) + { + if (ValCri[0] > myEstimation[0] * 10) + { + ICDANA = 2; + } + else + { + ICDANA = 1; + } } - if (ValCri[1] > myEstimation[1] * 20) { - myEstimation[1] += ValCri[1] * .1; - if (ICDANA == 0) { - if (ValCri[1] > myEstimation[1] * 100) { - ICDANA = 2; - } - else ICDANA = 1; - } - else { - ICDANA = 2; - } + 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; - } + } + if (ValCri[1] > myEstimation[1] * 20) + { + myEstimation[1] += ValCri[1] * .1; + if (ICDANA == 0) + { + 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 (ICDANA == 0) + { + if (ValCri[2] > myEstimation[2] * 100) + { + ICDANA = 2; + } + else + { + ICDANA = 1; + } + } + else + { + ICDANA = 2; + } + } return ICDANA; } diff --git a/src/CSLib/CSLib.cxx b/src/CSLib/CSLib.cxx index 4217b94143..f526dd5498 100644 --- a/src/CSLib/CSLib.cxx +++ b/src/CSLib/CSLib.cxx @@ -27,24 +27,6 @@ #include #include -#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 ( const gp_Vec& D1U, @@ -61,18 +43,18 @@ gp_Dir& Normal gp_Vec D1UvD1V = D1U.Crossed(D1V); if (D1UMag <= gp::Resolution() && D1VMag <= gp::Resolution()) { - theStatus = D1IsNull; + theStatus = CSLib_D1IsNull; } - else if (D1UMag <= gp::Resolution()) theStatus = D1uIsNull; - else if (D1VMag <= gp::Resolution()) theStatus = D1vIsNull; -// else if ((D1VMag / D1UMag) <= RealEpsilon()) theStatus = D1vD1uRatioIsNull; -// else if ((D1UMag / D1VMag) <= RealEpsilon()) theStatus = D1uD1vRatioIsNull; + else if (D1UMag <= gp::Resolution()) theStatus = CSLib_D1uIsNull; + else if (D1VMag <= gp::Resolution()) theStatus = CSLib_D1vIsNull; +// else if ((D1VMag / D1UMag) <= RealEpsilon()) theStatus = CSLib_D1vD1uRatioIsNull; +// else if ((D1UMag / D1VMag) <= RealEpsilon()) theStatus = CSLib_D1uD1vRatioIsNull; else { Standard_Real Sin2 = D1UvD1V.SquareMagnitude() / (D1UMag * D1VMag); - if (Sin2 < (SinTol * SinTol)) { theStatus = D1uIsParallelD1v; } - else { Normal = gp_Dir (D1UvD1V); theStatus = Done; } + if (Sin2 < (SinTol * SinTol)) { theStatus = CSLib_D1uIsParallelD1v; } + else { Normal = gp_Dir (D1UvD1V); theStatus = CSLib_Done; } } } @@ -107,25 +89,25 @@ gp_Dir& Normal if (LD1Nu <= RealEpsilon() && LD1Nv <= RealEpsilon()) { - theStatus = D1NIsNull; + theStatus = CSLib_D1NIsNull; Done = Standard_False; } else if (LD1Nu < RealEpsilon()) { - theStatus = D1NuIsNull; + theStatus = CSLib_D1NuIsNull; Done = Standard_True; Normal = gp_Dir (D1Nv); } else if (LD1Nv < RealEpsilon()) { - theStatus = D1NvIsNull; + theStatus = CSLib_D1NvIsNull; Done = Standard_True; Normal = gp_Dir (D1Nu); } else if ((LD1Nv / LD1Nu) <= RealEpsilon()) { - theStatus = D1NvNuRatioIsNull; + theStatus = CSLib_D1NvNuRatioIsNull; Done = Standard_False; } else if ((LD1Nu / LD1Nv) <= RealEpsilon()) { - theStatus = D1NuNvRatioIsNull; + theStatus = CSLib_D1NuNvRatioIsNull; Done = Standard_False; } else { @@ -133,12 +115,12 @@ gp_Dir& Normal Standard_Real Sin2 = D1NCross.SquareMagnitude() / (LD1Nu * LD1Nv); if (Sin2 < (SinTol * SinTol)) { - theStatus = D1NuIsParallelD1Nv; + theStatus = CSLib_D1NuIsParallelD1Nv; Done = Standard_True; Normal = gp_Dir (D1Nu); } else { - theStatus = InfinityOfSolutions; + theStatus = CSLib_InfinityOfSolutions; Done = Standard_False; } } @@ -161,7 +143,7 @@ gp_Dir& Normal if (NMag <= MagTol || D1UMag <= MagTol || D1VMag <= MagTol ) { - theStatus = Singular; + theStatus = CSLib_Singular; // if (D1UMag <= MagTol || D1VMag <= MagTol && NMag > MagTol) MagTol = 2* NMag; } else @@ -170,7 +152,7 @@ gp_Dir& Normal gp_Dir aD1U(D1U); gp_Dir aD1V(D1V); 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) { - theStatus = Defined; + theStatus = CSLib_Defined; Normal=D.Normalized(); } else @@ -373,16 +355,16 @@ void CSLib::Normal(const Standard_Integer MaxOrder, //Polynom is always negative SP=-1; if(SP==0) - theStatus = InfinityOfSolutions; + theStatus = CSLib_InfinityOfSolutions; else { - theStatus = Defined; + theStatus = CSLib_Defined; Normal=SP*Vk0.Normalized(); } } else { - theStatus = Defined; + theStatus = CSLib_Defined; Normal=D.Normalized(); } } @@ -439,120 +421,126 @@ gp_Vec CSLib::DNNormal(const Standard_Integer Nu, const Standard_Integer Iduref, const Standard_Integer Idvref) { -Standard_Integer Kderiv; -Kderiv=Nu+Nv; -TColgp_Array2OfVec DerVecNor(0,Kderiv,0,Kderiv); -TColStd_Array2OfReal TabScal(0,Kderiv,0,Kderiv); -TColStd_Array2OfReal TabNorm(0,Kderiv,0,Kderiv); -Standard_Integer Ideriv,Jderiv,Mderiv,Pderiv,Qderiv; -Standard_Real Scal,Dnorm; -gp_Vec DerNor; -DerNor=(DerNUV.Value(Iduref,Idvref)).Normalized(); -DerVecNor.SetValue(0,0,DerNor); -Dnorm=DerNUV.Value(Iduref,Idvref)*DerVecNor.Value(0,0); -TabNorm.SetValue(0,0,Dnorm); -TabScal.SetValue(0,0,0.); -for ( Mderiv = 1;Mderiv <= Kderiv; Mderiv++) - for ( Pderiv = 0 ; Pderiv <= Mderiv ; Pderiv++) + const Standard_Integer Kderiv = Nu + Nv; + TColgp_Array2OfVec DerVecNor(0,Kderiv,0,Kderiv); + TColStd_Array2OfReal TabScal(0,Kderiv,0,Kderiv); + TColStd_Array2OfReal TabNorm(0,Kderiv,0,Kderiv); + gp_Vec DerNor = (DerNUV.Value (Iduref, Idvref)).Normalized(); + DerVecNor.SetValue(0,0,DerNor); + Standard_Real Dnorm = DerNUV.Value (Iduref, Idvref) * DerVecNor.Value (0, 0); + TabNorm.SetValue(0,0,Dnorm); + TabScal.SetValue(0,0,0.); + + for (Standard_Integer Mderiv = 1; Mderiv <= Kderiv; Mderiv++) + { + for (Standard_Integer 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; - if (Pderiv <= Nu && Qderiv <= Nv) - { -// -// 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 Value(num).Length() == 0) + { theenums->SetValue(num,TCollection_AsciiString(val)); + } // On met AUSSI dans le dictionnaire // else { theeadds.Bind (val,num); diff --git a/src/NCollection/NCollection_BaseList.hxx b/src/NCollection/NCollection_BaseList.hxx index e98a2c3352..f50adbb5c9 100644 --- a/src/NCollection/NCollection_BaseList.hxx +++ b/src/NCollection/NCollection_BaseList.hxx @@ -66,23 +66,13 @@ public: // ******** More Standard_Boolean More (void) const { return (myCurrent!=NULL); } - // ******** Assignment operator - Iterator& operator= (const Iterator& theIt) - { - if (&theIt != this) - { - myCurrent = theIt.myCurrent; - myPrevious = theIt.myPrevious; - } - return * this; - } -//skt---------------------------------------------------- + // ******** Comparison operator Standard_Boolean operator== (const Iterator& theIt) const { return myCurrent == theIt.myCurrent; } -//------------------------------------------------------- + //! Performs comparison of two iterators Standard_Boolean IsEqual (const Iterator& theOther) const { diff --git a/src/NCollection/NCollection_BaseSequence.hxx b/src/NCollection/NCollection_BaseSequence.hxx index bbb0df369c..99f99cfbe2 100644 --- a/src/NCollection/NCollection_BaseSequence.hxx +++ b/src/NCollection/NCollection_BaseSequence.hxx @@ -75,13 +75,6 @@ public: 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 void Previous() { diff --git a/src/NCollection/NCollection_BaseVector.cxx b/src/NCollection/NCollection_BaseVector.cxx index 961fd633e7..dd8cae7498 100755 --- a/src/NCollection/NCollection_BaseVector.cxx +++ b/src/NCollection/NCollection_BaseVector.cxx @@ -14,23 +14,10 @@ // commercial license or contractual agreement. #include + #include #include -//======================================================================= -//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 //purpose : Initialisation of iterator by a vector diff --git a/src/NCollection/NCollection_BaseVector.hxx b/src/NCollection/NCollection_BaseVector.hxx index 08c6a61615..db68b8613d 100755 --- a/src/NCollection/NCollection_BaseVector.hxx +++ b/src/NCollection/NCollection_BaseVector.hxx @@ -79,15 +79,8 @@ protected: 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 copyV (const Iterator&); - Standard_Boolean moreV() const { return (myICurBlock < myIEndBlock || myCurIndex < myEndIndex); @@ -136,6 +129,7 @@ protected: return &myVector->myData[myICurBlock]; } + protected: const NCollection_BaseVector* myVector; //!< the Master vector Standard_Integer myICurBlock; //!< # of the current block Standard_Integer myIEndBlock; diff --git a/src/NCollection/NCollection_Vector.hxx b/src/NCollection/NCollection_Vector.hxx index 7594290ac0..ef763f9d74 100755 --- a/src/NCollection/NCollection_Vector.hxx +++ b/src/NCollection/NCollection_Vector.hxx @@ -61,23 +61,12 @@ public: Iterator (const NCollection_Vector& theVector, Standard_Boolean theToEnd = Standard_False) : NCollection_BaseVector::Iterator (theVector, theToEnd) {} - //! Copy constructor - Iterator (const Iterator& theOther) - : NCollection_BaseVector::Iterator (theOther) {} - //! Initialisation void Init (const NCollection_Vector& theVector) { initV (theVector); } - //! Assignment - Iterator& operator= (const Iterator& theOther) - { - copyV (theOther); - return *this; - } - //! Check end Standard_Boolean More() const { diff --git a/src/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/SelectMgr/SelectMgr_ViewerSelector.cxx index 94b4769bc0..67e11c0074 100644 --- a/src/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -35,27 +35,25 @@ IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_ViewerSelector, Standard_Transient) -namespace { - // Comparison operator for sorting selection results +namespace +{ + //! Comparison operator for sorting selection results class CompareResults { public: - - CompareResults (const SelectMgr_IndexedDataMapOfOwnerCriterion& aMapOfCriterion) - : myMapOfCriterion (aMapOfCriterion) + + CompareResults (const SelectMgr_IndexedDataMapOfOwnerCriterion& theMapOfCriterion) + : myMapOfCriterion (&theMapOfCriterion) { } 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: - void operator = (const CompareResults&); - - private: - const SelectMgr_IndexedDataMapOfOwnerCriterion& myMapOfCriterion; + const SelectMgr_IndexedDataMapOfOwnerCriterion* myMapOfCriterion; }; static const Graphic3d_Mat4d SelectMgr_ViewerSelector_THE_IDENTITY_MAT; diff --git a/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx b/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx index b523f3b549..5cc592f51f 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Geom.cxx @@ -128,8 +128,12 @@ Standard_Boolean ShapeAnalysis_Geom::NearestPlane(const TColgp_Array1OfPnt& Pnts gp_GTrsf gtrsf; for (Standard_Integer i = 1; i <= 3; i ++) + { for (Standard_Integer j = 1; j <= 4; j ++) + { gtrsf.SetValue (i,j, coefs->Value(i,j)); + } + } //try { //szv#4:S4163:12Mar99 waste try //// trsf = gtrsf.Trsf();