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.
This commit is contained in:
Pasukhin Dmitry
2025-12-17 10:23:13 +00:00
committed by GitHub
parent 4727f7c049
commit 1d8add2970
66 changed files with 362 additions and 348 deletions
@@ -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)<Precision::Angular()) {
// cas d'ambiguite
// ambiguity case
gp_Vec Vtrans(P0.Location(),P.Location()),Vsign;
Standard_Real alpha,beta,sign=1;
Vsign.SetLinearForm(Vtrans.Dot(vec1),vec2,-Vtrans.Dot(vec2),vec1);
@@ -22,9 +22,9 @@
#define MYBB ((TopOpeBRepBuild_BlockBuilder*)myBlockBuilder)
// sourvenir d'un raise sur FrozenShape lors du Add(myShell,aFace)
// avec un shell qui a ete deja ete place dans le solide interne du
// TopOpeBRepTool_SolidClassifier par LoadShell.
// reminder of a raise on FrozenShape during Add(myShell,aFace)
// with a shell that has already been placed in the internal solid of
// TopOpeBRepTool_SolidClassifier by LoadShell.
#ifdef OCCT_DEBUG
// static Standard_Integer dddjyl = 0;
@@ -235,7 +235,7 @@ void TopOpeBRepBuild_FuseFace::PerformFace()
return;
}
// boucle sur les listes des faces de 1 face de LRF
// loop over the face lists for each face in LRF
for (itt1.Initialize(mapFacLFac); itt1.More(); itt1.Next())
{
@@ -591,7 +591,7 @@ void TopOpeBRepBuild_FuseFace::PerformEdge()
// TopAbs_Orientation ori,ori1;
// Niveau 1
// boucle sur les listes des faces de 1 face de LRF
// loop over the face lists for each face in LRF
for (it1.Initialize(myLFF); it1.More(); it1.Next())
{
@@ -685,7 +685,7 @@ void TopOpeBRepBuild_FuseFace::ClearEdge()
TopTools_ListOfShape myLFFnew;
// Niveau 1
// boucle sur les listes des faces de 1 face de LRF
// loop over the face lists for each face in LRF
for (it1.Initialize(myLFF); it1.More(); it1.Next())
{
@@ -110,9 +110,9 @@ TopAbs_State TopOpeBRepTool_SolidClassifier::Classify(const TopoDS_Solid& SOL,
const TopoDS_Shape& fres = myPClassifier->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();
@@ -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());
@@ -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
@@ -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
@@ -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
@@ -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));
@@ -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()
@@ -41,7 +41,7 @@
#include <TColStd_Array1OfInteger.hxx>
#include <TopTrans_CurveTransition.hxx>
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;
@@ -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())
{
@@ -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 (;;)
{