Coding - Remove unused code and comments across various files (#968)

- Removed conditional compilation blocks (`#if 0`) that contained unused code in:
  - BRepTools_Modifier.cxx
  - AdvApp2Var_Data_f2c.hxx
  - AdvApp2Var_SysBase_baseinit.cxx
  - Extrema_FuncExtCS.cxx
  - Extrema_FuncExtSS.cxx
  - GeomProjLib.cxx
  - IntAna_IntLinTorus.cxx
  - IntAna2d_AnaIntersection_8.cxx
  - IntAna2d_Outils.cxx
  - ProjLib_CompProjectedCurve.cxx
  - ProjLib_ComputeApprox.cxx
  - ProjLib_ComputeApproxOnPolarSurface.cxx

- Cleaned up header files by ensuring proper end-of-file newlines in:
  - TKBRep_pch.hxx
  - GeomLib_Tool.hxx
  - MeshVS_SymmetricPairHasher.hxx
  - OpenGl_ShaderProgramDumpLevel.hxx
  - Graphic3d_ToneMappingMethod.hxx
This commit is contained in:
Pasukhin Dmitry
2025-12-29 16:58:00 +00:00
committed by GitHub
parent a509566a28
commit f675adaac0
144 changed files with 42 additions and 6085 deletions
@@ -306,16 +306,6 @@ static bool CheckPoints(const TopoDS_Shape& theS,
theOBB.GetVertex(&anArrPnts(aNbPnts));
}
#if 0
for(int i = anArrPnts.Lower(); i <= anArrPnts.Upper(); i++)
{
const gp_Pnt &aP = anArrPnts(i);
std::cout << "point p" << i << " " << aP.X() << ", " <<
aP.Y() << ", " <<
aP.Z() << ", "<< std::endl;
}
#endif
theOBB.ReBuild(anArrPnts, aPtrArrTol, theIsOptimal);
return (!theOBB.IsVoid());
@@ -29,9 +29,6 @@
bool Affich;
#endif
#ifdef DRAW
#include <DBRep.hxx>
#endif
//=================================================================================================
static void BuildBack(
@@ -184,17 +181,11 @@ static void DEBControl(
{
const TopoDS_Shape& OS = it.Key();
Sprintf(name, "SK_%d", ++IK);
#ifdef DRAW
DBRep::Set(name, OS);
#endif
NCollection_List<TopoDS_Shape>::Iterator itl(MG(OS));
int IV = 1;
for (; itl.More(); itl.Next())
{
Sprintf(name, "SV_%d_%d", IK, IV++);
#ifdef DRAW
DBRep::Set(name, NS);
#endif
}
}
}
@@ -44,4 +44,4 @@ struct BRepExtrema_ElementFilter
}
};
#endif // _BRepExtrema_ElementFilter_HeaderFile
#endif // _BRepExtrema_ElementFilter_HeaderFile
@@ -570,13 +570,6 @@ void BRepLib_MakeEdge2d::Init(const occ::handle<Geom2d_Curve>& CC,
{
B.MakeVertex(V1, P, preci);
}
#if 0
// desctivate control (RLE) for speed in sketcher
else if (P.Distance(BRep_Tool::Pnt(V1)) > preci) {
myError = BRepLib_DifferentsPointAndParameter;
return;
}
#endif
}
if (p2inf)
@@ -594,13 +587,6 @@ void BRepLib_MakeEdge2d::Init(const occ::handle<Geom2d_Curve>& CC,
{
B.MakeVertex(V2, P, preci);
}
#if 0
// desctivate control (RLE) for speed in sketcher
else if (P.Distance(BRep_Tool::Pnt(V2)) > preci){
myError = BRepLib_DifferentsPointAndParameter;
return;
}
#endif
}
}
@@ -35,14 +35,6 @@
#include <StdFail_NotDone.hxx>
#ifdef OCCT_DEBUG
// #define DRAW
#ifdef DRAW
#include <DrawTrSurf.hxx>
#pragma comment(lib, "TKDraw.lib")
static char name[100];
static int nbb = 0;
static bool Affich = false;
#endif
#endif
static bool IsMaxRC(const occ::handle<Geom2d_Curve>& C, double U, double& R);
@@ -249,19 +241,6 @@ void Bisector_Bisec::Perform(const occ::handle<Geom2d_Curve>& afirstcurve,
UFirst = std::max(UFirst, Bis->FirstParameter());
ULast = std::min(ULast, Bis->LastParameter());
thebisector = new Geom2d_TrimmedCurve(Bis, UFirst, ULast);
#ifdef DRAW
if (Affich)
{
Sprintf(name, "c1_%d", ++nbb);
DrawTrSurf::Set(name, afirstcurve);
Sprintf(name, "c2_%d", nbb);
DrawTrSurf::Set(name, asecondcurve);
Sprintf(name, "p%d", nbb);
DrawTrSurf::Set(name, apoint);
Sprintf(name, "b%d", nbb);
DrawTrSurf::Set(name, thebisector);
}
#endif
}
//===========================================================================
@@ -401,20 +380,6 @@ void Bisector_Bisec::Perform(const occ::handle<Geom2d_Curve>& afirstcurve,
if (ULast > Bis->LastParameter())
ULast = Bis->LastParameter();
thebisector = new Geom2d_TrimmedCurve(Bis, UFirst, ULast);
#ifdef DRAW
if (Affich)
{
Sprintf(name, "c1_%d", ++nbb);
DrawTrSurf::Set(name, afirstcurve);
Sprintf(name, "c2_%d", nbb);
DrawTrSurf::Set(name, asecondpoint->Pnt2d());
Sprintf(name, "p%d", nbb);
DrawTrSurf::Set(name, apoint);
Sprintf(name, "b%d", nbb);
DrawTrSurf::Set(name, thebisector);
}
#endif
}
//===========================================================================
@@ -551,20 +516,6 @@ void Bisector_Bisec::Perform(const occ::handle<Geom2d_Point>& afirstpoint,
UFirst = std::max(UFirst, Bis->FirstParameter());
ULast = std::min(ULast, Bis->LastParameter());
thebisector = new Geom2d_TrimmedCurve(Bis, UFirst, ULast);
#ifdef DRAW
if (Affich)
{
Sprintf(name, "c1_%d", ++nbb);
DrawTrSurf::Set(name, afirstpoint->Pnt2d());
Sprintf(name, "c2_%d", nbb);
DrawTrSurf::Set(name, asecondcurve);
Sprintf(name, "p%d", nbb);
DrawTrSurf::Set(name, apoint);
Sprintf(name, "b%d", nbb);
DrawTrSurf::Set(name, thebisector);
}
#endif
}
//===========================================================================
@@ -599,20 +550,6 @@ void Bisector_Bisec::Perform(const occ::handle<Geom2d_Point>& afirstpoint,
oncurve);
thebisector =
new Geom2d_TrimmedCurve(Bis, Bis->ParameterOfStartPoint(), Bis->ParameterOfEndPoint());
#ifdef DRAW
if (Affich)
{
Sprintf(name, "c1_%d", ++nbb);
DrawTrSurf::Set(name, afirstpoint->Pnt2d());
Sprintf(name, "c2_%d", nbb);
DrawTrSurf::Set(name, asecondpoint->Pnt2d());
Sprintf(name, "p%d", nbb);
DrawTrSurf::Set(name, apoint);
Sprintf(name, "b%d", nbb);
DrawTrSurf::Set(name, thebisector);
}
#endif
}
//=================================================================================================
@@ -37,13 +37,6 @@
#include <Precision.hxx>
#ifdef OCCT_DEBUG
// #define DRAW
#ifdef DRAW
#include <DrawTrSurf.hxx>
static char name[100];
static bool Affich = false;
static int nbint = 0;
#endif
#endif
//=================================================================================================
@@ -327,25 +320,6 @@ void Bisector_Inter::SinglePerform(const occ::handle<Geom2d_Curve>& CBis1,
D2.FirstParameter(),
D2.LastParameter());
}
#ifdef DRAW
if (Affich)
{
Sprintf(name, "i1_%d", ++nbint);
DrawTrSurf::Set(name, Bis1);
Sprintf(name, "i2_%d", nbint);
DrawTrSurf::Set(name, Bis2);
if (IsDone() && !IsEmpty())
{
for (int k = 1; k <= NbPoints(); k++)
{
gp_Pnt2d P = Point(k).Value();
Sprintf(name, "ip_%d_%d", nbint, k);
DrawTrSurf::Set(name, P);
}
}
}
#endif
}
//===================================================================================
@@ -42,13 +42,6 @@ IMPLEMENT_STANDARD_RTTIEXT(MAT2d_Circuit, Standard_Transient)
#include <Geom2d_Circle.hxx>
#endif
#ifdef DRAW
#include <Draw_Appli.hxx>
#include <DrawTrSurf_Curve2d.hxx>
#include <Draw_Marker2D.hxx>
static occ::handle<DrawTrSurf_Curve2d> draw;
Standard_EXPORT Draw_Viewer dout;
#endif
#ifdef OCCT_DEBUG
static void MAT2d_DrawCurve(const occ::handle<Geom2d_Curve>& aCurve, const int Indice);
static bool AffichCircuit = 0;
@@ -290,20 +283,6 @@ bool MAT2d_Circuit::IsSharpCorner(const occ::handle<Geom2d_Geometry>& Geom1,
static bool Affich = 0;
if (Affich)
{
#ifdef DRAW
double DU1 = (OC1.LastParameter() - OC1.FirstParameter()) / 9.;
double DU2 = (OC2.LastParameter() - OC2.FirstParameter()) / 9.;
for (int ki = 0; ki <= 9; ki++)
{
gp_Pnt2d P1 = OC1.Value(OC1.FirstParameter() + ki * DU1);
gp_Pnt2d P2 = OC2.Value(OC2.FirstParameter() + ki * DU2);
occ::handle<Draw_Marker2D> dr1 = new Draw_Marker2D(P1, Draw_Plus, Draw_vert);
occ::handle<Draw_Marker2D> dr2 = new Draw_Marker2D(P2, Draw_Plus, Draw_rouge);
dout << dr1;
dout << dr2;
}
dout.Flush();
#endif
}
#endif
@@ -688,12 +667,6 @@ void MAT2d_Circuit::InsertCorner(NCollection_Sequence<occ::handle<Geom2d_Geometr
if (Insert)
{
Curve = occ::down_cast<Geom2d_TrimmedCurve>(Line.Value(isuiv));
#ifdef DRAW
gp_Pnt2d P = Curve->StartPoint();
occ::handle<Draw_Marker2D> dr = new Draw_Marker2D(P, Draw_Plus, Draw_vert);
dout << dr;
dout.Flush();
#endif
}
}
#endif
@@ -885,10 +858,6 @@ void MAT2d_DrawCurve(const occ::handle<Geom2d_Curve>& aCurve, const int /*Indice
{
occ::handle<Standard_Type> type = aCurve->DynamicType();
occ::handle<Geom2d_Curve> curve, CurveDraw;
#ifdef DRAW
occ::handle<DrawTrSurf_Curve2d> dr;
Draw_Color Couleur;
#endif
if (type == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
@@ -937,27 +906,6 @@ void MAT2d_DrawCurve(const occ::handle<Geom2d_Curve>& aCurve, const int /*Indice
{
CurveDraw = aCurve;
}
#ifdef DRAW
if (Indice == 1)
Couleur = Draw_jaune;
else if (Indice == 2)
Couleur = Draw_bleu;
else if (Indice == 3)
Couleur = Draw_rouge;
else if (Indice == 4)
Couleur = Draw_vert;
if (type == STANDARD_TYPE(Geom2d_Circle))
dr = new DrawTrSurf_Curve2d(CurveDraw, Couleur, 30);
else if (type == STANDARD_TYPE(Geom2d_Line))
dr = new DrawTrSurf_Curve2d(CurveDraw, Couleur, 2);
else
dr = new DrawTrSurf_Curve2d(CurveDraw, Couleur, 500);
dout << dr;
dout.Flush();
#endif
}
#endif
@@ -16,18 +16,6 @@
#define Debug(expr) std::cout << " MAT2d_Tool2d.cxx : expr :" << expr << std::endl;
// #define OCCT_DEBUG
// #define DRAW
#ifdef DRAW
#include <DBRep.hxx>
#include <DrawTrSurf.hxx>
#include <stdio.h>
#endif
#ifdef DRAW
#include <Draw_Appli.hxx>
#include <DrawTrSurf_Curve2d.hxx>
#include <GCE2d_MakeSegment.hxx>
#endif
#include <Bisector_Bisec.hxx>
#include <Bisector_BisecAna.hxx>
@@ -66,10 +54,6 @@
#include <StdFail_NotDone.hxx>
#include <NCollection_Array1.hxx>
#ifdef DRAW
static occ::handle<DrawTrSurf_Curve2d> draw;
static int AffichBis = false;
#endif
#ifdef OCCT_DEBUG
static void MAT2d_DrawCurve(const occ::handle<Geom2d_Curve>& aCurve, const int Indice);
static bool Store = false;
@@ -211,23 +195,11 @@ int MAT2d_Tool2d::TangentBefore(const int anitem, const bool IsOpenResult)
if (type != STANDARD_TYPE(Geom2d_CartesianPoint))
{
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(anitem));
#ifdef DRAW
char* name = new char[100];
Sprintf(name, "c%d", anitem);
DrawTrSurf::Set(name, curve);
delete[] name;
#endif
theGeomVecs.Bind(theNumberOfVecs, curve->DN(curve->LastParameter(), 1));
}
else
{
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(item));
#ifdef DRAW
char* name = new char[100];
Sprintf(name, "c%d", item);
DrawTrSurf::Set(name, curve);
delete[] name;
#endif
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(item));
double param = (IsOpenResult && anitem == theCircuit->NumberOfItems())
? curve->LastParameter()
: curve->FirstParameter();
@@ -259,13 +231,7 @@ int MAT2d_Tool2d::TangentAfter(const int anitem, const bool IsOpenResult)
type = theCircuit->Value(anitem)->DynamicType();
if (type != STANDARD_TYPE(Geom2d_CartesianPoint))
{
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(anitem));
#ifdef DRAW
char* name = new char[100];
Sprintf(name, "c%d", anitem);
DrawTrSurf::Set(name, curve);
delete[] name;
#endif
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(anitem));
thevector = curve->DN(curve->FirstParameter(), 1);
}
else
@@ -275,13 +241,7 @@ int MAT2d_Tool2d::TangentAfter(const int anitem, const bool IsOpenResult)
else
item = (anitem == 1) ? 2 : (anitem - 1);
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(item));
#ifdef DRAW
char* name = new char[100];
Sprintf(name, "c%d", item);
DrawTrSurf::Set(name, curve);
delete[] name;
#endif
curve = occ::down_cast<Geom2d_Curve>(theCircuit->Value(item));
double param = (IsOpenResult && anitem == 1) ? curve->FirstParameter() : curve->LastParameter();
thevector = curve->DN(param, 1);
}
@@ -419,14 +379,6 @@ void MAT2d_Tool2d::CreateBisector(const occ::handle<MAT_Bisector>& abisector)
abisector->BisectorNumber(theNumberOfBisectors);
abisector->Sense(1);
#ifdef DRAW
char* name = new char[100];
Sprintf(name, "b%d", theNumberOfBisectors);
DrawTrSurf::Set(name, bisector.Value());
Dump(abisector->BisectorNumber(), 1);
delete[] name;
#endif
#ifdef OCCT_DEBUG
bool AffichDraw = false;
if (AffichDraw)
@@ -438,12 +390,6 @@ void MAT2d_Tool2d::CreateBisector(const occ::handle<MAT_Bisector>& abisector)
if (Type1 == STANDARD_TYPE(Bisector_BisecAna))
{
BasisCurve = occ::down_cast<Bisector_BisecAna>(bisector.Value()->BasisCurve())->Geom2dCurve();
#ifdef DRAW
char* name = new char[100];
Sprintf(name, "BISSEC_%d", abisector->BisectorNumber());
DrawTrSurf::Set(name, BasisCurve);
delete[] name;
#endif
}
}
#endif
@@ -1060,25 +1006,11 @@ double MAT2d_Tool2d::IntersectBisector(const occ::handle<MAT_Bisector>& Bisector
{
if (Bisector1->StartPoint().Distance(PointSolution) < Tolerance)
{
#ifdef DRAW
if (AffichBis)
{
DrawTrSurf::Set("Bis1", Bisector1);
DrawTrSurf::Set("Bis2", Bisector2);
}
#endif
return Precision::Infinite();
}
if (Bisector2->StartPoint().Distance(PointSolution) < Tolerance)
{
#ifdef DRAW
if (AffichBis)
{
DrawTrSurf::Set("Bis1", Bisector1);
DrawTrSurf::Set("Bis2", Bisector2);
}
#endif
return Precision::Infinite();
}
}
@@ -1422,10 +1354,6 @@ void MAT2d_DrawCurve(const occ::handle<Geom2d_Curve>& aCurve, const int /*Indice
{
occ::handle<Standard_Type> type = aCurve->DynamicType();
occ::handle<Geom2d_Curve> curve, CurveDraw;
#ifdef DRAW
occ::handle<DrawTrSurf_Curve2d> dr;
Draw_Color Couleur;
#endif
if (type == STANDARD_TYPE(Geom2d_TrimmedCurve))
{
@@ -1474,28 +1402,6 @@ void MAT2d_DrawCurve(const occ::handle<Geom2d_Curve>& aCurve, const int /*Indice
{
CurveDraw = aCurve;
}
#ifdef DRAW
int Indice = 1;
if (Indice == 1)
Couleur = Draw_jaune;
else if (Indice == 2)
Couleur = Draw_bleu;
else if (Indice == 3)
Couleur = Draw_rouge;
else if (Indice == 4)
Couleur = Draw_vert;
if (type == STANDARD_TYPE(Geom2d_Circle))
dr = new DrawTrSurf_Curve2d(CurveDraw, Couleur, 30);
else if (type == STANDARD_TYPE(Geom2d_Line))
dr = new DrawTrSurf_Curve2d(CurveDraw, Couleur, 2);
else
dr = new DrawTrSurf_Curve2d(CurveDraw, Couleur, 500);
// dout << dr;
// dout.Flush();
#endif
}
#endif