From 1d8add2970ad2e5505c17df53808c5aafa9f24bf Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Wed, 17 Dec 2025 10:23:13 +0000 Subject: [PATCH] Coding - Translate French comments and modernize constants (#932) This commit performs safe code cleanup across multiple modules: 1. French to English comment translations: - ApplicationFramework: TNaming, TDF, TDataStd packages - ModelingAlgorithms: BRepFill, TopOpeBRepBuild, TopOpeBRepTool, NLPlate, FairCurve, IntSurf, Contap, ShapeFix, MAT2d, LocOpe - ModelingData: ProjLib, GeomLib, GeomConvert, IntAna, AppDef, GCPnts, Hermit, BinTools, LProp - Visualization: PrsDim, AIS, V3d packages 2. Constexpr modernization: - Convert static const variables to constexpr - Replace #define macros with constexpr variables - Add anonymous namespaces for internal constants - Affected files: V3d_View, V3d_CircularGrid, V3d_RectangularGrid, Graphic3d_FrameStats, PrsDim_*, Convert_*ToBSplineSurface, math_BrentMinimum, and others 3. Code organization: - Wrap file-scope constants in anonymous namespaces - Use consistent naming convention (THE_* prefix) No functional changes - all modifications are comment-only or compile-time constant improvements that preserve identical runtime behavior. --- .../TKCAF/TNaming/TNaming.cxx | 8 +- .../TKCAF/TNaming/TNaming_NamedShape.cxx | 8 +- .../TKCAF/TNaming/TNaming_Naming.cxx | 4 +- .../TKCDF/LDOM/LDOM_CharReference.cxx | 14 +-- .../TKLCAF/TDF/TDF_Label.cxx | 4 +- .../TKLCAF/TDataStd/TDataStd_Real.cxx | 2 +- .../Convert/Convert_ConeToBSplineSurface.cxx | 15 ++- .../Convert_CylinderToBSplineSurface.cxx | 15 ++- .../Convert_SphereToBSplineSurface.cxx | 15 ++- .../Convert/Convert_TorusToBSplineSurface.cxx | 15 ++- .../TKMath/math/math_BrentMinimum.cxx | 5 +- .../TKMath/math/math_FunctionRoots.cxx | 36 +++--- .../TKMath/math/math_FunctionSetRoot.cxx | 28 ++--- .../BRepFill/BRepFill_CompatibleWires.cxx | 12 +- .../TopOpeBRepBuild_CompositeClassifier.cxx | 6 +- .../TopOpeBRepBuild_FuseFace.cxx | 6 +- .../TopOpeBRepTool_SolidClassifier.cxx | 6 +- .../TKFeat/LocOpe/LocOpe_Generator.cxx | 2 +- .../FairCurve_DistributionOfJerk.cxx | 2 +- .../FairCurve_DistributionOfSagging.cxx | 2 +- .../FairCurve_DistributionOfTension.cxx | 2 +- .../TKGeomAlgo/IntSurf/IntSurf.cxx | 4 +- .../NLPlate/NLPlate_HGPPConstraint.cxx | 8 +- .../TKHLR/Contap/Contap_Contour.cxx | 2 +- .../TKShHealing/ShapeFix/ShapeFix_Edge.cxx | 4 +- .../TKTopAlgo/MAT2d/MAT2d_Mat2d.cxx | 4 +- .../TKBRep/BinTools/BinTools_ShapeSet.cxx | 2 +- .../TKG2d/LProp/LProp_SLProps.gxx | 6 +- .../AppDef/AppDef_LinearCriteria.cxx | 2 +- .../TKGeomBase/AppDef/AppDef_Variational.cxx | 18 +-- .../GCPnts/GCPnts_QuasiUniformDeflection.cxx | 4 +- .../GCPnts/GCPnts_TangentialDeflection.cxx | 2 +- .../Geom2dConvert/Geom2dConvert.cxx | 4 +- .../TKGeomBase/GeomConvert/GeomConvert.cxx | 2 +- ...ert_CompBezierSurfacesToBSplineSurface.cxx | 14 +-- .../GeomConvert_CurveToAnaCurve.cxx | 2 +- .../TKGeomBase/GeomLib/GeomLib.cxx | 50 ++++---- src/ModelingData/TKGeomBase/Hermit/Hermit.cxx | 2 +- .../TKGeomBase/IntAna/IntAna_IntConicQuad.cxx | 6 +- .../TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx | 44 +++---- .../ProjLib/ProjLib_ComputeApprox.cxx | 14 +-- .../TKGeomBase/ProjLib/ProjLib_Cone.cxx | 4 +- .../ProjLib/ProjLib_ProjectOnPlane.cxx | 30 ++--- .../ProjLib/ProjLib_ProjectOnSurface.cxx | 24 ++-- .../ProjLib/ProjLib_ProjectedCurve.cxx | 6 +- .../TKGeomBase/ProjLib/ProjLib_Torus.cxx | 8 +- .../TKOpenGl/OpenGl/OpenGl_LayerList.cxx | 13 +- .../TKService/Graphic3d/Graphic3d_Camera.cxx | 6 +- .../Graphic3d/Graphic3d_FrameStats.cxx | 11 +- .../TKService/Media/Media_FormatContext.cxx | 8 +- src/Visualization/TKV3d/AIS/AIS_Axis.cxx | 2 +- .../TKV3d/AIS/AIS_CameraFrustum.cxx | 4 +- src/Visualization/TKV3d/AIS/AIS_Selection.cxx | 2 +- src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx | 6 +- .../TKV3d/PrsDim/PrsDim_AngleDimension.cxx | 6 +- .../TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx | 6 +- .../TKV3d/PrsDim/PrsDim_Dimension.cxx | 6 +- .../TKV3d/PrsDim/PrsDim_FixRelation.cxx | 2 +- .../TKV3d/PrsDim/PrsDim_OffsetDimension.cxx | 2 +- .../TKV3d/PrsDim/PrsDim_ParallelRelation.cxx | 6 +- .../PrsDim/PrsDim_PerpendicularRelation.cxx | 8 +- .../TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx | 12 +- .../TKV3d/V3d/V3d_CircularGrid.cxx | 10 +- .../TKV3d/V3d/V3d_RectangularGrid.cxx | 6 +- src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx | 8 +- src/Visualization/TKV3d/V3d/V3d_View.cxx | 113 +++++++++--------- 66 files changed, 362 insertions(+), 348 deletions(-) diff --git a/src/ApplicationFramework/TKCAF/TNaming/TNaming.cxx b/src/ApplicationFramework/TKCAF/TNaming/TNaming.cxx index 0dd26958bc..3192ddd669 100644 --- a/src/ApplicationFramework/TKCAF/TNaming/TNaming.cxx +++ b/src/ApplicationFramework/TKCAF/TNaming/TNaming.cxx @@ -260,9 +260,9 @@ void TNaming::Update(const TDF_Label& L, TopTools_DataMapOfShapeShape& M) } } - // SI Les shapes dans les sous-labels sont des sous shapes des shapes de L - // si les shapes de L n ont pas changes les shapes des sous-labels ne seront - // pas changes non plus. + // IF the shapes in sub-labels are sub-shapes of L's shapes, + // if L's shapes have not changed, the sub-label shapes will not + // be changed either. for (TDF_ChildIterator ciL(L); ciL.More(); ciL.Next()) { TNaming::Update(ciL.Value(), M); @@ -486,7 +486,7 @@ void TNaming::Replicate(const TopoDS_Shape& SH, const gp_Trsf& T, const TDF_Labe BRepBuilderAPI_Transform opeTrsf(T); if (SH.ShapeType() == TopAbs_FACE || SH.ShapeType() == TopAbs_WIRE) { - opeTrsf.Perform(SH, Standard_True); // pour le pattern de prism + opeTrsf.Perform(SH, Standard_True); // for the prism pattern } else { diff --git a/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx b/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx index 684fe907c8..a8ca008650 100644 --- a/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx +++ b/src/ApplicationFramework/TKCAF/TNaming/TNaming_NamedShape.cxx @@ -372,15 +372,15 @@ Standard_Boolean TNaming_NamedShape::AfterUndo(const Handle(TDF_AttributeDelta)& Handle(TDF_Attribute) TNaming_NamedShape::BackupCopy() const { - // Remarque dans le copy il est important de reporter le noeud de l attribut - // pour ne pas casser le chemin nextSameShape. + // Note: in the copy, it is important to copy the attribute node + // to not break the nextSameShape path. Handle(TNaming_NamedShape) Cop = new TNaming_NamedShape(); Cop->myNode = myNode; Cop->myEvolution = myEvolution; Cop->myVersion = myVersion; - // Mise a jour de myAtt sur les noeuds dans l attribut. + // Update myAtt on the nodes in the attribute. TNaming_Node* CN = Cop->myNode; Handle(TNaming_NamedShape) A = this; @@ -613,7 +613,7 @@ static void UpdateFirstUseOrNextSameShape(TNaming_RefShape*& prs, TNaming_Node*& break; } } - // boucle interdite et inutile. + // forbidden and useless loop. if (ldn != pdn) { if (ldn->myOld == prs) diff --git a/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx b/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx index 2826d7beb1..e2d9980b3d 100644 --- a/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx +++ b/src/ApplicationFramework/TKCAF/TNaming/TNaming_Naming.cxx @@ -1181,8 +1181,8 @@ static Handle(TNaming_NamedShape) BuildName(const TDF_Label& F, if (OnlyOne) { //------------------------------------------------- - // Filtre par les voisins - // pour construire le nom correspondant a S. + // Filter by neighbors + // to build the name corresponding to S. //------------------------------------------------- if (NS.IsNull()) diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx index f4baf767a3..7f48cc372a 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_CharReference.cxx @@ -28,14 +28,12 @@ namespace { -const int NORMAL_C = 0; -const int CHAR_REF = -1; -const int ENTI_AMP = 1; -const int ENTI_LT = 2; -const int ENTI_GT = 3; -const int ENTI_QUOT = 4; - -// const int ENTI_APOS = 5; +constexpr int NORMAL_C = 0; +constexpr int CHAR_REF = -1; +constexpr int ENTI_AMP = 1; +constexpr int ENTI_LT = 2; +constexpr int ENTI_GT = 3; +constexpr int ENTI_QUOT = 4; struct entityRef { diff --git a/src/ApplicationFramework/TKLCAF/TDF/TDF_Label.cxx b/src/ApplicationFramework/TKLCAF/TDF/TDF_Label.cxx index 6c8691ad79..64c8bae283 100644 --- a/src/ApplicationFramework/TKLCAF/TDF/TDF_Label.cxx +++ b/src/ApplicationFramework/TKLCAF/TDF/TDF_Label.cxx @@ -109,8 +109,8 @@ Standard_Integer TDF_Label::Depth() const Standard_Boolean TDF_Label::IsDescendant(const TDF_Label& aLabel) const { - // Cet algorithme remonte jusqu'a la racine. On peut s'arreter - // si la profondeur atteinte est inferieure a celle de . + // This algorithm goes up to the root. We can stop + // if the reached depth is less than that of . const TDF_LabelNode* lp1 = aLabel.myLabelNode; TDF_LabelNode* lp2 = myLabelNode; diff --git a/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_Real.cxx b/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_Real.cxx index c9dd6738ce..90248c4163 100644 --- a/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_Real.cxx +++ b/src/ApplicationFramework/TKLCAF/TDataStd/TDataStd_Real.cxx @@ -87,7 +87,7 @@ TDataStd_Real::TDataStd_Real() Standard_Boolean TDataStd_Real::IsCaptured() const { Handle(TDF_Reference) reference; - // pour test + // for test if (Label().FindAttribute(TDF_Reference::GetID(), reference)) { diff --git a/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx index 1c07e99e3b..62a475479d 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx @@ -20,12 +20,15 @@ #include #include -static const Standard_Integer TheUDegree = 2; -static const Standard_Integer TheVDegree = 1; -static const Standard_Integer TheNbUKnots = 5; -static const Standard_Integer TheNbVKnots = 2; -static const Standard_Integer TheNbUPoles = 9; -static const Standard_Integer TheNbVPoles = 2; +namespace +{ +constexpr int TheUDegree = 2; +constexpr int TheVDegree = 1; +constexpr int TheNbUKnots = 5; +constexpr int TheNbVKnots = 2; +constexpr int TheNbUPoles = 9; +constexpr int TheNbVPoles = 2; +} // namespace static void ComputePoles(const Standard_Real R, const Standard_Real A, diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx index bc03cdaeb8..373f271a40 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx @@ -20,12 +20,15 @@ #include #include -static const Standard_Integer TheUDegree = 2; -static const Standard_Integer TheVDegree = 1; -static const Standard_Integer TheNbUKnots = 5; -static const Standard_Integer TheNbVKnots = 2; -static const Standard_Integer TheNbUPoles = 9; -static const Standard_Integer TheNbVPoles = 2; +namespace +{ +constexpr int TheUDegree = 2; +constexpr int TheVDegree = 1; +constexpr int TheNbUKnots = 5; +constexpr int TheNbVKnots = 2; +constexpr int TheNbUPoles = 9; +constexpr int TheNbVPoles = 2; +} // namespace static void ComputePoles(const Standard_Real R, const Standard_Real U1, diff --git a/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx index cae65817ed..c4837f865f 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx @@ -20,12 +20,15 @@ #include #include -static const Standard_Integer TheUDegree = 2; -static const Standard_Integer TheVDegree = 2; -static const Standard_Integer MaxNbUKnots = 4; -static const Standard_Integer MaxNbVKnots = 3; -static const Standard_Integer MaxNbUPoles = 7; -static const Standard_Integer MaxNbVPoles = 5; +namespace +{ +constexpr int TheUDegree = 2; +constexpr int TheVDegree = 2; +constexpr int MaxNbUKnots = 4; +constexpr int MaxNbVKnots = 3; +constexpr int MaxNbUPoles = 7; +constexpr int MaxNbVPoles = 5; +} // namespace static void ComputePoles(const Standard_Real R, const Standard_Real U1, diff --git a/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx index cbd22c8bcb..59dc2582bf 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx @@ -20,12 +20,15 @@ #include #include -static const Standard_Integer TheUDegree = 2; -static const Standard_Integer TheVDegree = 2; -static const Standard_Integer MaxNbUKnots = 4; -static const Standard_Integer MaxNbVKnots = 4; -static const Standard_Integer MaxNbUPoles = 7; -static const Standard_Integer MaxNbVPoles = 7; +namespace +{ +constexpr int TheUDegree = 2; +constexpr int TheVDegree = 2; +constexpr int MaxNbUKnots = 4; +constexpr int MaxNbVKnots = 4; +constexpr int MaxNbUPoles = 7; +constexpr int MaxNbVPoles = 7; +} // namespace static void ComputePoles(const Standard_Real R, const Standard_Real r, diff --git a/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx b/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx index e7b2ced3b7..3e59817504 100644 --- a/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx +++ b/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx @@ -16,7 +16,10 @@ #include #include -static const Standard_Real CGOLD = 0.3819660; // 0.5*(3 - sqrt(5)); +namespace +{ +constexpr double CGOLD = 0.3819660; // 0.5*(3 - sqrt(5)) +} // namespace //================================================================================================= diff --git a/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx b/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx index 2cc0c640e2..d94c150325 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx @@ -851,7 +851,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, { if (AllNull) - { // rechercher les vraix zeros depuis le debut + { // search for the true zeros from the beginning AllNull = Standard_False; Xu = Lowr - EpsX; @@ -879,7 +879,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, if ((DFFyu > 0. && DFFxu <= 0.) || (DFFyu < 0. && FFyu >= FFxu && DFFxu <= 0.) || (DFFyu > 0. && FFyu <= FFxu && DFFxu >= 0.) || (FxuFyu <= 0.)) { - // recherche d 1 minimun possible + // search for a possible minimum Finish = Standard_False; Ambda = Increment; T = 0.; @@ -888,14 +888,14 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, if (FxuFyu > 0.) { - // chercher si f peut s annuler pour eviter - // des iterations inutiles + // check if f can become zero to avoid + // unnecessary iterations if (Fxu * (Fxu + 2. * DFxu * Increment) > 0. && Fyu * (Fyu - 2. * DFyu * Increment) > 0.) { Finish = Standard_True; - FFi = std::min(FFxu, FFyu); // pour ne pas recalculer yu + FFi = std::min(FFxu, FFyu); // to avoid recalculating yu } else if ((DFFxu <= Standard_Underflow && -DFFxu <= Standard_Underflow) || (FFxu <= Standard_Underflow && -FFxu <= Standard_Underflow)) @@ -903,7 +903,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, Finish = Standard_True; FFxu = 0.0; - FFi = FFyu; // pour recalculer yu + FFi = FFyu; // to recalculate yu } else if ((DFFyu <= Standard_Underflow && -DFFyu <= Standard_Underflow) || (FFyu <= Standard_Underflow && -FFyu <= Standard_Underflow)) @@ -911,7 +911,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, Finish = Standard_True; FFyu = 0.0; - FFi = FFxu; // pour recalculer U + FFi = FFxu; // to recalculate U } } else if (FFxu <= Standard_Underflow && -FFxu <= Standard_Underflow) @@ -931,7 +931,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, while (!Finish) { - // calcul des 2 solutions annulant la derivee de l interpolation cubique + // calculate the 2 solutions nullifying the derivative of cubic interpolation // Ambda*t=(U-Xu) F(t)=aa*t*t*t/3+bb*t*t+cc*t+d // df=aa*t*t+2*bb*t+cc @@ -971,7 +971,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } if (Alfa1 > 1. || Alfa2 < 0.) { - // resolution par dichotomie + // solve by bisection if (Fxu * Fyu < 0.) Alfa1 = 0.5; else @@ -979,11 +979,11 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } else if (Alfa1 < 0. || (DFFxu > 0. && DFFyu >= 0.)) { - // si 2 derivees >0 - //(cas changement de signe de la distance signee sans - // changement de signe de la derivee: - // cas de 'presque'tangence avec 2 - // solutions proches) ,on prend la plus grane racine + // if 2 derivatives > 0 + // (case of sign change of the signed distance without + // sign change of the derivative: + // case of 'almost' tangency with 2 + // close solutions), take the larger root if (Alfa2 > 1.) { if (Fxu * Fyu < 0.) @@ -1005,7 +1005,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, if (!Finish) { - // petits tests pour diminuer le nombre d iterations + // small tests to reduce the number of iterations if (Alfa1 <= EpsX) { Alfa1 += Alfa1; @@ -1050,9 +1050,9 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, T = Alfa1; if (Alfa1 > Ambda * 0.5) { - // remarque (1) - // determination d 1 autre borne pour diviser - // le nouvel intervalle par 2 au - + // note (1) + // determine another bound to divide + // the new interval by 2 at least Xu = U + Alfa1 * 0.5; if (Xu <= Lowr) { diff --git a/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx b/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx index 6a09c05ce9..3ead586017 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx @@ -811,9 +811,9 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, return; } Ambda2 = Gnr1; - // Le rang 0 de Save ne doit servir q'au test accelarteur en fin de boucle - // s'il on est dejas sur la solution, il faut leurer ce test pour eviter - // de faire une seconde iteration... + // Rank 0 of Save should only be used for the accelerator test at the end of the loop. + // If we are already on the solution, we need to bypass this test to avoid + // making a second iteration... Save(0) = std::max(F2, EpsSqrt); Standard_Real aTol_Func = Epsilon(F2); FSR_DEBUG("=== Mode Debug de Function Set Root" << std::endl); @@ -922,15 +922,15 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, Standard_Boolean Sortbis; // ------------------------------------------------- - // Traitement standard sans traitement des bords + // Standard processing without boundary handling // ------------------------------------------------- if (!Sort) - { // si l'on est pas sortie on essaye de progresser en avant + { // if we haven't exited, we try to progress forward while ((F2 / PreviousMinimum > Progres) && !Stop) { if (F2 < OldF && (Dy < 0.0)) { - // On essaye de progresser dans cette direction. + // We try to progress in this direction. FSR_DEBUG(" iteration de descente = " << DescenteIter); DescenteIter++; SolSave = Sol; @@ -1273,21 +1273,21 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, } } else - ChangeDirection = Standard_False; // Si oui on recommence + ChangeDirection = Standard_False; // If yes we restart } else - ChangeDirection = Standard_False; // Pas d'historique on continue - // Si le gradient ne diminue pas suffisemment par newton on essaie - // le gradient sauf si f diminue (aussi bizarre que cela puisse - // paraitre avec NEWTON le gradient de f peut augmenter alors que f - // diminue: dans ce cas il faut garder NEWTON) + ChangeDirection = Standard_False; // No history, we continue + // If the gradient does not decrease sufficiently with Newton, we try + // the gradient method unless f decreases (as strange as it may seem, + // with NEWTON the gradient of f can increase while f + // decreases: in this case we must keep NEWTON) if ((Gnr1 > 0.9 * Oldgr) && (F2 > 0.5 * PreviousMinimum)) { ChangeDirection = Standard_True; } - // Si l'on ne decide pas de changer de strategie, on verifie, - // si ce n'est dejas fait + // If we don't decide to change strategy, we verify + // if not already done if ((!ChangeDirection) && (!Verif)) { for (i = Delta.Lower(); i <= Delta.Upper(); i++) diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx index 0e32aea986..7e93b8e0a3 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx @@ -2089,7 +2089,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/) else { - // recherche du vertex correspondant a la projection conique + // search for the vertex corresponding to the conical projection Standard_Real angmin, angV, eta = Precision::Angular(); TopoDS_Vertex Vopti; angmin = M_PI / 2; @@ -2170,7 +2170,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/) } else { - // cas general + // general case gp_Pnt Pbout = Pnext; TopoDS_Edge E1, E2; TopoDS_Vertex V1, V2; @@ -2207,7 +2207,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/) if (std::abs(Pbout.Distance(P1) - Pbout.Distance(P2)) < Precision::Confusion()) { - // cas limite ; on se decale un peu + // edge case; shifting a bit Pbout = PPn; BRepAdaptor_Curve Curve1(E1); P1 = Curve1.Value(U1); @@ -2215,11 +2215,11 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/) P2 = Curve2.Value(U2); } - // calcul de rangdeb + // compute rangdeb rangdeb = 0; if (Pbout.Distance(P1) < Pbout.Distance(P2)) { - // P1 est plus proche; parcours = False + // P1 is closer; parcours = False parcours = Standard_False; rang = 0; for (anExp.Init(wire); anExp.More(); anExp.Next()) @@ -2403,7 +2403,7 @@ void BRepFill_CompatibleWires::SearchOrigin() if (ang < -M_PI/2.0) ang = -M_PI - ang; if (std::abs(ang-M_PI/2.0)Face(); if (fres.IsNull()) { - // NYI : en cas d'elimination des faces EXTERNAL et INTERNAL par le - // classifier BRepClass3d_SolidClassifier, traiter quand meme ces faces - // pour generer l'etat ON/Solid quand le point est IN/face INTERNAL ou EXTERNAL + // NYI: in case of elimination of EXTERNAL and INTERNAL faces by the + // BRepClass3d_SolidClassifier classifier, still handle these faces + // to generate ON/Solid state when the point is IN/face INTERNAL or EXTERNAL return myState; } TopAbs_Orientation ofres = fres.Orientation(); diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx index 27a662debe..13eaa3104e 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx @@ -137,7 +137,7 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G) TopTools_MapOfShape toRemove; TopTools_MapIteratorOfMapOfShape itm; - // recherche des fusions de faces + // search for face fusions for (itm.Initialize(GEdg); itm.More(); itm.Next()) { const TopoDS_Edge& edg = TopoDS::Edge(itm.Key()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx index 26dae4c692..7930deedb5 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx @@ -281,7 +281,7 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, k2++; } - // cas ou jj = ii : remplisage en triangle + // case where jj = ii: triangular fill Produit = pow(Base(2, II), 2); Produit2 = 2 * Base(2, II) * Base(3, II); // ProduitV2 = Base diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx index 4cf1be271e..78e1cdb65e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx @@ -204,7 +204,7 @@ Standard_Boolean FairCurve_DistributionOfSagging::Value(const math_Vector& TPara k2++; } - // cas ou jj = ii : remplisage en triangle + // case where jj = ii: triangular fill Produit = pow(Base(2, II), 2); // derivation en XiXi diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfTension.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfTension.cxx index fbb32fc4f3..f85d1a48f4 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfTension.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfTension.cxx @@ -176,7 +176,7 @@ Standard_Boolean FairCurve_DistributionOfTension::Value(const math_Vector& TPara * (GradDifference(ii) * GradDifference(jj) + FacteurY * Produit); // derivation en YiYj k2++; } - // cas ou jj = ii : remplisage en triangle + // case where jj = ii: triangular fill Produit = pow(Base(2, ii / 2), 2); FTension(k1) = Facteur diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf.cxx index 9d9f88edd5..45efb8bbbd 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf.cxx @@ -33,8 +33,8 @@ void IntSurf::MakeTransition(const gp_Vec& TgFirst, { - // Effectuer le produit mixte normale, tangente 1, tangente 2 - // pour avoir le type de la transition. + // Compute the mixed product of normal, tangent 1, tangent 2 + // to get the type of transition. gp_Vec pvect(TgSecond.Crossed(TgFirst)); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/NLPlate/NLPlate_HGPPConstraint.cxx b/src/ModelingAlgorithms/TKGeomAlgo/NLPlate/NLPlate_HGPPConstraint.cxx index 1ffd537e4e..b2991193e0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/NLPlate/NLPlate_HGPPConstraint.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/NLPlate/NLPlate_HGPPConstraint.cxx @@ -66,7 +66,7 @@ static const gp_XYZ XYZnull(0., 0., 0.); const gp_XYZ& NLPlate_HGPPConstraint::G0Target() const { return XYZnull; - // cette methode ne devrait pas etre appelee + // this method should not be called } static const Plate_D1 D1null(XYZnull, XYZnull); @@ -74,7 +74,7 @@ static const Plate_D1 D1null(XYZnull, XYZnull); const Plate_D1& NLPlate_HGPPConstraint::G1Target() const { return D1null; - // cette methode ne devrait pas etre appelee + // this method should not be called } static const Plate_D2 D2null(XYZnull, XYZnull, XYZnull); @@ -82,7 +82,7 @@ static const Plate_D2 D2null(XYZnull, XYZnull, XYZnull); const Plate_D2& NLPlate_HGPPConstraint::G2Target() const { return D2null; - // cette methode ne devrait pas etre appelee + // this method should not be called } static const Plate_D3 D3null(XYZnull, XYZnull, XYZnull, XYZnull); @@ -90,7 +90,7 @@ static const Plate_D3 D3null(XYZnull, XYZnull, XYZnull, XYZnull); const Plate_D3& NLPlate_HGPPConstraint::G3Target() const { return D3null; - // cette methode ne devrait pas etre applee + // this method should not be called } Standard_Integer NLPlate_HGPPConstraint::Orientation() diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx index 553bb82bde..2cd305caa4 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx @@ -41,7 +41,7 @@ #include #include -static const Standard_Real Tolpetit = 1.e-10; // pour dist au carre +static const Standard_Real Tolpetit = 1.e-10; // for squared distance static const Standard_Real tole = 5.e-6; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx index 29dc1f4aab..6e467eb128 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx @@ -171,7 +171,7 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, Standard_Real uf, ul, vf, vl; aSurf->Bounds(uf, ul, vf, vl); - // cas d une ligne + // case of a line Handle(Geom2d_Line) theL2d = Handle(Geom2d_Line)::DownCast(aC2d); if (!theL2d.IsNull()) { @@ -245,7 +245,7 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, } else { - // cas bspline curve + // case of BSpline curve Handle(Geom2d_BSplineCurve) aBC = Handle(Geom2d_BSplineCurve)::DownCast(aC2d); if (aBC.IsNull()) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Mat2d.cxx b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Mat2d.cxx index 08c24c9f12..9ea8991139 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Mat2d.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Mat2d.cxx @@ -267,7 +267,7 @@ void MAT2d_Mat2d::CreateMatOpen(MAT2d_Tool2d& atool) // Modified by Sergey KHROMOV - Fri Nov 17 10:28:37 2000 End //--------------------------------------------------- - // boucle 2 Tant qu il y a des bisectrices a effacer. + // loop 2: While there are bisectors to remove. //--------------------------------------------------- for (;;) { @@ -1005,7 +1005,7 @@ void MAT2d_Mat2d::CreateMat(MAT2d_Tool2d& atool) // Modified by Sergey KHROMOV - Fri Nov 17 10:28:37 2000 End //--------------------------------------------------- - // boucle 2 Tant qu il y a des bisectrices a effacer. + // loop 2: While there are bisectors to remove. //--------------------------------------------------- for (;;) { diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx index 5fe1fd7502..df802d4eef 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_ShapeSet.cxx @@ -1124,7 +1124,7 @@ void BinTools_ShapeSet::ReadShape(const TopAbs_ShapeEnum T, Standard_IStream& IS myBuilder.NaturalRestriction(F, bval); Standard_Byte aByte = (Standard_Byte)IS.get(); - // cas triangulation + // triangulation case if (aByte == 2) { BinTools::GetInteger(IS, s); diff --git a/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx b/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx index 393267dedc..79e8f87b59 100644 --- a/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx +++ b/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx @@ -379,9 +379,9 @@ Standard_Boolean LProp_SLProps::IsCurvatureDefined() return Standard_False; } - // pour eviter un plantage dans le cas du caro pointu - // en fait on doit pouvoir calculer les courbure - // avoir + // to avoid a crash in the case of a pointed patch + // in fact we should be able to compute the curvatures + // see if (!IsTangentUDefined() || !IsTangentVDefined()) { myCurvatureStatus = LProp_Undefined; diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx index 5bfe9a7781..9014e0934a 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx @@ -792,7 +792,7 @@ void AppDef_LinearCriteria::BuildCache(const Standard_Integer Element) } } else - { // pas de points dans l'interval. + { // no points in the interval. IF = IL; IL--; } diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx index f09c008079..2327c8f7a6 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx @@ -14,8 +14,8 @@ // Jeannine PANCIATICI le 06/06/96 // Igor FEOKTISTOV 14/12/98 - correction of Approximate() and Init(). -// Approximation d une MultiLine de points decrite par le tool MLineTool. -// avec criteres variationnels +// Approximation of a MultiLine of points described by the tool MLineTool. +// with variational criteria #include #include @@ -1311,8 +1311,8 @@ void AppDef_Variational::TheMotor(Handle(AppDef_SmoothCriterion)& J, lconst = Standard_False; - // (1.2) calcul des criteres de qualites et amelioration - // des estimation. + // (1.2) calculation of quality criteria and improvement + // of estimation. ICDANA = J->QualityValues(J1min, J2min, J3min, VALCRI[0], VALCRI[1], VALCRI[2]); if (ICDANA > 0) @@ -1322,8 +1322,8 @@ void AppDef_Variational::TheMotor(Handle(AppDef_SmoothCriterion)& J, isnear = ((std::sqrt(ERRQUA / NbrPnt) < 2 * WQuality) && (myNbIterations > 1)); - // (1.3) Optimisation des ti par proj orthogonale - // et calcul de l'erreur aux points. + // (1.3) Optimization of ti by orthogonal projection + // and calculation of the error at points. if (isnear) { @@ -1455,15 +1455,15 @@ void AppDef_Variational::TheMotor(Handle(AppDef_SmoothCriterion)& J, CCurrent = CNew; - // (2.4) calcul des criteres de qualites et amelioration - // des estimation. + // (2.4) calculation of quality criteria and improvement + // of estimation. ICDANA = J->QualityValues(J1min, J2min, J3min, VALCRI[0], VALCRI[1], VALCRI[2]); if (ICDANA > 0) lconst = Standard_True; J->GetEstimation(e1, e2, e3); - // (2.5) Optimisation des ti par proj orthogonale + // (2.5) Optimization of ti by orthogonal projection NewTi = new (TColStd_HArray1OfReal)(1, CurrentTi->Length()); Project(CCurrent, diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx index 4801a26a35..1e2b3ce73b 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx @@ -333,8 +333,8 @@ static GCPnts_DeflectionType GetDefType(const TheCurve& theC) return GCPnts_DefComposite; } - // pour forcer les decoupages aux cassures. - // G1 devrait marcher, mais donne des exceptions... + // to force subdivisions at discontinuities. + // G1 should work, but gives exceptions... switch (theC.GetType()) { case GeomAbs_Line: diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx index 668292d68f..f24e5f6cb9 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx @@ -666,7 +666,7 @@ void GCPnts_TangentialDeflection::PerformCurve(const TheCurve& theC) // Traitement normal pour une courbe Standard_Boolean MorePoints = Standard_True; Standard_Real U2 = myFirstu; - Standard_Real AngleMax = myAngularDeflection * 0.5; // car on prend le point milieu + Standard_Real AngleMax = myAngularDeflection * 0.5; // because we take the midpoint // Indexes of intervals of U1 and U2, used to handle non-uniform case. Standard_Integer aIdx[2] = {Intervs.Lower(), Intervs.Lower()}; Standard_Boolean isNeedToCheck = Standard_False; diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx index 764c2aacb1..2cdf040576 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx @@ -997,7 +997,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOfCu ReorderArrayOfG1(ArrayOfCurves, local_tolerance, tabG1, indexmin, ClosedTolerance); Curve2 = ArrayOfCurves(0); for (j = 1; j <= nb_curve - 1; j++) - { // boucle secondaire a l'interieur de chaque groupe + { // secondary loop inside each group Curve1 = ArrayOfCurves(j); if ((j == (nb_curve - 1)) && (NeedDoubleDegRepara)) { @@ -1252,7 +1252,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOfCu if (indexmin != (ArrayOfCurves.Length() - 1)) ReorderArrayOfG1(ArrayOfCurves, local_tolerance, tabG1, indexmin, ClosedTolerance); for (j = 0; j <= nb_curve - 1; j++) - { // boucle secondaire a l'interieur de chaque groupe + { // secondary loop inside each group if (NeedToBeTreated(ArrayOfCurves(j))) { Curve1 = MultNumandDenom(Hermit::Solution(ArrayOfCurves(j)), ArrayOfCurves(j)); diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx index 9708a1b654..94c5a058d5 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx @@ -376,7 +376,7 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve( else {*/ Convert_EllipseToBSplineCurve Convert(E2d, Parameterisation); TheCurve = BSplineCurveBuilder(TheConic, Convert); - TheCurve->SetPeriodic(); // pour polynomial et quasi angular + TheCurve->SetPeriodic(); // for polynomial and quasi angular // } } diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx index 6341e36cf3..36fa0cf59e 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompBezierSurfacesToBSplineSurface.cxx @@ -85,7 +85,7 @@ GeomConvert_CompBezierSurfacesToBSplineSurface::GeomConvert_CompBezierSurfacesTo myUKnots->SetValue(2, L1); V1 = vec.Magnitude(); - // si la Parametrisation est trop bizzare on garde la pseudo-longueur + // if the parameterization is too strange we keep the pseudo-length if ((V1 > 1000 * L1) || (V1 < L1 * 1.e-3)) V1 = L1; @@ -138,7 +138,7 @@ GeomConvert_CompBezierSurfacesToBSplineSurface::GeomConvert_CompBezierSurfacesTo myVKnots->SetValue(2, L1); V1 = vec.Magnitude(); - // si la Parametrisation est trop bizzare on garde la pseudo-longueur + // if the parameterization is too strange we keep the pseudo-length if ((V1 > 1000 * L1) || (V1 < L1 * 1.e-3)) V1 = L1; @@ -458,12 +458,12 @@ void GeomConvert_CompBezierSurfacesToBSplineSurface::Perform( } } - // (3) Elimination des redondances - // car dans la boucle precedente on compte : - // - 2 fois les poles associes aux noeuds simples - // - 4 fois les poles associes aux doubles noeuds (en U et V) + // (3) Elimination of redundancies + // because in the previous loop we count: + // - 2 times the poles associated with simple knots + // - 4 times the poles associated with double knots (in U and V) - // (3.1) Elimination en U + // (3.1) Elimination in U for (UIndex = myUDegree + 1, ii = 2; ii < myUKnots->Length(); ii++, UIndex += myUDegree) { for (vpol = 1; vpol <= myPoles->UpperCol(); vpol++) diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx index f54b61bc7c..e047d7adc6 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx @@ -167,7 +167,7 @@ Handle(Geom_Line) GeomConvert_CurveToAnaCurve::ComputeLine(const Handle(Geom_Cur Handle(Geom_Line) line; if (curve.IsNull()) return line; - line = Handle(Geom_Line)::DownCast(curve); // qui sait + line = Handle(Geom_Line)::DownCast(curve); // who knows if (!line.IsNull()) { cf = c1; diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx index aef4e8136d..50f8df3e26 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx @@ -715,16 +715,16 @@ Handle(Geom2d_Curve) GeomLib::GTransform(const Handle(Geom2d_Curve)& Curve, cons else { - // Alors, la GTrsf est une other Transformation. - // La geometrie des courbes est alors changee, et les conics devront - // etre converties en BSplines. + // So, the GTrsf is an other Transformation. + // The geometry of the curves is then changed, and the conics will have to + // be converted to BSplines. Handle(Standard_Type) TheType = Curve->DynamicType(); if (TheType == STANDARD_TYPE(Geom2d_TrimmedCurve)) { - // On va recurer sur la BasisCurve + // We will recurse on the BasisCurve Handle(Geom2d_TrimmedCurve) C = Handle(Geom2d_TrimmedCurve)::DownCast(Curve->Copy()); @@ -1318,11 +1318,11 @@ void GeomLib::ExtendCurveToPoint(Handle(Geom_BoundedCurve)& Curve, L1 = p0.Distance(Point); if (L1 > Tol) { - // Lambda est le ratio qu'il faut appliquer a la derive de la courbe - // pour obtenir la derive du prolongement (fixe arbitrairement a la - // longueur du segment bout de la courbe - point cible. - // On essai d'avoir sur le prolongement la vitesse moyenne que l'on - // a sur la courbe. + // Lambda is the ratio to apply to the derivative of the curve + // to obtain the derivative of the extension (arbitrarily fixed to the + // length of the segment end of curve - target point. + // We try to have on the extension the average velocity that we + // have on the curve. gp_Vec daux; gp_Pnt pp; Standard_Real f = Curve->FirstParameter(), t, dt, norm; @@ -1517,7 +1517,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, if (!InU && (BS->VDegree() < Continuity + 1)) BS->IncreaseDegree(BS->UDegree(), Continuity + 1); - // si BS etait periodique dans le sens de l'extension, elle ne le sera plus + // if BS was periodic in the extension direction, it will no longer be if ((InU && (BS->IsUPeriodic())) || (!InU && (BS->IsVPeriodic()))) { Standard_Real U0, U1, V0, V1; @@ -1562,7 +1562,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, Cdim = BS->NbUPoles() * gap; } - // les noeuds plats + // the flat knots Ksize = NbP + Cdeg + 1; FKnots = new (TColStd_HArray1OfReal)(1, Ksize); if (InU) @@ -1570,13 +1570,13 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, else BS->VKnotSequence(FKnots->ChangeArray1()); - // le parametre du noeud de raccord + // the parameter of the connection knot if (After) Tbord = FKnots->Value(FKnots->Upper() - Cdeg); else Tbord = FKnots->Value(FKnots->Lower() + Cdeg); - // les poles + // the poles Psize = Cdim * NbP; Poles = new (TColStd_HArray1OfReal)(1, Psize); @@ -1612,7 +1612,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, } Padr = (Standard_Real*)&Poles->ChangeValue(1); - // calcul du point de raccord et de la tangente + // calculation of the connection point and tangent Point = new (TColStd_HArray1OfReal)(1, Cdim); Tgte = new (TColStd_HArray1OfReal)(1, Cdim); lambda = new (TColStd_HArray1OfReal)(1, Cdim); @@ -1644,7 +1644,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, tgte(ii) = Result(ii + Cdim); } - // calcul de la contrainte a atteindre + // calculation of the constraint to reach gp_Vec CurT, OldT; @@ -1662,9 +1662,9 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, if (NTgte > Tgtol) { val = Length / NTgte; - // Attentions aux Cas ou le segment donne par les poles - // est oppose au sens de la derive - // Exemple: Certaine portions de tore. + // Attention to cases where the segment given by the poles + // is opposite to the direction of the derivative + // Example: Certain portions of torus. if ((OldN > Tgtol) && (CurT.Angle(OldT) > 2)) { Ok = Standard_False; @@ -1692,9 +1692,9 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, if (NTgte > Tgtol) { val = Length / NTgte; - // Attentions aux Cas ou le segment donne par les poles - // est oppose au sens de la derive - // Exemple: Certaine portion de tore. + // Attention to cases where the segment given by the poles + // is opposite to the direction of the derivative + // Example: Certain portions of torus. if ((OldN > Tgtol) && (CurT.Angle(OldT) > 2)) { Ok = Standard_False; @@ -1712,8 +1712,8 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, } if (!Ok && Kount < 2) { - // On augmente le degre de l'iso bord afin de rapprocher les poles de la surface - // Et on ressaye + // We increase the degree of the border iso to bring the poles of the surface closer + // And we retry if (InU) BS->IncreaseDegree(BS->UDegree(), BS->VDegree() + 2); else @@ -1737,7 +1737,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, } } - // cas particulier du rationnel + // special case of rational if (rational) { for (ipole = 1; ipole <= Psize; ipole += gap) @@ -1754,7 +1754,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, } } - // tableaux necessaires pour l'extension + // arrays needed for the extension Standard_Integer Ksize2 = Ksize + Cdeg, NbPoles, NbKnots = 0; TColStd_Array1OfReal FK(1, Ksize2); Standard_Real* FKRadr = &FK(1); diff --git a/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx b/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx index d5bfab3412..54c816b633 100644 --- a/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx +++ b/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx @@ -627,7 +627,7 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, Polesinit(index).SetCoord(0.0, -Polesinit(index).Y()); } - // boucle de positivite + // positivity loop if ((Polesinit(1).Y() < 0.0) && (Polesinit(2).Y() >= 0.0)) { Us1 = Polesinit(0).Y() / (Polesinit(0).Y() - Polesinit(1).Y()); diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx index 5b76896880..34ad414cec 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx @@ -445,9 +445,9 @@ void IntAna_IntConicQuad::Perform(const gp_Lin& L, const Standard_Real Len) { - // Tolang represente la tolerance angulaire a partir de laquelle on considere - // que l angle entre 2 vecteurs est nul. On raisonnera sur le cosinus de cet - // angle, (on a std::cos(t) equivalent a t au voisinage de Pi/2). + // Tolang represents the angular tolerance from which we consider + // that the angle between 2 vectors is zero. We will reason about the cosine of this + // angle, (we have std::cos(t) equivalent to t near Pi/2). done = Standard_False; diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx index 8857b23783..3b0e34ecd6 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_QuadQuadGeo.cxx @@ -775,24 +775,24 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, sint = axey.Modulus(); cost = std::abs(Co.Axis().Direction().XYZ().Dot(normp)); - // Le calcul de costa permet de determiner si le plan contient - // un generatrice du cone : on calcul std::sin((PI/2. - t) - angl) + // The calculation of costa determines if the plane contains + // a generatrix of the cone: we calculate std::sin((PI/2. - t) - angl) costa = cost * cosa - sint * sina; // sin((PI/2 -t)-angl)=cos(t+angl) - // avec t ramene entre 0 et pi/2. + // with t brought back between 0 and pi/2. if (std::abs(dist) < Tol) { - // on considere que le plan contient le sommet du cone. - // les solutions possibles sont donc : 1 point, 1 droite, 2 droites - // selon l inclinaison du plan. + // we consider that the plane contains the apex of the cone. + // the possible solutions are therefore: 1 point, 1 line, 2 lines + // according to the inclination of the plane. if (std::abs(costa) < Tolang) - { // plan parallele a la generatrice + { // plane parallel to the generatrix typeres = IntAna_Line; nbint = 1; gp_XYZ ptonaxe(apex.XYZ() + 10. * (Co.Axis().Direction().XYZ())); - // point sur l axe du cone cote z positif + // point on the axis of the cone on the positive z side dist = A * ptonaxe.X() + B * ptonaxe.Y() + C * ptonaxe.Z() + D; ptonaxe = ptonaxe - dist * normp; @@ -800,7 +800,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, dir1.SetXYZ(ptonaxe - pt1.XYZ()); } else if (cost < sina) - { // plan "interieur" au cone + { // plane "interior" to the cone typeres = IntAna_Line; nbint = 2; pt1 = apex; @@ -810,7 +810,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, dir2.SetXYZ(axex - dh * axey); } else - { // plan "exterieur" au cone + { // plane "exterior" to the cone typeres = IntAna_Point; nbint = 1; pt1 = apex; @@ -818,14 +818,14 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, } else { - // Solutions possibles : cercle, ellipse, parabole, hyperbole selon - // l inclinaison du plan. + // Possible solutions: circle, ellipse, parabola, hyperbola according to + // the inclination of the plane. Standard_Real deltacenter, distance; if (cost < Tolang) { - // Le plan contient la direction de l axe du cone. La solution est - // l hyperbole + // The plane contains the direction of the cone axis. The solution is + // the hyperbola typeres = IntAna_Hyperbola; nbint = 2; pt1.SetXYZ(apex.XYZ() - dist * normp); @@ -838,13 +838,13 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, else { - IntAna_IntConicQuad inter(axec, P, Tolang); // on a necessairement 1 point. + IntAna_IntConicQuad inter(axec, P, Tolang); // we necessarily have 1 point. gp_Pnt center(inter.Point(1)); - // En fonction de la position de l intersection par rapport au sommet - // du cone, on change l axe x en -x et y en -y. Le parametre du sommet - // sur axec est negatif (voir definition du cone) + // Depending on the position of the intersection relative to the apex + // of the cone, we change the x axis to -x and y to -y. The parameter of the apex + // on axec is negative (see definition of the cone) distance = apex.Distance(center); @@ -855,7 +855,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, } if (std::abs(costa) < Tolang) - { // plan parallele a une generatrice + { // plane parallel to a generatrix typeres = IntAna_Parabola; nbint = 1; deltacenter = distance / 2. / cosa; @@ -981,15 +981,15 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, const gp_Sphere& S) if (std::abs(std::abs(dist) - radius) < Epsilon(radius)) { - // on a une seule solution : le point projection du centre de la sphere - // sur le plan + // we have a single solution: the projection point of the sphere center + // onto the plane nbint = 1; typeres = IntAna_Point; pt1.SetCoord(X - dist * A, Y - dist * B, Z - dist * C); } else if (std::abs(dist) < radius) { - // on a un cercle solution + // we have a circle solution nbint = 1; typeres = IntAna_Circle; pt1.SetCoord(X - dist * A, Y - dist * B, Z - dist * C); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx index 0faca37469..767631bee0 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx @@ -525,14 +525,14 @@ static void Function_SetUVBounds(Standard_Real& myU1, { UCouture = Standard_True; - // on cherche a savoir le nombre de fois que la couture est - // traversee. - // si 0 ou 2 fois : la PCurve est fermee et dans l`intervalle - // [Uc-PI, Uc+PI] (Uc: U du centre du cercle) - // si 1 fois : la PCurve est ouverte et dans l`intervalle + // we seek to know how many times the seam is + // crossed. + // if 0 or 2 times: the PCurve is closed and in the interval + // [Uc-PI, Uc+PI] (Uc: U of circle center) + // if 1 time : the PCurve is open and in the interval // [U1, U1 +/- 2*PI] - // pour determiner le nombre de solution, on resoud le systeme + // to determine the number of solutions, we solve the system // x^2 + y^2 + z^2 = R^2 (1) // A x + B y + C z + D = 0 (2) // x > 0 (3) @@ -707,7 +707,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, myV2 = M_PI / 2.; } - // si P1.Z() vaut +/- R on est sur le sommet : pas significatif. + // if P1.Z() equals +/- R we are at the vertex: not significant. gp_Pnt pp = P1.Transformed(Trsf); if (std::abs(pp.X() * pp.X() + pp.Y() * pp.Y() + pp.Z() * pp.Z() - R * R) < Tol) diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx index 16742ec492..6926499afe 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx @@ -124,8 +124,8 @@ void ProjLib_Cone::Project(const gp_Circ& C) Standard_Real y = ConePos.YDirection().Dot(CircPos.XDirection()); Standard_Real z = gp_Vec(myCone.Location(), C.Location()).Dot(ConePos.Direction()); - // pour trouver le point U V, on reprend le code de ElSLib - // sans appliquer la Trsf au point ( aller retour inutile). + // to find point U V, we use the code from ElSLib + // without applying the Trsf to the point (unnecessary round trip). if (x == 0.0 && y == 0.0) { U = 0.; diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx index 7ec3c3fe69..d1de10b536 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx @@ -57,7 +57,7 @@ static gp_Pnt OnPlane_Value(const Standard_Real U, const gp_Dir& D) { // PO . Z / Z = Pl.Direction() - // Proj(u) = P(u) + ------- * D avec \ O = Pl.Location() + // Proj(u) = P(u) + ------- * D with \ O = Pl.Location() // D . Z gp_Pnt Point = aCurvePtr->Value(U); @@ -83,7 +83,7 @@ static gp_Vec OnPlane_DN(const Standard_Real U, const gp_Dir& D) { // PO . Z / Z = Pl.Direction() - // Proj(u) = P(u) + ------- * D avec \ O = Pl.Location() + // Proj(u) = P(u) + ------- * D with \ O = Pl.Location() // D . Z gp_Vec Vector = aCurvePtr->DN(U, DerivativeRequest); @@ -344,21 +344,21 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, Standard_Integer NbCurves = Fit.NbMultiCurves(); Standard_Integer MaxDeg = 0; - // Pour transformer la MultiCurve en BSpline, il faut que toutes - // les Bezier la constituant aient le meme degre -> Calcul de MaxDeg + // To convert the MultiCurve to BSpline, all constituent Bezier curves + // must have the same degree -> Calculate MaxDeg Standard_Integer NbPoles = 1; for (i = 1; i <= NbCurves; i++) { Standard_Integer Deg = Fit.Value(i).Degree(); MaxDeg = std::max(MaxDeg, Deg); } - NbPoles = MaxDeg * NbCurves + 1; // Poles sur la BSpline + NbPoles = MaxDeg * NbCurves + 1; // Poles on the BSpline TColgp_Array1OfPnt Poles(1, NbPoles); - TColgp_Array1OfPnt TempPoles(1, MaxDeg + 1); // pour augmentation du degre + TColgp_Array1OfPnt TempPoles(1, MaxDeg + 1); // for degree elevation - TColStd_Array1OfReal Knots(1, NbCurves + 1); // Noeuds de la BSpline + TColStd_Array1OfReal Knots(1, NbCurves + 1); // Knots of the BSpline Standard_Integer Compt = 1; Standard_Real anErrMax = 0., anErr3d, anErr2d; @@ -367,11 +367,11 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, Fit.Parameters(i, Knots(i), Knots(i + 1)); Fit.Error(i, anErr3d, anErr2d); anErrMax = std::max(anErrMax, anErr3d); - AppParCurves_MultiCurve MC = Fit.Value(i); // Charge la Ieme Curve - TColgp_Array1OfPnt LocalPoles(1, MC.Degree() + 1); // Recupere les poles + AppParCurves_MultiCurve MC = Fit.Value(i); // Load the i-th Curve + TColgp_Array1OfPnt LocalPoles(1, MC.Degree() + 1); // Get the poles MC.Curve(1, LocalPoles); - // Augmentation eventuelle du degre + // Possible degree elevation if (MaxDeg > MC.Degree()) { BSplCLib::IncreaseDegree(MaxDeg, @@ -379,7 +379,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, BSplCLib::NoWeights(), TempPoles, BSplCLib::NoWeights()); - // mise a jour des poles de la PCurve + // update the poles of the PCurve for (Standard_Integer j = 1; j <= MaxDeg + 1; j++) { Poles.SetValue(Compt, TempPoles(j)); @@ -388,7 +388,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, } else { - // mise a jour des poles de la PCurve + // update the poles of the PCurve for (Standard_Integer j = 1; j <= MaxDeg + 1; j++) { Poles.SetValue(Compt, LocalPoles(j)); @@ -399,7 +399,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, Compt--; } - // mise a jour des fields de ProjLib_Approx + // update the fields of ProjLib_Approx Standard_Integer NbKnots = NbCurves + 1; @@ -656,8 +656,8 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, break; } case GeomAbs_Circle: { - // Pour le cercle et l ellipse on a les relations suivantes: - // ( Rem : pour le cercle R1 = R2 = R) + // For circle and ellipse we have the following relations: + // (Note: for circle R1 = R2 = R) // P(u) = O + R1 * std::cos(u) * Xc + R2 * std::sin(u) * Yc // ==> Q(u) = f(P(u)) // = f(O) + R1 * std::cos(u) * f(Xc) + R2 * std::sin(u) * f(Yc) diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx index 6fd00abf3e..b8ef873328 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx @@ -37,7 +37,7 @@ static gp_Pnt OnSurface_Value(const Standard_Real U, const Handle(Adaptor3d_Curve)& myCurve, Extrema_ExtPS* myExtPS) { - // on essaie de rendre le point solution le plus proche. + // Try to find the closest solution point. myExtPS->Perform(myCurve->Value(U)); Standard_Real Dist2Min = RealLast(); @@ -183,31 +183,31 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C, const Stan Standard_Integer NbCurves = Fit.NbMultiCurves(); Standard_Integer MaxDeg = 0; - // Pour transformer la MultiCurve en BSpline, il faut que toutes - // les Bezier la constituant aient le meme degre -> Calcul de MaxDeg + // To convert the MultiCurve to BSpline, all constituent Bezier curves + // must have the same degree -> Calculate MaxDeg Standard_Integer NbPoles = 1; for (i = 1; i <= NbCurves; i++) { Standard_Integer Deg = Fit.Value(i).Degree(); MaxDeg = std::max(MaxDeg, Deg); } - NbPoles = MaxDeg * NbCurves + 1; // Poles sur la BSpline + NbPoles = MaxDeg * NbCurves + 1; // Poles on the BSpline TColgp_Array1OfPnt Poles(1, NbPoles); - TColgp_Array1OfPnt TempPoles(1, MaxDeg + 1); // pour augmentation du degre + TColgp_Array1OfPnt TempPoles(1, MaxDeg + 1); // for degree elevation - TColStd_Array1OfReal Knots(1, NbCurves + 1); // Noeuds de la BSpline + TColStd_Array1OfReal Knots(1, NbCurves + 1); // Knots of the BSpline Standard_Integer Compt = 1; for (i = 1; i <= Fit.NbMultiCurves(); i++) { Fit.Parameters(i, Knots(i), Knots(i + 1)); - AppParCurves_MultiCurve MC = Fit.Value(i); // Charge la Ieme Curve - TColgp_Array1OfPnt LocalPoles(1, MC.Degree() + 1); // Recupere les poles + AppParCurves_MultiCurve MC = Fit.Value(i); // Load the i-th Curve + TColgp_Array1OfPnt LocalPoles(1, MC.Degree() + 1); // Get the poles MC.Curve(1, Poles); - // Augmentation eventuelle du degre + // Possible degree elevation Standard_Integer Inc = MaxDeg - MC.Degree(); if (Inc > 0) { @@ -216,7 +216,7 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C, const Stan BSplCLib::NoWeights(), TempPoles, BSplCLib::NoWeights()); - // mise a jour des poles de la PCurve + // update the poles of the PCurve for (Standard_Integer j = 1; j <= MaxDeg + 1; j++) { Poles.SetValue(Compt, TempPoles(j)); @@ -225,7 +225,7 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C, const Stan } else { - // mise a jour des poles de la PCurve + // update the poles of the PCurve for (Standard_Integer j = 1; j <= MaxDeg + 1; j++) { Poles.SetValue(Compt, LocalPoles(j)); @@ -236,7 +236,7 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C, const Stan Compt--; } - // mise a jour des fields de ProjLib_Approx + // update the fields of ProjLib_Approx Standard_Integer NbKnots = NbCurves + 1; diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx index 3dbb949039..a1985f7e75 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx @@ -617,9 +617,9 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve(mySurface, myCurve, aTolU, aTolV, aMaxDist); - // Normalement, dans le cadre de ProjLib, le resultat - // doit etre une et une seule courbe !!! - // De plus, cette courbe ne doit pas etre Single point + // Normally, within the framework of ProjLib, the result + // must be one and only one curve! + // Moreover, this curve must not be a Single point Standard_Integer NbCurves = HProjector->NbCurves(); Standard_Real Udeb = 0.0, Ufin = 0.0; if (NbCurves > 0) diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx index 534eefce83..465c046c4d 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx @@ -116,11 +116,11 @@ void ProjLib_Torus::Project(const gp_Circ& C) if (Z > 1.) { - V = M_PI / 2.; // protection stupide - } // contre les erreurs de calcul + V = M_PI / 2.; // simple protection + } // against calculation errors else if (Z < -1.) - { // il arrive que Z soit legerement - V = -M_PI / 2; // superieur a 1. + { // it happens that Z is slightly + V = -M_PI / 2; // greater than 1. } else { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx index dbabf596ac..c5b45bec2a 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_LayerList.cxx @@ -148,13 +148,12 @@ private: Graphic3d_ZLayerId myLayersToProcess; }; -static const Standard_Integer THE_DRAW_BUFFERS0[] = {GL_COLOR_ATTACHMENT0}; -static const Standard_Integer THE_DRAW_BUFFERS01[] = {GL_COLOR_ATTACHMENT0, - GL_COLOR_ATTACHMENT0 + 1}; -static const Standard_Integer THE_DRAW_BUFFERS012[] = {GL_COLOR_ATTACHMENT0, - GL_COLOR_ATTACHMENT0 + 1, - GL_COLOR_ATTACHMENT0 + 2}; -static const float THE_DEPTH_CLEAR_VALUE = -1e15f; +constexpr Standard_Integer THE_DRAW_BUFFERS0[] = {GL_COLOR_ATTACHMENT0}; +constexpr Standard_Integer THE_DRAW_BUFFERS01[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT0 + 1}; +constexpr Standard_Integer THE_DRAW_BUFFERS012[] = {GL_COLOR_ATTACHMENT0, + GL_COLOR_ATTACHMENT0 + 1, + GL_COLOR_ATTACHMENT0 + 2}; +constexpr float THE_DEPTH_CLEAR_VALUE = -1e15f; } // namespace struct OpenGl_GlobalLayerSettings diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx index 26628f2eb2..370d0ea14d 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx @@ -31,11 +31,11 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Camera, Standard_Transient) namespace { // (degrees -> radians) * 0.5 -static const Standard_Real DTR_HALF = 0.5 * 0.0174532925; +constexpr Standard_Real DTR_HALF = 0.5 * 0.0174532925; // default property values -static const Standard_Real DEFAULT_ZNEAR = 0.001; -static const Standard_Real DEFAULT_ZFAR = 3000.0; +constexpr Standard_Real DEFAULT_ZNEAR = 0.001; +constexpr Standard_Real DEFAULT_ZFAR = 3000.0; // atomic state counter static std::atomic THE_STATE_COUNTER(0); diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx index 684fbff7ae..b99ed18349 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx @@ -116,10 +116,13 @@ static std::ostream& formatBytes(std::ostream& theStream, return theStream; } -static const Standard_Real THE_SECONDS_IN_HOUR = 3600.0; -static const Standard_Real THE_SECONDS_IN_MINUTE = 60.0; -static const Standard_Real THE_SECOND_IN_HOUR = 1.0 / THE_SECONDS_IN_HOUR; -static const Standard_Real THE_SECOND_IN_MINUTE = 1.0 / THE_SECONDS_IN_MINUTE; +namespace +{ +constexpr double THE_SECONDS_IN_HOUR = 3600.0; +constexpr double THE_SECONDS_IN_MINUTE = 60.0; +constexpr double THE_SECOND_IN_HOUR = 1.0 / THE_SECONDS_IN_HOUR; +constexpr double THE_SECOND_IN_MINUTE = 1.0 / THE_SECONDS_IN_MINUTE; +} // namespace //! Format time. static std::ostream& formatTime(std::ostream& theStream, diff --git a/src/Visualization/TKService/Media/Media_FormatContext.cxx b/src/Visualization/TKService/Media/Media_FormatContext.cxx index a12b224557..ada6e13a49 100644 --- a/src/Visualization/TKService/Media/Media_FormatContext.cxx +++ b/src/Visualization/TKService/Media/Media_FormatContext.cxx @@ -27,10 +27,10 @@ IMPLEMENT_STANDARD_RTTIEXT(Media_FormatContext, Standard_Transient) namespace { -static const double THE_SECONDS_IN_HOUR = 3600.0; -static const double THE_SECONDS_IN_MINUTE = 60.0; -static const double THE_SECOND_IN_HOUR = 1.0 / THE_SECONDS_IN_HOUR; -static const double THE_SECOND_IN_MINUTE = 1.0 / THE_SECONDS_IN_MINUTE; +constexpr double THE_SECONDS_IN_HOUR = 3600.0; +constexpr double THE_SECONDS_IN_MINUTE = 60.0; +constexpr double THE_SECOND_IN_HOUR = 1.0 / THE_SECONDS_IN_HOUR; +constexpr double THE_SECOND_IN_MINUTE = 1.0 / THE_SECONDS_IN_MINUTE; #ifdef HAVE_FFMPEG static const AVRational ST_AV_TIME_BASE_Q = {1, AV_TIME_BASE}; diff --git a/src/Visualization/TKV3d/AIS/AIS_Axis.cxx b/src/Visualization/TKV3d/AIS/AIS_Axis.cxx index 87e9d713c4..f96e9373d6 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Axis.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Axis.cxx @@ -244,7 +244,7 @@ void AIS_Axis::ComputeFields() { if (myIsXYZAxis) { - // calcul de myPFirst,myPlast + // compute myPFirst,myPlast Handle(Prs3d_DatumAspect) DA = myDrawer->DatumAspect(); gp_Ax2 anAxis = myAx2->Ax2(); const gp_Pnt& Orig = anAxis.Location(); diff --git a/src/Visualization/TKV3d/AIS/AIS_CameraFrustum.cxx b/src/Visualization/TKV3d/AIS/AIS_CameraFrustum.cxx index c40200f1d2..01265258a1 100644 --- a/src/Visualization/TKV3d/AIS/AIS_CameraFrustum.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_CameraFrustum.cxx @@ -29,8 +29,8 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_CameraFrustum, AIS_InteractiveObject) namespace { -static const Standard_ShortReal THE_DEFAULT_TRANSPARENCY = 0.7f; -static const Quantity_Color THE_DEFAULT_COLOR = Quantity_NOC_WHITE; +constexpr Standard_ShortReal THE_DEFAULT_TRANSPARENCY = 0.7f; +const Quantity_Color THE_DEFAULT_COLOR = Quantity_NOC_WHITE; } // namespace //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_Selection.cxx b/src/Visualization/TKV3d/AIS/AIS_Selection.cxx index 039f3004ca..28b9b9aeab 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Selection.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Selection.cxx @@ -22,7 +22,7 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_Selection, Standard_Transient) namespace { -static const Standard_Integer THE_MaxSizeOfResult = 100000; +constexpr Standard_Integer THE_MaxSizeOfResult = 100000; } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx b/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx index 9837ac1078..d2b88ef713 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx @@ -35,9 +35,9 @@ IMPLEMENT_STANDARD_RTTIEXT(AIS_ViewCubeSensitive, Select3D_SensitivePrimitiveArr namespace { -static const Standard_Integer THE_NB_ROUND_SPLITS = 8; -static const Standard_Integer THE_NB_DISK_SLICES = 20; -static const Standard_Integer THE_NB_ARROW_FACETTES = 20; +constexpr Standard_Integer THE_NB_ROUND_SPLITS = 8; +constexpr Standard_Integer THE_NB_DISK_SLICES = 20; +constexpr Standard_Integer THE_NB_ARROW_FACETTES = 20; //! Return the number of non-zero components. static Standard_Integer nbDirectionComponents(const gp_Dir& theDir) diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx index 829ca96a46..73a53d80a3 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx @@ -54,9 +54,9 @@ IMPLEMENT_STANDARD_RTTIEXT(PrsDim_AngleDimension, PrsDim_Dimension) namespace { -static const Standard_Real THE_EMPTY_LABEL_WIDTH = 0.0; -static const Standard_ExtCharacter THE_DEGREE_SYMBOL(0x00B0); -static const Standard_Real THE_3D_TEXT_MARGIN = 0.1; +constexpr double THE_EMPTY_LABEL_WIDTH = 0.0; +constexpr Standard_ExtCharacter THE_DEGREE_SYMBOL = 0x00B0; +constexpr double THE_3D_TEXT_MARGIN = 0.1; //! Returns true if the given points lie on a same line. static Standard_Boolean isSameLine(const gp_Pnt& theFirstPoint, diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx index 6c4477b578..d134c4d049 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx @@ -98,11 +98,11 @@ void PrsDim_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager)&, myDir = norm1.Crossed(dir1); //------------------------------------------------- - // calcul d'une direction orthogonale a l'edge du - // chanfrein et dirigee vers l'ext. du contour + // compute a direction orthogonal to the chamfer edge + // and directed towards the exterior of the contour //------------------------------------------------- - // recup. d'une edge adjacente a l'edge du chanfrein + // retrieve an edge adjacent to the chamfer edge /*TopoDS_Edge nextedge = TopoDS::Edge(mySShape); gp_Pnt pfirstnext,plastnext; diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx index 5c2f8e46e6..b04f5739ba 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx @@ -68,11 +68,11 @@ IMPLEMENT_STANDARD_RTTIEXT(PrsDim_Dimension, AIS_InteractiveObject) namespace { // default text margin and resolution -static const Standard_Real THE_3D_TEXT_MARGIN = 0.1; +constexpr double THE_3D_TEXT_MARGIN = 0.1; // default selection priorities -static const Standard_Integer THE_NEUTRAL_SEL_PRIORITY = 5; -static const Standard_Integer THE_LOCAL_SEL_PRIORITY = 6; +constexpr int THE_NEUTRAL_SEL_PRIORITY = 5; +constexpr int THE_LOCAL_SEL_PRIORITY = 6; } // namespace //================================================================================================= diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx index 7bed3d0e07..483c8d8020 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx @@ -334,7 +334,7 @@ void PrsDim_FixRelation::ComputeEdge(const TopoDS_Edge& FixEdge, gp_Pnt& curpos) return; //--------------------------------------------------------- - // calcul du point de positionnement du symbole 'fix' + // compute the positioning point for the 'fix' symbol //--------------------------------------------------------- //--> In case of a straight line if (curEdge->IsKind(STANDARD_TYPE(Geom_Line))) diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx index 7a8ad0413c..831012b70b 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx @@ -165,7 +165,7 @@ void PrsDim_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& L3 = gce_MakeLin(Proj1, Proj2); } else - { // cas ou la dimension est nulle + { // case where the dimension is zero if (!Proj1.IsEqual(Tcurpos, Precision::Confusion())) { gp_Vec v3(Proj1, Tcurpos); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx index ba433be6f7..7f90a435a6 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx @@ -85,12 +85,12 @@ void PrsDim_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager)&, switch (myFShape.ShapeType()) { case TopAbs_FACE: { - // cas longueur entre deux faces + // parallel case between two faces ComputeTwoFacesParallel(aPresentation); } break; case TopAbs_EDGE: { - // cas longueur entre deux edges + // parallel case between two edges ComputeTwoEdgesParallel(aPresentation); } break; @@ -285,7 +285,7 @@ void PrsDim_ParallelRelation::ComputeTwoEdgesParallel( myPosition = curpos; } - // recherche points attache + // search for attachment points if (!isInfinite1) { if (isEl1) diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx index be002b4fce..0ca6de9ef9 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx @@ -77,12 +77,12 @@ void PrsDim_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManag switch (myFShape.ShapeType()) { case TopAbs_FACE: { - // cas perpendiculaire entre deux faces + // perpendicular case between two faces ComputeTwoFacesPerpendicular(aPresentation); } break; case TopAbs_EDGE: { - // cas perpendiculaire entre deux edges + // perpendicular case between two edges ComputeTwoEdgesPerpendicular(aPresentation); } break; @@ -90,7 +90,7 @@ void PrsDim_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManag break; } } - // Cas pas traite - Edge/Face + // Case not handled - Edge/Face } //================================================================================================= @@ -232,7 +232,7 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular( pint3d = adp.Value(pint.X(), pint.Y()); myPosition = pint3d; - // recherche points attache + // search for attachment points Standard_Real par1, par2, curpar, pmin, pmax; //,dist,sign; Standard_Real length(0.); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx index e759179bb1..56cdf25f67 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx @@ -67,17 +67,17 @@ void PrsDim_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager)& switch (myFShape.ShapeType()) { case TopAbs_FACE: { - // cas symetrie entre deux faces + // symmetry case between two faces ComputeTwoFacesSymmetric(aprs); } break; case TopAbs_EDGE: { - // cas symetrie entre deux edges + // symmetry case between two edges ComputeTwoEdgesSymmetric(aprs); } break; case TopAbs_VERTEX: { - // cas symetrie entre deux vertexs + // symmetry case between two vertices ComputeTwoVerticesSymmetric(aprs); } break; @@ -417,7 +417,7 @@ void PrsDim_SymmetricRelation::ComputeTwoEdgesSymmetric(const Handle(Prs3d_Prese circ = c; } - // recherche points attache + // search for attachment points gp_Pnt ProjOffset = ElCLib::Value(ElCLib::Parameter(laxis, myPosition), laxis); /*//---------------------------------------------------- @@ -624,12 +624,12 @@ void PrsDim_SymmetricRelation::ComputeTwoVerticesSymmetric(const Handle(Prs3d_Pr gp_Lin laxis(geom_line->Lin()); myAxisDirAttach = laxis.Direction(); - // recherche points attache + // search for attachment points // gp_Pnt curpos; if (myAutomaticPosition) { gp_Pnt PjFAttach = ElCLib::Value(ElCLib::Parameter(laxis, myFAttach), laxis); - // offset pour eviter confusion Edge et Dimension + // offset to avoid confusion between Edge and Dimension gp_Vec offset(myAxisDirAttach); offset = offset * myArrowSize * (-5); gp_Vec Vt(myFAttach, PjFAttach); diff --git a/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx b/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx index 8bbd47356a..e4e850e51d 100644 --- a/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx @@ -28,9 +28,9 @@ IMPLEMENT_STANDARD_RTTIEXT(V3d_CircularGrid, Aspect_CircularGrid) namespace { -static const Standard_Real THE_DEFAULT_GRID_STEP = 10.0; -#define DIVISION 8 -#define MYFACTOR 50. +constexpr double THE_DEFAULT_GRID_STEP = 10.0; +constexpr int THE_DIVISION = 8; +constexpr double THE_MYFACTOR = 50.0; } // namespace //! Dummy implementation of Graphic3d_Structure overriding ::Compute() method for handling Device @@ -75,7 +75,7 @@ V3d_CircularGrid::V3d_CircularGrid(const V3d_ViewerPointer& aViewer, myCurStep(0.0), myCurDivi(0), myRadius(0.5 * aViewer->DefaultViewSize()), - myOffSet(THE_DEFAULT_GRID_STEP / MYFACTOR) + myOffSet(THE_DEFAULT_GRID_STEP / THE_MYFACTOR) { myColor = aColor; myTenthColor = aTenthColor; @@ -228,7 +228,7 @@ void V3d_CircularGrid::DefineLines() myGroup->Clear(); const Standard_Integer Division = - (Standard_Integer)((aDivision >= DIVISION ? aDivision : DIVISION)); + (Standard_Integer)((aDivision >= THE_DIVISION ? aDivision : THE_DIVISION)); Standard_Integer nbpnts = 2 * Division; // diametres diff --git a/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx b/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx index 69703bc8fd..4a0fa9767e 100644 --- a/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx @@ -27,8 +27,8 @@ IMPLEMENT_STANDARD_RTTIEXT(V3d_RectangularGrid, Aspect_RectangularGrid) namespace { -static const Standard_Real THE_DEFAULT_GRID_STEP = 10.0; -#define MYFACTOR 50. +constexpr double THE_DEFAULT_GRID_STEP = 10.0; +constexpr double THE_MYFACTOR = 50.0; } // namespace //! Dummy implementation of Graphic3d_Structure overriding ::Compute() method for handling Device @@ -74,7 +74,7 @@ V3d_RectangularGrid::V3d_RectangularGrid(const V3d_ViewerPointer& aViewer, myCurYStep(0.0), myXSize(0.5 * aViewer->DefaultViewSize()), myYSize(0.5 * aViewer->DefaultViewSize()), - myOffSet(THE_DEFAULT_GRID_STEP / MYFACTOR) + myOffSet(THE_DEFAULT_GRID_STEP / THE_MYFACTOR) { myColor = aColor; myTenthColor = aTenthColor; diff --git a/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx b/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx index f692a56a6c..d42ea9012b 100644 --- a/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx @@ -32,11 +32,11 @@ namespace { //! Compensates difference between old implementation (without transform persistence) and current //! implementation. -static const Standard_Real THE_INTERNAL_SCALE_FACTOR = 500.0; +constexpr Standard_Real THE_INTERNAL_SCALE_FACTOR = 500.0; -static const Standard_ShortReal THE_CYLINDER_LENGTH = 0.75f; -static const Standard_Integer THE_CIRCLE_SERMENTS_NB = 24; -static const Standard_Real THE_CIRCLE_SEGMENT_ANGLE = 2.0 * M_PI / THE_CIRCLE_SERMENTS_NB; +constexpr Standard_ShortReal THE_CYLINDER_LENGTH = 0.75f; +constexpr Standard_Integer THE_CIRCLE_SERMENTS_NB = 24; +constexpr Standard_Real THE_CIRCLE_SEGMENT_ANGLE = 2.0 * M_PI / THE_CIRCLE_SERMENTS_NB; //! Create new or return existing group in the structure at specified position. //! @param theStruct [in] structure holding graphic groups diff --git a/src/Visualization/TKV3d/V3d/V3d_View.cxx b/src/Visualization/TKV3d/V3d/V3d_View.cxx index 5e58397f95..38e1823ad2 100644 --- a/src/Visualization/TKV3d/V3d/V3d_View.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_View.cxx @@ -51,12 +51,11 @@ IMPLEMENT_STANDARD_RTTIEXT(V3d_View, Standard_Transient) -#define DEUXPI (2. * M_PI) - namespace { -static const Standard_Integer THE_NB_BOUND_POINTS = 8; -} +constexpr double THE_TWO_PI = 2.0 * M_PI; +constexpr int THE_NB_BOUND_POINTS = 8; +} // namespace //================================================================================================= @@ -723,23 +722,23 @@ void V3d_View::Rotate(const Standard_Real ax, Standard_Real Az = az; if (Ax > 0.) - while (Ax > DEUXPI) - Ax -= DEUXPI; + while (Ax > THE_TWO_PI) + Ax -= THE_TWO_PI; else if (Ax < 0.) - while (Ax < -DEUXPI) - Ax += DEUXPI; + while (Ax < -THE_TWO_PI) + Ax += THE_TWO_PI; if (Ay > 0.) - while (Ay > DEUXPI) - Ay -= DEUXPI; + while (Ay > THE_TWO_PI) + Ay -= THE_TWO_PI; else if (Ay < 0.) - while (Ay < -DEUXPI) - Ay += DEUXPI; + while (Ay < -THE_TWO_PI) + Ay += THE_TWO_PI; if (Az > 0.) - while (Az > DEUXPI) - Az -= DEUXPI; + while (Az > THE_TWO_PI) + Az -= THE_TWO_PI; else if (Az < 0.) - while (Az < -DEUXPI) - Az += DEUXPI; + while (Az < -THE_TWO_PI) + Az += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -790,23 +789,23 @@ void V3d_View::Rotate(const Standard_Real ax, Standard_Real Az = az; if (Ax > 0.) - while (Ax > DEUXPI) - Ax -= DEUXPI; + while (Ax > THE_TWO_PI) + Ax -= THE_TWO_PI; else if (Ax < 0.) - while (Ax < -DEUXPI) - Ax += DEUXPI; + while (Ax < -THE_TWO_PI) + Ax += THE_TWO_PI; if (Ay > 0.) - while (Ay > DEUXPI) - Ay -= DEUXPI; + while (Ay > THE_TWO_PI) + Ay -= THE_TWO_PI; else if (Ay < 0.) - while (Ay < -DEUXPI) - Ay += DEUXPI; + while (Ay < -THE_TWO_PI) + Ay += THE_TWO_PI; if (Az > 0.) - while (Az > DEUXPI) - Az -= DEUXPI; + while (Az > THE_TWO_PI) + Az -= THE_TWO_PI; else if (Az < 0.) - while (Az < -DEUXPI) - Az += DEUXPI; + while (Az < -THE_TWO_PI) + Az += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -877,11 +876,11 @@ void V3d_View::Rotate(const V3d_TypeOfAxe theAxe, Standard_Real anAngle = theAngle; if (anAngle > 0.0) - while (anAngle > DEUXPI) - anAngle -= DEUXPI; + while (anAngle > THE_TWO_PI) + anAngle -= THE_TWO_PI; else if (anAngle < 0.0) - while (anAngle < -DEUXPI) - anAngle += DEUXPI; + while (anAngle < -THE_TWO_PI) + anAngle += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -933,11 +932,11 @@ void V3d_View::Rotate(const Standard_Real angle, const Standard_Boolean Start) Standard_Real Angle = angle; if (Angle > 0.) - while (Angle > DEUXPI) - Angle -= DEUXPI; + while (Angle > THE_TWO_PI) + Angle -= THE_TWO_PI; else if (Angle < 0.) - while (Angle < -DEUXPI) - Angle += DEUXPI; + while (Angle < -THE_TWO_PI) + Angle += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -975,23 +974,23 @@ void V3d_View::Turn(const Standard_Real ax, Standard_Real Az = az; if (Ax > 0.) - while (Ax > DEUXPI) - Ax -= DEUXPI; + while (Ax > THE_TWO_PI) + Ax -= THE_TWO_PI; else if (Ax < 0.) - while (Ax < -DEUXPI) - Ax += DEUXPI; + while (Ax < -THE_TWO_PI) + Ax += THE_TWO_PI; if (Ay > 0.) - while (Ay > DEUXPI) - Ay -= DEUXPI; + while (Ay > THE_TWO_PI) + Ay -= THE_TWO_PI; else if (Ay < 0.) - while (Ay < -DEUXPI) - Ay += DEUXPI; + while (Ay < -THE_TWO_PI) + Ay += THE_TWO_PI; if (Az > 0.) - while (Az > DEUXPI) - Az -= DEUXPI; + while (Az > THE_TWO_PI) + Az -= THE_TWO_PI; else if (Az < 0.) - while (Az < -DEUXPI) - Az += DEUXPI; + while (Az < -THE_TWO_PI) + Az += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -1053,11 +1052,11 @@ void V3d_View::Turn(const Standard_Real angle, const Standard_Boolean Start) Standard_Real Angle = angle; if (Angle > 0.) - while (Angle > DEUXPI) - Angle -= DEUXPI; + while (Angle > THE_TWO_PI) + Angle -= THE_TWO_PI; else if (Angle < 0.) - while (Angle < -DEUXPI) - Angle += DEUXPI; + while (Angle < -THE_TWO_PI) + Angle += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -1090,11 +1089,11 @@ void V3d_View::SetTwist(const Standard_Real angle) Standard_Real Angle = angle; if (Angle > 0.) - while (Angle > DEUXPI) - Angle -= DEUXPI; + while (Angle > THE_TWO_PI) + Angle -= THE_TWO_PI; else if (Angle < 0.) - while (Angle < -DEUXPI) - Angle += DEUXPI; + while (Angle < -THE_TWO_PI) + Angle += THE_TWO_PI; Handle(Graphic3d_Camera) aCamera = Camera(); @@ -2265,7 +2264,7 @@ Standard_Real V3d_View::Twist() const const gp_Dir aProjDir = Camera()->Direction().Reversed(); if (aP.Dot(aProjDir.XYZ()) < 0.0) { - anAngle = DEUXPI - anAngle; + anAngle = THE_TWO_PI - anAngle; } } return anAngle;