1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Coding - Apply .clang-format formatting #286

Update empty method guards to new style with regex (see PR).
Used clang-format 18.1.8.
New actions to validate code formatting is added.
Update .clang-format with disabling of include sorting.
  It is temporary changes, then include will be sorted.
Apply formatting for /src and /tools folder.
The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
dpasukhi
2025-01-25 20:15:22 +00:00
parent dbba6f1289
commit a5a7b3185b
14005 changed files with 1273539 additions and 1195567 deletions

View File

@@ -16,29 +16,27 @@
#include <IntImp_ConstIsoparametric.hxx>
#include <Standard_OutOfRange.hxx>
static const IntImp_ConstIsoparametric staticChoixRef [4] = {
IntImp_UIsoparametricOnCaro1,
IntImp_VIsoparametricOnCaro1,
IntImp_UIsoparametricOnCaro2,
IntImp_VIsoparametricOnCaro2,
static const IntImp_ConstIsoparametric staticChoixRef[4] = {
IntImp_UIsoparametricOnCaro1,
IntImp_VIsoparametricOnCaro1,
IntImp_UIsoparametricOnCaro2,
IntImp_VIsoparametricOnCaro2,
};
IntImp_ConstIsoparametric ChoixRef (Standard_Integer theIndex)
IntImp_ConstIsoparametric ChoixRef(Standard_Integer theIndex)
{
Standard_OutOfRange_Raise_if (theIndex < 0 || theIndex > 3, "ChoixRef() in " __FILE__)
return staticChoixRef[theIndex];
Standard_OutOfRange_Raise_if(theIndex < 0 || theIndex > 3,
"ChoixRef() in " __FILE__) return staticChoixRef[theIndex];
}
//=======================================================================
//function : IntImp_ComputeTangence
//purpose :
//=======================================================================
Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
const Standard_Real EpsUV[],
Standard_Real Tgduv[],
IntImp_ConstIsoparametric TabIso[])
//=================================================================================================
Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
const Standard_Real EpsUV[],
Standard_Real Tgduv[],
IntImp_ConstIsoparametric TabIso[])
// arguments d entree:
// DPuv [0] =derivee en u sur caro 1
// DPuv [0] =derivee en u sur caro 1
// DPuv [1] =derivee en v sur caro 1
// DPuv [2] =derivee en u sur caro 2
// DPuv [3] =derivee en v sur caro 2
@@ -51,7 +49,7 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
// Tgduv[1] composante sup dp/dv de caro1 de la tangente a l intersection
// Tgduv[2] composante sup dp/du de caro2 de la tangente a l intersection
// Tgduv[3] composante sup dp/dv de caro2 de la tangente a l intersection
// TabIso[0...3] meilleure iso range par ordre decroissant candidate
// TabIso[0...3] meilleure iso range par ordre decroissant candidate
// a l intersection
// algorithme
// calculer la tangente a l 'intersection ;en utilisant la propriete suivante
@@ -59,104 +57,110 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
// tangente a l intersection dans les 2 plans tangents (t=n1^n2 ou n1 normale
// au premier carreau n2 au 2ieme)
// on s assurera que les plans tangents des 2 carreaux ne sont pas //
// les composantes de l intersection dans les plans tangents permettent de
//determiner l angle entre les isoparametriques d un carreau avec le carreau
//reciproque
//on triera par ordre croissant les cosinus :le plus petit cosinus determine le
// les composantes de l intersection dans les plans tangents permettent de
// determiner l angle entre les isoparametriques d un carreau avec le carreau
// reciproque
// on triera par ordre croissant les cosinus :le plus petit cosinus determine le
// meilleure angle donc la meilleure iso a choisir pour trouver
// l intersection
// l intersection
{
Standard_Real NormDuv[4], aM2, aTol2;
Standard_Integer i;
//
aTol2=1.e-32;
//
for (i=0; i<4; ++i) {
NormDuv[i] = DPuv[i].SquareMagnitude();
if(NormDuv[i]<=aTol2) {
return Standard_True;
}
}
//
//-------------------------------------------------
gp_Vec N1 = DPuv[0];
N1.Cross(DPuv[1]);
//
//modified by NIZNHY-PKV Tue Nov 01 08:37:32 2011f
aM2=N1.SquareMagnitude();
if (aM2<aTol2) {
return Standard_True;
}
//modified by NIZNHY-PKV Tue Nov 01 08:37:34 2011t
N1.Normalize();
//-------------------------------------------------
gp_Vec N2 = DPuv[2];
N2.Cross(DPuv[3]);
//modified by NIZNHY-PKV Tue Nov 01 08:37:32 2011f
aM2=N2.SquareMagnitude();
if (aM2<aTol2) {
return Standard_True;
}
//modified by NIZNHY-PKV Tue Nov 01 08:37:34 2011t
N2.Normalize();
//
//modified by NIZNHY-PKV Tue Nov 01 08:31:25 2011f
for (i=0; i<4; ++i) {
NormDuv[i]=sqrt(NormDuv[i]);
}
//modified by NIZNHY-PKV Tue Nov 01 08:31:29 2011t
Tgduv[0] = -DPuv[1].Dot(N2);
Tgduv[1] = DPuv[0].Dot(N2);
Tgduv[2] = DPuv[3].Dot(N1);
Tgduv[3] = -DPuv[2].Dot(N1);
Standard_Real NormDuv[4], aM2, aTol2;
Standard_Integer i;
//
aTol2 = 1.e-32;
//
for (i = 0; i < 4; ++i)
{
NormDuv[i] = DPuv[i].SquareMagnitude();
if (NormDuv[i] <= aTol2)
{
return Standard_True;
}
}
//
//-------------------------------------------------
gp_Vec N1 = DPuv[0];
N1.Cross(DPuv[1]);
//
// modified by NIZNHY-PKV Tue Nov 01 08:37:32 2011f
aM2 = N1.SquareMagnitude();
if (aM2 < aTol2)
{
return Standard_True;
}
// modified by NIZNHY-PKV Tue Nov 01 08:37:34 2011t
N1.Normalize();
//-------------------------------------------------
gp_Vec N2 = DPuv[2];
N2.Cross(DPuv[3]);
// modified by NIZNHY-PKV Tue Nov 01 08:37:32 2011f
aM2 = N2.SquareMagnitude();
if (aM2 < aTol2)
{
return Standard_True;
}
// modified by NIZNHY-PKV Tue Nov 01 08:37:34 2011t
N2.Normalize();
//
// modified by NIZNHY-PKV Tue Nov 01 08:31:25 2011f
for (i = 0; i < 4; ++i)
{
NormDuv[i] = sqrt(NormDuv[i]);
}
// modified by NIZNHY-PKV Tue Nov 01 08:31:29 2011t
Tgduv[0] = -DPuv[1].Dot(N2);
Tgduv[1] = DPuv[0].Dot(N2);
Tgduv[2] = DPuv[3].Dot(N1);
Tgduv[3] = -DPuv[2].Dot(N1);
Standard_Boolean tangent =
(Abs(Tgduv[0]) <= EpsUV[0] * NormDuv[1] && Abs(Tgduv[1]) <= EpsUV[1] * NormDuv[0]
&& Abs(Tgduv[2]) <= EpsUV[2] * NormDuv[3] && Abs(Tgduv[3]) <= EpsUV[3] * NormDuv[2]);
if (!tangent)
{
Standard_Real t = N1.Dot(N2);
if (t < 0.0)
t = -t;
if (t > 0.999999999)
{
tangent = Standard_True;
}
}
Standard_Boolean tangent = (Abs(Tgduv[0]) <= EpsUV[0]*NormDuv[1] &&
Abs(Tgduv[1]) <= EpsUV[1]*NormDuv[0] &&
Abs(Tgduv[2]) <= EpsUV[2]*NormDuv[3] &&
Abs(Tgduv[3]) <= EpsUV[3]*NormDuv[2] );
if(!tangent) {
Standard_Real t=N1.Dot(N2);
if(t<0.0) t=-t;
if(t>0.999999999) {
tangent=Standard_True;
}
}
if (!tangent)
{
NormDuv[0] = Abs(Tgduv[1]) / NormDuv[0]; // iso u sur caro1
NormDuv[1] = Abs(Tgduv[0]) / NormDuv[1]; // iso v sur caro1
NormDuv[2] = Abs(Tgduv[3]) / NormDuv[2]; // iso u sur caro2
NormDuv[3] = Abs(Tgduv[2]) / NormDuv[3]; // iso v sur caro2
if (!tangent) {
NormDuv[0] = Abs(Tgduv[1]) /NormDuv[0]; //iso u sur caro1
NormDuv[1] = Abs(Tgduv[0]) /NormDuv[1]; //iso v sur caro1
NormDuv[2] = Abs(Tgduv[3]) /NormDuv[2]; // iso u sur caro2
NormDuv[3] = Abs(Tgduv[2]) /NormDuv[3]; //iso v sur caro2
//-- Tri sur NormDuv ( en para. avec ChoixRef )
Standard_Boolean triOk = Standard_False;
Standard_Real t;
IntImp_ConstIsoparametric ti;
for ( i=0;i<=3;i++)
{
TabIso[i] = staticChoixRef[i];
}
do {
triOk = Standard_True;
for(i=1;i<=3;i++) {
if(NormDuv[i-1]>NormDuv[i]) {
triOk=Standard_False;
t=NormDuv[i];
NormDuv[i]=NormDuv[i-1];
NormDuv[i-1]=t;
ti = TabIso[i];
TabIso[i] = TabIso[i-1];
TabIso[i-1] = ti;
}
}
}
while(!triOk);
//-- Tri sur NormDuv ( en para. avec ChoixRef )
Standard_Boolean triOk = Standard_False;
Standard_Real t;
IntImp_ConstIsoparametric ti;
for (i = 0; i <= 3; i++)
{
TabIso[i] = staticChoixRef[i];
}
do
{
triOk = Standard_True;
for (i = 1; i <= 3; i++)
{
if (NormDuv[i - 1] > NormDuv[i])
{
triOk = Standard_False;
t = NormDuv[i];
NormDuv[i] = NormDuv[i - 1];
NormDuv[i - 1] = t;
ti = TabIso[i];
TabIso[i] = TabIso[i - 1];
TabIso[i - 1] = ti;
}
}
} while (!triOk);
#if 0
// trier par ordre croissant le tableau NormDuv
@@ -181,8 +185,6 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
TabIso[j] = staticChoixRef[Irang[j]];
}
#endif
}
return tangent;
}
}
return tangent;
}

View File

@@ -18,11 +18,11 @@
#include <gp_Vec.hxx>
#include <IntImp_ConstIsoparametric.hxx>
Standard_EXPORT IntImp_ConstIsoparametric ChoixRef (Standard_Integer theIndex);
Standard_EXPORT IntImp_ConstIsoparametric ChoixRef(Standard_Integer theIndex);
Standard_EXPORT Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
const Standard_Real EpsUV[],
Standard_Real Tgduv[],
IntImp_ConstIsoparametric TabIso[]);
Standard_EXPORT Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[],
const Standard_Real EpsUV[],
Standard_Real Tgduv[],
IntImp_ConstIsoparametric TabIso[]);
#endif

View File

@@ -17,13 +17,12 @@
#ifndef _IntImp_ConstIsoparametric_HeaderFile
#define _IntImp_ConstIsoparametric_HeaderFile
enum IntImp_ConstIsoparametric
{
IntImp_UIsoparametricOnCaro1,
IntImp_VIsoparametricOnCaro1,
IntImp_UIsoparametricOnCaro2,
IntImp_VIsoparametricOnCaro2
IntImp_UIsoparametricOnCaro1,
IntImp_VIsoparametricOnCaro1,
IntImp_UIsoparametricOnCaro2,
IntImp_VIsoparametricOnCaro2
};
#endif // _IntImp_ConstIsoparametric_HeaderFile

View File

@@ -16,57 +16,77 @@
#include <StdFail_UndefinedDerivative.hxx>
#include <Standard_DomainError.hxx>
inline Standard_Boolean IntImp_Int2S::IsDone()const { return done;}
inline Standard_Boolean IntImp_Int2S::IsDone() const
{
return done;
}
inline Standard_Boolean IntImp_Int2S::IsEmpty() const
{
if (!done) throw StdFail_NotDone(" IntImp_Int2S::IsEmpty() ");
{
if (!done)
throw StdFail_NotDone(" IntImp_Int2S::IsEmpty() ");
return empty;
}
inline const IntSurf_PntOn2S& IntImp_Int2S::Point() const
{
if (!done) throw StdFail_NotDone(" IntImp_Int2S::Point() ");
if (empty) throw Standard_DomainError(" IntImp_Int2S::Point() ");
{
if (!done)
throw StdFail_NotDone(" IntImp_Int2S::Point() ");
if (empty)
throw Standard_DomainError(" IntImp_Int2S::Point() ");
return pint;
}
inline Standard_Boolean IntImp_Int2S::IsTangent () const {
inline Standard_Boolean IntImp_Int2S::IsTangent() const
{
if (!done) throw StdFail_NotDone(" IntImp_Int2S::IsTangent () ");
if (empty) throw Standard_DomainError(" IntImp_Int2S::IsTangent () ");
if (!done)
throw StdFail_NotDone(" IntImp_Int2S::IsTangent () ");
if (empty)
throw Standard_DomainError(" IntImp_Int2S::IsTangent () ");
return tangent;
}
inline const gp_Dir& IntImp_Int2S::Direction () const {
inline const gp_Dir& IntImp_Int2S::Direction() const
{
if (!done) throw StdFail_NotDone(" IntImp_Int2S::Direction () ");
if (empty) throw Standard_DomainError(" IntImp_Int2S::Direction () ");
if (tangent) throw StdFail_UndefinedDerivative(" IntImp_Int2S::Direction () ");
if (!done)
throw StdFail_NotDone(" IntImp_Int2S::Direction () ");
if (empty)
throw Standard_DomainError(" IntImp_Int2S::Direction () ");
if (tangent)
throw StdFail_UndefinedDerivative(" IntImp_Int2S::Direction () ");
return d3d;
}
inline const gp_Dir2d& IntImp_Int2S::DirectionOnS1 () const {
inline const gp_Dir2d& IntImp_Int2S::DirectionOnS1() const
{
if (!done) throw StdFail_NotDone(" IntImp_Int2S::DirectionOnS1 () ");
if (empty) throw Standard_DomainError(" IntImp_Int2S::DirectionOnS1 () ");
if (tangent) throw StdFail_UndefinedDerivative(" IntImp_Int2S::DirectionOnS1 () ");
if (!done)
throw StdFail_NotDone(" IntImp_Int2S::DirectionOnS1 () ");
if (empty)
throw Standard_DomainError(" IntImp_Int2S::DirectionOnS1 () ");
if (tangent)
throw StdFail_UndefinedDerivative(" IntImp_Int2S::DirectionOnS1 () ");
return d2d1;
}
inline const gp_Dir2d& IntImp_Int2S::DirectionOnS2 () const {
inline const gp_Dir2d& IntImp_Int2S::DirectionOnS2() const
{
if (!done) throw StdFail_NotDone(" IntImp_Int2S::DirectionOnS2 () ");
if (empty) throw Standard_DomainError(" IntImp_Int2S::DirectionOnS2 () ");
if (tangent) throw StdFail_UndefinedDerivative(" IntImp_Int2S::DirectionOnS2 () ");
if (!done)
throw StdFail_NotDone(" IntImp_Int2S::DirectionOnS2 () ");
if (empty)
throw Standard_DomainError(" IntImp_Int2S::DirectionOnS2 () ");
if (tangent)
throw StdFail_UndefinedDerivative(" IntImp_Int2S::DirectionOnS2 () ");
return d2d2;
}
inline IntImp_TheFunction& IntImp_Int2S::Function() {
inline IntImp_TheFunction& IntImp_Int2S::Function()
{
return myZerParFunc;
}
}
inline IntSurf_PntOn2S& IntImp_Int2S::ChangePoint()
{

View File

@@ -14,55 +14,56 @@
#include <StdFail_UndefinedDerivative.hxx>
inline void IntImp_ZerImpFunc::Set (const ThePSurface& PS)
inline void IntImp_ZerImpFunc::Set(const ThePSurface& PS)
{
surf = (Standard_Address)(&PS);
surf = (Standard_Address)(&PS);
}
inline void IntImp_ZerImpFunc::SetImplicitSurface (const TheISurface& IS)
inline void IntImp_ZerImpFunc::SetImplicitSurface(const TheISurface& IS)
{
func = (Standard_Address)(&IS);
func = (Standard_Address)(&IS);
}
inline void IntImp_ZerImpFunc::Set (const Standard_Real Tol)
inline void IntImp_ZerImpFunc::Set(const Standard_Real Tol)
{
tol = Tol;
}
inline Standard_Real IntImp_ZerImpFunc::Root() const
{
inline Standard_Real IntImp_ZerImpFunc::Root() const
{
return valf;
}
inline Standard_Real IntImp_ZerImpFunc::Tolerance() const
{
inline Standard_Real IntImp_ZerImpFunc::Tolerance() const
{
return tol;
}
inline const gp_Pnt& IntImp_ZerImpFunc::Point() const
inline const gp_Pnt& IntImp_ZerImpFunc::Point() const
{
return pntsol;
}
inline const gp_Vec& IntImp_ZerImpFunc::Direction3d()
{
if (IsTangent()) throw StdFail_UndefinedDerivative();
if (IsTangent())
throw StdFail_UndefinedDerivative();
return d3d;
}
inline const gp_Dir2d& IntImp_ZerImpFunc::Direction2d()
{
if (IsTangent()) throw StdFail_UndefinedDerivative();
if (IsTangent())
throw StdFail_UndefinedDerivative();
return d2d;
}
inline const ThePSurface& IntImp_ZerImpFunc::PSurface() const
inline const ThePSurface& IntImp_ZerImpFunc::PSurface() const
{
return (*((ThePSurface *)(surf)));
return (*((ThePSurface*)(surf)));
}
inline const TheISurface& IntImp_ZerImpFunc::ISurface() const
{
return (*((TheISurface *)(func)));
inline const TheISurface& IntImp_ZerImpFunc::ISurface() const
{
return (*((TheISurface*)(func)));
}

View File

@@ -18,36 +18,44 @@
#include <gp_Dir2d.hxx>
#include <gp_Dir.hxx>
inline Standard_Real IntImp_ZerParFunc::Root() const {
inline Standard_Real IntImp_ZerParFunc::Root() const
{
return f[0]*f[0]+f[1]*f[1]+f[2]*f[2];
return f[0] * f[0] + f[1] * f[1] + f[2] * f[2];
}
inline gp_Pnt IntImp_ZerParFunc::Point() const {
return gp_Pnt((pntsol1.XYZ()+ pntsol2.XYZ())/2.);
inline gp_Pnt IntImp_ZerParFunc::Point() const
{
return gp_Pnt((pntsol1.XYZ() + pntsol2.XYZ()) / 2.);
}
inline gp_Dir IntImp_ZerParFunc::Direction() const {
if (tangent ) throw StdFail_UndefinedDerivative();
return gp_Dir(tgduv[0]*dpuv[0].XYZ() + tgduv[1]*dpuv[1].XYZ());
inline gp_Dir IntImp_ZerParFunc::Direction() const
{
if (tangent)
throw StdFail_UndefinedDerivative();
return gp_Dir(tgduv[0] * dpuv[0].XYZ() + tgduv[1] * dpuv[1].XYZ());
}
inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS1() const {
if (tangent ) throw StdFail_UndefinedDerivative();
return gp_Dir2d(tgduv[0],tgduv[1]);
inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS1() const
{
if (tangent)
throw StdFail_UndefinedDerivative();
return gp_Dir2d(tgduv[0], tgduv[1]);
}
inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS2() const {
if (tangent ) throw StdFail_UndefinedDerivative();
return gp_Dir2d(tgduv[2],tgduv[3]);
inline gp_Dir2d IntImp_ZerParFunc::DirectionOnS2() const
{
if (tangent)
throw StdFail_UndefinedDerivative();
return gp_Dir2d(tgduv[2], tgduv[3]);
}
inline const ThePSurface& IntImp_ZerParFunc::AuxillarSurface1() const {
return *((const ThePSurface* )surf1);
inline const ThePSurface& IntImp_ZerParFunc::AuxillarSurface1() const
{
return *((const ThePSurface*)surf1);
}
inline const ThePSurface& IntImp_ZerParFunc::AuxillarSurface2() const {
return *((const ThePSurface* )surf2);
inline const ThePSurface& IntImp_ZerParFunc::AuxillarSurface2() const
{
return *((const ThePSurface*)surf2);
}