Coding - Remove obsolete ChFi3d debug instrumentation (#1490)

ChFi3d_Debug and OCCT_DEBUG definitions sometimes impact on
  algorihm behavior and have lack of documentation to use.
- Remove unused ChFi3d trace and context switches
- Remove global performance counters and chronometers
- Remove cross-toolkit timing code from BiTgte_Blend
- Remove obsolete ChFi3d_Debug source file
This commit is contained in:
Pasukhin Dmitry
2026-08-23 13:15:43 +01:00
committed by GitHub
parent 9248874be6
commit 5b145ea48a
14 changed files with 5 additions and 990 deletions
@@ -53,28 +53,6 @@
#include <TopOpeBRepDS_Interference.hxx>
#include <TopOpeBRepDS_PointIterator.hxx>
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
// variables for performances
OSD_Chronometer cl_total, cl_extent, cl_perfsetofsurf, cl_perffilletonvertex, cl_filds,
cl_reconstruction, cl_setregul, cl_perform1corner, cl_perform2corner, cl_performatend,
cl_perform3corner, cl_performmore3corner;
Standard_EXPORT double t_total, t_extent, t_perfsetofsurf, t_perffilletonvertex, t_filds,
t_reconstruction, t_setregul, t_perfsetofkgen, t_perfsetofkpart, t_makextremities, t_performatend,
t_startsol, t_performsurf, t_perform1corner, t_perform2corner, t_perform3corner,
t_performmore3corner, t_batten, t_inter, t_sameinter, t_same, t_plate, t_approxplate,
t_t2cornerinit, t_perf2cornerbyinter, t_chfikpartcompdata, t_cheminement, t_remplissage,
t_t3cornerinit, t_spherique, t_torique, t_notfilling, t_filling, t_sameparam, t_computedata,
t_completedata, t_t2cornerDS, t_t3cornerDS;
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
extern bool ChFi3d_GettraceCHRON();
#endif
//=================================================================================================
static void CompleteDS(TopOpeBRepDS_DataStructure& DStr, const TopoDS_Shape& S)
@@ -184,48 +162,6 @@ void ChFi3d_Builder::ExtentAnalyse()
void ChFi3d_Builder::Compute()
{
#ifdef OCCT_DEBUG // perf
t_total = 0;
t_extent = 0;
t_perfsetofsurf = 0;
t_perffilletonvertex = 0;
t_filds = 0;
t_reconstruction = 0;
t_setregul = 0;
t_perfsetofkpart = 0;
t_perfsetofkgen = 0;
t_makextremities = 0;
t_performsurf = 0;
t_startsol = 0;
t_perform1corner = 0;
t_perform2corner = 0;
t_perform3corner = 0;
t_performmore3corner = 0;
t_inter = 0;
t_same = 0;
t_sameinter = 0;
t_plate = 0;
t_approxplate = 0;
t_batten = 0;
t_remplissage = 0;
t_t3cornerinit = 0;
t_spherique = 0;
t_torique = 0;
t_notfilling = 0;
t_filling = 0;
t_performatend = 0;
t_t2cornerinit = 0;
t_perf2cornerbyinter = 0;
t_chfikpartcompdata = 0;
t_cheminement = 0;
t_sameparam = 0;
t_computedata = 0;
t_completedata = 0;
t_t2cornerDS = 0;
t_t3cornerDS = 0;
ChFi3d_InitChron(cl_total);
ChFi3d_InitChron(cl_extent);
#endif
UpdateTolesp();
if (myListStripe.IsEmpty())
@@ -264,11 +200,6 @@ void ChFi3d_Builder::Compute()
// preanalysis to evaluate the extensions.
ExtentAnalyse();
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_extent, t_extent);
ChFi3d_InitChron(cl_perfsetofsurf);
#endif
// Construction of the stripe of fillet on each stripe.
for (itel.Initialize(myListStripe); itel.More(); itel.Next())
{
@@ -299,11 +230,6 @@ void ChFi3d_Builder::Compute()
}
done = (badstripes.IsEmpty());
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_perfsetofsurf, t_perfsetofsurf);
ChFi3d_InitChron(cl_perffilletonvertex);
#endif
// construct fillets on each vertex + feed the Ds
if (done)
{
@@ -337,11 +263,6 @@ void ChFi3d_Builder::Compute()
}
}
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_perffilletonvertex, t_perffilletonvertex);
ChFi3d_InitChron(cl_filds);
#endif
NCollection_Map<int> MapIndSo;
TopExp_Explorer expso(myShape, TopAbs_SOLID);
for (; expso.More(); expso.Next())
@@ -401,11 +322,6 @@ void ChFi3d_Builder::Compute()
}
}
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_filds, t_filds);
ChFi3d_InitChron(cl_reconstruction);
#endif
if (done)
{
BRep_Builder B1;
@@ -571,91 +487,12 @@ void ChFi3d_Builder::Compute()
}
}
}
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_reconstruction, t_reconstruction);
ChFi3d_InitChron(cl_setregul);
#endif
// Regularities are coded after cutting.
SetRegul();
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_setregul, t_setregul);
#endif
}
}
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_total, t_total);
#endif
// display of time for perfs
#ifdef OCCT_DEBUG
if (ChFi3d_GettraceCHRON())
{
std::cout << std::endl;
std::cout << "COMPUTE: temps total " << t_total << "s dont :" << std::endl;
std::cout << "- Init + ExtentAnalyse " << t_extent << "s" << std::endl;
std::cout << "- PerformSetOfSurf " << t_perfsetofsurf << "s" << std::endl;
std::cout << "- PerformFilletOnVertex " << t_perffilletonvertex << "s" << std::endl;
std::cout << "- FilDS " << t_filds << "s" << std::endl;
std::cout << "- Reconstruction " << t_reconstruction << "s" << std::endl;
std::cout << "- SetRegul " << t_setregul << "s" << std::endl << std::endl;
std::cout << std::endl;
std::cout << "temps PERFORMSETOFSURF " << t_perfsetofsurf << "s dont : " << std::endl;
std::cout << "- SetofKPart " << t_perfsetofkpart << "s" << std::endl;
std::cout << "- SetofKGen " << t_perfsetofkgen << "s" << std::endl;
std::cout << "- MakeExtremities " << t_makextremities << "s" << std::endl << std::endl;
std::cout << "temps SETOFKGEN " << t_perfsetofkgen << "s dont : " << std::endl;
std::cout << "- PerformSurf " << t_performsurf << "s" << std::endl;
std::cout << "- starsol " << t_startsol << "s" << std::endl << std::endl;
std::cout << "temps PERFORMSURF " << t_performsurf << "s dont : " << std::endl;
std::cout << "- computedata " << t_computedata << "s" << std::endl;
std::cout << "- completedata " << t_completedata << "s" << std::endl << std::endl;
std::cout << "temps PERFORMFILLETVERTEX " << t_perffilletonvertex << "s dont : " << std::endl;
std::cout << "- PerformOneCorner " << t_perform1corner << "s" << std::endl;
std::cout << "- PerformIntersectionAtEnd " << t_performatend << "s" << std::endl;
std::cout << "- PerformTwoCorner " << t_perform2corner << "s" << std::endl;
std::cout << "- PerformThreeCorner " << t_perform3corner << "s" << std::endl;
std::cout << "- PerformMoreThreeCorner " << t_performmore3corner << "s" << std::endl
<< std::endl;
std::cout << "temps PerformOneCorner " << t_perform1corner << "s dont:" << std::endl;
std::cout << "- temps condition if (same) " << t_same << "s " << std::endl;
std::cout << "- temps condition if (inter) " << t_inter << "s " << std::endl;
std::cout << "- temps condition if (same inter) " << t_sameinter << "s " << std::endl
<< std::endl;
std::cout << "temps PerformTwocorner " << t_perform2corner << "s dont:" << std::endl;
std::cout << "- temps initialisation " << t_t2cornerinit << "s" << std::endl;
std::cout << "- temps PerformTwoCornerbyInter " << t_perf2cornerbyinter << "s" << std::endl;
std::cout << "- temps ChFiKPart_ComputeData " << t_chfikpartcompdata << "s" << std::endl;
std::cout << "- temps cheminement " << t_cheminement << "s" << std::endl;
std::cout << "- temps remplissage " << t_remplissage << "s" << std::endl;
std::cout << "- temps mise a jour stripes " << t_t2cornerDS << "s" << std::endl << std::endl;
std::cout << " temps PerformThreecorner " << t_perform3corner << "s dont:" << std::endl;
std::cout << "- temps initialisation " << t_t3cornerinit << "s" << std::endl;
std::cout << "- temps cas spherique " << t_spherique << "s" << std::endl;
std::cout << "- temps cas torique " << t_torique << "s" << std::endl;
std::cout << "- temps notfilling " << t_notfilling << "s" << std::endl;
std::cout << "- temps filling " << t_filling << "s" << std::endl;
std::cout << "- temps mise a jour stripes " << t_t3cornerDS << "s" << std::endl << std::endl;
std::cout << "temps PerformMore3Corner " << t_performmore3corner << "s dont:" << std::endl;
std::cout << "-temps plate " << t_plate << "s " << std::endl;
std::cout << "-temps approxplate " << t_approxplate << "s " << std::endl;
std::cout << "-temps batten " << t_batten << "s " << std::endl << std::endl;
std::cout << "TEMPS DIVERS " << std::endl;
std::cout << "-temps ChFi3d_sameparameter " << t_sameparam << "s" << std::endl << std::endl;
}
#endif
//
// Inspect the new faces to provide sameparameter
// if it is necessary
if (IsDone())
@@ -828,19 +665,10 @@ void ChFi3d_Builder::PerformFilletOnVertex(const int Index)
}
if (nba > 3)
{
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_performatend);
#endif
PerformIntersectionAtEnd(Index);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(cl_performatend, t_performatend);
#endif
}
else
{
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_perform1corner);
#endif
if (MoreSurfdata(Index))
{
PerformMoreSurfdata(Index);
@@ -849,66 +677,33 @@ void ChFi3d_Builder::PerformFilletOnVertex(const int Index)
{
PerformOneCorner(Index);
}
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_perform1corner, t_perform1corner);
#endif
}
}
break;
case 2: {
if (nba > 3)
{
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_performmore3corner);
#endif
PerformMoreThreeCorner(Index, i);
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_performmore3corner, t_performmore3corner);
#endif
}
else
{
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_perform2corner);
#endif
PerformTwoCorner(Index);
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_perform2corner, t_perform2corner);
#endif
}
}
break;
case 3: {
if (nba > 3)
{
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_performmore3corner);
#endif
PerformMoreThreeCorner(Index, i);
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_performmore3corner, t_performmore3corner);
#endif
}
else
{
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_perform3corner);
#endif
PerformThreeCorner(Index);
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_perform3corner, t_perform3corner);
#endif
}
}
break;
default: {
#ifdef OCCT_DEBUG // perf
ChFi3d_InitChron(cl_performmore3corner);
#endif
PerformMoreThreeCorner(Index, i);
#ifdef OCCT_DEBUG // perf
ChFi3d_ResultChron(cl_performmore3corner, t_performmore3corner);
#endif
}
}
}
@@ -82,16 +82,6 @@
#include <algorithm>
#include <cmath>
#ifdef OCCT_DEBUG
extern bool ChFi3d_GetcontextFORCEBLEND();
extern bool ChFi3d_GettraceDRAWINT();
extern bool ChFi3d_GettraceDRAWENLARGE();
extern bool ChFi3d_GettraceDRAWSPINE();
extern double t_sameparam, t_batten;
extern void ChFi3d_SettraceDRAWINT(const bool b);
extern void ChFi3d_SettraceDRAWSPINE(const bool b);
#endif
//=================================================================================================
double ChFi3d_InPeriod(const double U, const double UFirst, const double ULast, const double Eps)
@@ -59,11 +59,6 @@ class Geom2dInt_GInter;
Standard_EXPORT bool ChFi3d_ComputeHatchingDomains(Geom2dHatch_Hatcher& theHatcher,
const int theHatchingIndex);
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
extern OSD_Chronometer simul, elspine, chemine;
#endif
double ChFi3d_InPeriod(const double U, const double UFirst, const double ULast, const double Eps);
void ChFi3d_Boite(const gp_Pnt2d& p1,
@@ -77,17 +77,6 @@
#include <TopOpeBRepDS_Surface.hxx>
#include <NCollection_List.hxx>
#include <cstdio>
#ifdef OCCT_DEBUG
extern bool ChFi3d_GettraceDRAWFIL();
extern bool ChFi3d_GettraceDRAWWALK();
extern bool ChFi3d_GetcontextNOOPT();
extern void ChFi3d_SettraceDRAWFIL(const bool b);
extern void ChFi3d_SettraceDRAWWALK(const bool b);
extern void ChFi3d_SetcontextNOOPT(const bool b);
#endif
//=================================================================================================
static int SearchIndex(const double Value, occ::handle<BRepBlend_Line>& Lin)
@@ -98,17 +98,6 @@
#include <TopOpeBRepDS_SurfaceCurveInterference.hxx>
#include <TopOpeBRepDS_Transition.hxx>
#ifdef OCCT_DEBUG
// Modified by Sergey KHROMOV - Thu Apr 11 12:23:40 2002 Begin
// The method
// ChFi3d_Builder::PerformMoreSurfdata(const int Index)
// is totally rewroted.
// Modified by Sergey KHROMOV - Thu Apr 11 12:23:40 2002 End
extern double t_same, t_inter, t_sameinter;
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
#endif
#include <Geom2dAPI_ProjectPointOnCurve.hxx>
#include <math_FunctionSample.hxx>
#include <IntRes2d_IntersectionSegment.hxx>
@@ -612,9 +601,6 @@ void ChFi3d_Builder::PerformOneCorner(const int Index, const bool thePrepareOnSa
{
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
#ifdef OCCT_DEBUG
OSD_Chronometer ch; // init perf for PerformSetOfKPart
#endif
// the top,
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
// The fillet is returned,
@@ -699,10 +685,6 @@ void ChFi3d_Builder::PerformOneCorner(const int Index, const bool thePrepareOnSa
Fop = TopoDS::Face(DStr.Shape(Fd->Index(IFopArc)));
TopExp_Explorer ex;
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf condition if (onsame)
#endif
if (onsame)
{
if (!CV1.IsOnArc() && !CV2.IsOnArc())
@@ -920,11 +902,6 @@ void ChFi3d_Builder::PerformOneCorner(const int Index, const bool thePrepareOnSa
Update(HBs, pced, HGs, Fd->ChangeInterferenceOnS2(), CV2, isfirst);
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_same); // result perf condition if (same)
ChFi3d_InitChron(ch); // init perf condition if (inters)
#endif
TopoDS_Edge edgecouture;
bool couture, intcouture = false;
double tolreached = tolapp3d;
@@ -1093,11 +1070,6 @@ void ChFi3d_Builder::PerformOneCorner(const int Index, const bool thePrepareOnSa
//
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_inter); // result perf condition if (inter)
ChFi3d_InitChron(ch); // init perf condition if (onsame && inters)
#endif
stripe->SetIndexPoint(ChFi3d_IndexPointInDS(CV1, DStr), isfirst, 1);
stripe->SetIndexPoint(ChFi3d_IndexPointInDS(CV2, DStr), isfirst, 2);
@@ -1676,10 +1648,6 @@ void ChFi3d_Builder::PerformOneCorner(const int Index, const bool thePrepareOnSa
{
ChFi3d_SetPointTolerance(DStr, box2, stripe->IndexPoint(isfirst, 2));
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_sameinter); // result perf condition if (same &&inter)
#endif
}
//=======================================================================
@@ -1865,10 +1833,6 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const int Index)
// - top has 3 edges and fillet on one of edges touches
// more than one face
#ifdef OCCT_DEBUG
OSD_Chronometer ch; // init perf
#endif
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
const int nn = 15;
NCollection_List<occ::handle<ChFiDS_Stripe>>::Iterator It;
@@ -4740,9 +4704,6 @@ void ChFi3d_Builder::IntersectMoreCorner(const int Index)
{
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
#ifdef OCCT_DEBUG
OSD_Chronometer ch; // init perf pour PerformSetOfKPart
#endif
// The fillet is returned,
NCollection_List<occ::handle<ChFiDS_Stripe>>::Iterator StrIt;
StrIt.Initialize(myVDataMap(Index));
@@ -4815,9 +4776,6 @@ void ChFi3d_Builder::IntersectMoreCorner(const int Index)
Fop = TopoDS::Face(DStr.Shape(Fd->Index(IFopArc)));
TopExp_Explorer ex;
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf condition
#endif
{
if (!CV1.IsOnArc() && !CV2.IsOnArc())
{
@@ -5017,10 +4975,6 @@ void ChFi3d_Builder::IntersectMoreCorner(const int Index)
pced->Initialize(CPadArc.Arc(), Fv);
Update(HBs, pced, HGs, FiadArc, CPadArc, isfirst);
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_same); // result perf condition if (same)
ChFi3d_InitChron(ch); // init perf condition if (inters)
#endif
TopoDS_Edge edgecouture;
bool couture, intcouture = false;
@@ -5186,11 +5140,6 @@ void ChFi3d_Builder::IntersectMoreCorner(const int Index)
//
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_inter); // result perf condition if (inter)
ChFi3d_InitChron(ch); // init perf condition if ( inters)
#endif
stripe->SetIndexPoint(ChFi3d_IndexPointInDS(CV1, DStr), isfirst, 1);
stripe->SetIndexPoint(ChFi3d_IndexPointInDS(CV2, DStr), isfirst, 2);
@@ -5469,8 +5418,4 @@ void ChFi3d_Builder::IntersectMoreCorner(const int Index)
{
ChFi3d_SetPointTolerance(DStr, box2, stripe->IndexPoint(isfirst, 2));
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_sameinter); // result perf condition if (same &&inter)
#endif
}
@@ -115,14 +115,6 @@
#include <NCollection_IndexedMap.hxx>
#include <ChFi3d.hxx>
// performances
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
extern double t_plate, t_approxplate, t_batten;
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
#endif
//=================================================================================================
static void Indices(const int n, const int ic, int& icplus, int& icmoins)
@@ -1236,12 +1228,9 @@ static TopAbs_Orientation PlateOrientation(
void ChFi3d_Builder::PerformMoreThreeCorner(const int Jndex, const int nconges)
{
// ========================================
// Initialisations
// ========================================
#ifdef OCCT_DEBUG
OSD_Chronometer ch;
#endif
// ========================================
// Initialisations
// ========================================
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
const TopoDS_Vertex& V1 = myVDataMap.FindKey(Jndex);
int nedge;
@@ -3088,9 +3077,6 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const int Jndex, const int nconges)
bool contraint1 = true, contraint2 = true;
if (raccordbatten)
{
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // initial performances for battens
#endif
bool inverseic, inverseicplus;
if (sharp.Value(ic))
{
@@ -3133,9 +3119,6 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const int Jndex, const int nconges)
inverseic,
inverseicplus,
pcurve);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_batten); // resulting performances for battens
#endif
}
// construction of borders for Plate
@@ -3487,21 +3470,10 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const int Jndex, const int nconges)
}
}
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init performances for plate
#endif
PSurf.Perform();
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_plate); // result performances for plate
#endif
// call of approx
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init performances for approxplate
#endif
if (PSurf.IsDone())
{
int nbcarreau = 9;
@@ -3522,10 +3494,6 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const int Jndex, const int nconges)
double coef = 1.1, apperror;
apperror = Mapp.CriterionError() * coef;
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_approxplate); // result performances for approxplate
#endif
// Storage of the surface plate and corresponding curves in the DS
TopAbs_Orientation orplate, orsurfdata, orpcurve, orien;
@@ -61,11 +61,6 @@
#include <algorithm>
#include <cmath>
#ifdef OCCT_DEBUG
extern bool ChFi3d_GettraceDRAWFIL();
extern void ChFi3d_CheckSurfData(const TopOpeBRepDS_DataStructure& DStr,
const occ::handle<ChFiDS_SurfData>& Data);
#endif
//=======================================================================
// function : CompTra
// purpose : Calculate the Transition from start point.
@@ -1646,14 +1641,5 @@ bool ChFi3d_Builder::SplitKPart(const occ::handle<ChFiDS_SurfData>&
SetData.Remove(i + 1, SetData.Length());
}
}
#ifdef OCCT_DEBUG
if (ChFi3d_GettraceDRAWFIL())
{
for (i = 1; i <= SetData.Length(); i++)
{
ChFi3d_CheckSurfData(DStr, SetData.Value(i));
}
}
#endif
return true;
}
@@ -54,10 +54,6 @@
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <memory>
#ifdef OCCT_DEBUG
extern bool ChFi3d_GettraceCHRON();
#endif
//=======================================================================
// function : SearchCommonFaces
// purpose : search the 2 common faces <F1> and <F2> of the edge <E>
@@ -575,15 +571,6 @@ void ChFi3d_ChBuilder::ResetContour(const int IC)
void ChFi3d_ChBuilder::Simulate(const int IC)
{
#ifdef OCCT_DEBUG
if (ChFi3d_GettraceCHRON())
{
simul.Reset();
elspine.Reset();
chemine.Reset();
simul.Start();
}
#endif
NCollection_List<occ::handle<ChFiDS_Stripe>>::Iterator itel;
int i = 1;
for (itel.Initialize(myListStripe); itel.More(); itel.Next(), i++)
@@ -594,18 +581,6 @@ void ChFi3d_ChBuilder::Simulate(const int IC)
break;
}
}
#ifdef OCCT_DEBUG
if (ChFi3d_GettraceCHRON())
{
simul.Stop();
std::cout << "Total simulation time : ";
simul.Show();
std::cout << "Spine construction time : ";
elspine.Show();
std::cout << "and progression time : ";
chemine.Show();
}
#endif
}
//---------------------------AJOUT---------------------------------------
@@ -1,361 +0,0 @@
// Created on: 1994-09-21
// Created by: Laurent BOURESCHE
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <cstdio>
#include <TopOpeBRepDS_DataStructure.hxx>
#include <ChFiDS_SurfData.hxx>
#include <TopOpeBRepDS_Surface.hxx>
#include <BRep_Builder.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Face.hxx>
#include <Geom_Surface.hxx>
#include <Geom2d_Line.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
OSD_Chronometer simul, elspine, chemine;
#endif
//*********************************
// timing of the simulation
//*********************************
static bool ChFi3d_traceCHRON = false;
void ChFi3d_SettraceCHRON(const bool b)
{
ChFi3d_traceCHRON = b;
}
bool ChFi3d_GettraceCHRON()
{
return ChFi3d_traceCHRON;
}
//*********************************
// trace a line of path
//*********************************
static bool ChFi3d_traceDRAWWALK = false;
void ChFi3d_SettraceDRAWWALK(const bool b)
{
ChFi3d_traceDRAWWALK = b;
}
bool ChFi3d_GettraceDRAWWALK()
{
return ChFi3d_traceDRAWWALK;
}
//**********************************
// trace a line of intersection
//**********************************
static bool ChFi3d_traceDRAWINT = false;
void ChFi3d_SettraceDRAWINT(const bool b)
{
ChFi3d_traceDRAWINT = b;
}
bool ChFi3d_GettraceDRAWINT()
{
return ChFi3d_traceDRAWINT;
}
//*************************************************
// return surfaces of approximated fillets.
//*************************************************
static bool ChFi3d_traceDRAWFIL = false;
void ChFi3d_SettraceDRAWFIL(const bool b)
{
ChFi3d_traceDRAWFIL = b;
}
bool ChFi3d_GettraceDRAWFIL()
{
return ChFi3d_traceDRAWFIL;
}
//*************************************************
// return extended faces for the path.
//*************************************************
static bool ChFi3d_traceDRAWENLARGE = false;
void ChFi3d_SettraceDRAWENLARGE(const bool b)
{
ChFi3d_traceDRAWENLARGE = b;
}
bool ChFi3d_GettraceDRAWENLARGE()
{
return ChFi3d_traceDRAWENLARGE;
}
//*************************************************
// return the guideline for the triple corners.
//*************************************************
static bool ChFi3d_traceDRAWSPINE = false;
void ChFi3d_SettraceDRAWSPINE(const bool b)
{
ChFi3d_traceDRAWSPINE = b;
}
bool ChFi3d_GettraceDRAWSPINE()
{
return ChFi3d_traceDRAWSPINE;
}
//*************************************************
// set the type of guideline for the triple corners.
//*************************************************
void ChFi3d_SetcontextSPINEBEZIER(const bool b);
void ChFi3d_SetcontextSPINECIRCLE(const bool b);
void ChFi3d_SetcontextSPINECE(const bool b);
static bool ChFi3d_contextSPINEBEZIER = false;
void ChFi3d_SetcontextSPINEBEZIER(const bool b)
{
ChFi3d_contextSPINEBEZIER = b;
if (b)
{
ChFi3d_SetcontextSPINECIRCLE(false);
ChFi3d_SetcontextSPINECE(false);
}
}
bool ChFi3d_GetcontextSPINEBEZIER()
{
return ChFi3d_contextSPINEBEZIER;
}
static bool ChFi3d_contextSPINECIRCLE = false;
void ChFi3d_SetcontextSPINECIRCLE(const bool b)
{
ChFi3d_contextSPINECIRCLE = b;
if (b)
{
ChFi3d_SetcontextSPINEBEZIER(false);
ChFi3d_SetcontextSPINECE(false);
}
}
bool ChFi3d_GetcontextSPINECIRCLE()
{
return ChFi3d_contextSPINECIRCLE;
}
static bool ChFi3d_contextSPINECE = false;
void ChFi3d_SetcontextSPINECE(const bool b)
{
ChFi3d_contextSPINECE = b;
if (b)
{
ChFi3d_SetcontextSPINEBEZIER(false);
ChFi3d_SetcontextSPINECIRCLE(false);
}
}
bool ChFi3d_GetcontextSPINECE()
{
return ChFi3d_contextSPINECE;
}
//*************************************************
// Forced passage by the path for KPart
//*************************************************
static bool ChFi3d_contextFORCEBLEND = false;
void ChFi3d_SetcontextFORCEBLEND(const bool b)
{
ChFi3d_contextFORCEBLEND = b;
}
bool ChFi3d_GetcontextFORCEBLEND()
{
return ChFi3d_contextFORCEBLEND;
}
static bool ChFi3d_contextFORCEFILLING = false;
void ChFi3d_SetcontextFORCEFILLING(const bool b)
{
ChFi3d_contextFORCEFILLING = b;
}
bool ChFi3d_GetcontextFORCEFILLING()
{
return ChFi3d_contextFORCEFILLING;
}
//*************************************************
// No optimization for approx
//*************************************************
static bool ChFi3d_contextNOOPT = false;
void ChFi3d_SetcontextNOOPT(const bool b)
{
ChFi3d_contextNOOPT = b;
}
bool ChFi3d_GetcontextNOOPT()
{
return ChFi3d_contextNOOPT;
}
#ifdef OCCT_DEBUG
// ***********************************************
// initialization and result of a chrono
//************************************************
Standard_EXPORT void ChFi3d_InitChron(OSD_Chronometer& ch)
{
ch.Reset();
ch.Start();
}
Standard_EXPORT void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time)
{
double tch;
ch.Stop();
ch.Show(tch);
time = time + tch;
}
#endif
//==============================================================
// function : ChFi3d_CheckSurfData
// purpose : function allows to trace SurfData to check
// construction of all elements, namely pcurves
//==============================================================
void ChFi3d_CheckSurfData(const TopOpeBRepDS_DataStructure& DStr,
const occ::handle<ChFiDS_SurfData>& Data)
{
// trace of the surface defined by the chamfer or the fillet
// corresponding to SurfData
occ::handle<Geom_Surface> surf = (DStr.Surface(Data->Surf())).Surface();
if (!surf.IsNull())
{
BRep_Builder B;
TopoDS_Face F;
B.MakeFace(F, surf, 0.);
TopoDS_Wire W;
B.MakeWire(W);
TopoDS_Vertex V1, V2, V3, V4;
B.MakeVertex(V1, Data->VertexFirstOnS1().Point(), 0.);
B.MakeVertex(V2, Data->VertexLastOnS1().Point(), 0.);
B.MakeVertex(V3, Data->VertexLastOnS2().Point(), 0.);
B.MakeVertex(V4, Data->VertexFirstOnS2().Point(), 0.);
TopoDS_Edge E1, E2, E3, E4;
B.MakeEdge(E1);
B.MakeEdge(E2);
B.MakeEdge(E3);
B.MakeEdge(E4);
B.UpdateEdge(E1, Data->InterferenceOnS1().PCurveOnSurf(), F, 0.);
B.UpdateEdge(E3, Data->InterferenceOnS2().PCurveOnSurf(), F, 0.);
V1.Orientation(TopAbs_FORWARD);
B.Add(E1, V1);
B.UpdateVertex(V1, Data->InterferenceOnS1().FirstParameter(), E1, 0.);
V2.Orientation(TopAbs_REVERSED);
B.Add(E1, V2);
B.UpdateVertex(V2, Data->InterferenceOnS1().LastParameter(), E1, 0.);
V4.Orientation(TopAbs_FORWARD);
B.Add(E3, V4);
B.UpdateVertex(V4, Data->InterferenceOnS2().FirstParameter(), E3, 0.);
V3.Orientation(TopAbs_REVERSED);
B.Add(E3, V3);
B.UpdateVertex(V3, Data->InterferenceOnS2().LastParameter(), E3, 0.);
gp_Pnt2d pp1, pp2, pp3, pp4;
pp1 = Data->InterferenceOnS1().PCurveOnSurf()->Value(Data->InterferenceOnS1().FirstParameter());
pp2 = Data->InterferenceOnS1().PCurveOnSurf()->Value(Data->InterferenceOnS1().LastParameter());
pp3 = Data->InterferenceOnS2().PCurveOnSurf()->Value(Data->InterferenceOnS2().LastParameter());
pp4 = Data->InterferenceOnS2().PCurveOnSurf()->Value(Data->InterferenceOnS2().FirstParameter());
gp_Dir2d d1(gp_Vec2d(pp1, pp4));
gp_Dir2d d2(gp_Vec2d(pp2, pp3));
occ::handle<Geom2d_Line> l1 = new Geom2d_Line(pp1, d1);
occ::handle<Geom2d_Line> l2 = new Geom2d_Line(pp2, d2);
B.UpdateEdge(E4, l1, F, 0.);
V1.Orientation(TopAbs_FORWARD);
B.Add(E4, V1);
B.UpdateVertex(V1, 0., E4, 0.);
V4.Orientation(TopAbs_REVERSED);
B.Add(E4, V4);
B.UpdateVertex(V4, pp4.Distance(pp1), E4, 0.);
B.UpdateEdge(E2, l2, F, 0.);
V2.Orientation(TopAbs_FORWARD);
B.Add(E2, V2);
B.UpdateVertex(V2, 0., E2, 0.);
V3.Orientation(TopAbs_REVERSED);
B.Add(E2, V3);
B.UpdateVertex(V3, pp3.Distance(pp2), E2, 0.);
gp_Pnt pw1, pw2, ppp;
ppp = surf->Value(pp1.X(), pp1.Y());
pw1 = surf->Value(0.9 * pp1.X() + 0.1 * pp2.X(), 0.9 * pp1.Y() + 0.1 * pp2.Y());
pw2 = surf->Value(0.9 * pp1.X() + 0.1 * pp4.X(), 0.9 * pp1.Y() + 0.1 * pp4.Y());
gp_Vec vv1(ppp, pw1);
gp_Vec vv2(ppp, pw2);
gp_Vec Vwire = vv1 ^ vv2;
surf->D1(pp1.X(), pp1.Y(), pw1, vv1, vv2);
gp_Vec Vsurf = vv1 ^ vv2;
bool rev = Vsurf.Dot(Vwire) <= 0.;
E1.Orientation(TopAbs_FORWARD);
E2.Orientation(TopAbs_FORWARD);
E3.Orientation(TopAbs_REVERSED);
E4.Orientation(TopAbs_REVERSED);
if (rev)
{
E1.Orientation(TopAbs_REVERSED);
E2.Orientation(TopAbs_REVERSED);
E3.Orientation(TopAbs_FORWARD);
E4.Orientation(TopAbs_FORWARD);
}
B.Add(W, E1);
B.Add(W, E2);
B.Add(W, E3);
B.Add(W, E4);
W.Orientation(TopAbs_FORWARD);
B.Add(F, W);
}
}
@@ -65,15 +65,6 @@
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopOpeBRepDS_Surface.hxx>
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
extern bool ChFi3d_GettraceCHRON();
extern double t_computedata, t_completedata;
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
#endif
static double MaxRad(const occ::handle<ChFiDS_FilSpine>& fsp,
const TopoDS_Edge& E)
@@ -401,15 +392,6 @@ void ChFi3d_FilBuilder::SetLaw(const int IC,
void ChFi3d_FilBuilder::Simulate(const int IC)
{
#ifdef OCCT_DEBUG
if (ChFi3d_GettraceCHRON())
{
simul.Reset();
elspine.Reset();
chemine.Reset();
simul.Start();
}
#endif
NCollection_List<occ::handle<ChFiDS_Stripe>>::Iterator itel;
int i = 1;
for (itel.Initialize(myListStripe); itel.More(); itel.Next(), i++)
@@ -420,18 +402,6 @@ void ChFi3d_FilBuilder::Simulate(const int IC)
break;
}
}
#ifdef OCCT_DEBUG
if (ChFi3d_GettraceCHRON())
{
simul.Stop();
std::cout << "Total simulation time : ";
simul.Show();
std::cout << "Spine construction time : ";
elspine.Show();
std::cout << "and process time : ";
chemine.Show();
}
#endif
}
//=================================================================================================
@@ -1557,9 +1527,6 @@ bool ChFi3d_FilBuilder::PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_Surf
int& intf,
int& intl)
{
#ifdef OCCT_DEBUG
OSD_Chronometer ch;
#endif
occ::handle<ChFiDS_SurfData> Data = SeqData(1);
occ::handle<ChFiDS_FilSpine> fsp = occ::down_cast<ChFiDS_FilSpine>(Spine);
if (fsp.IsNull())
@@ -1586,10 +1553,6 @@ bool ChFi3d_FilBuilder::PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_Surf
FInv.Set(fsp->Radius(), Choix);
Func.Set(myShape);
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf ComputeData
#endif
done = ComputeData(Data,
HGuide,
Spine,
@@ -1619,25 +1582,13 @@ bool ChFi3d_FilBuilder::PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_Surf
RecOnS1,
RecOnS2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_computedata); // result perf ComputeData
#endif
if (!done)
{
return false; // recovery is possible PMN 14/05/1998
}
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf CompleteData
#endif
done = CompleteData(Data, Func, lin, S1, S2, Or, gd1, gd2, gf1, gf2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_completedata); // result perf CompleteData
#endif
if (!done)
{
throw Standard_Failure("PerformSurf : Failed approximation!");
@@ -1652,10 +1603,6 @@ bool ChFi3d_FilBuilder::PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_Surf
FInv.Set(Choix);
Func.Set(myShape);
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf ComputeData
#endif
done = ComputeData(Data,
HGuide,
Spine,
@@ -1684,25 +1631,14 @@ bool ChFi3d_FilBuilder::PerformSurf(NCollection_Sequence<occ::handle<ChFiDS_Surf
gf2,
RecOnS1,
RecOnS2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_computedata); // result perf ComputeData
#endif
if (!done)
{
return false;
}
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf CompleteData
#endif
done = CompleteData(Data, Func, lin, S1, S2, Or, gd1, gd2, gf1, gf2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_completedata); // result perf CompleteData
#endif
if (!done)
{
throw Standard_Failure("PerformSurf : Failed approximation!");
@@ -64,18 +64,6 @@
#include <TopOpeBRepDS_DataStructure.hxx>
#include <TopOpeBRepDS_HDataStructure.hxx>
#ifdef OCCT_DEBUG
#include <Geom_TrimmedCurve.hxx>
extern bool ChFi3d_GettraceDRAWSPINE();
extern bool ChFi3d_GetcontextFORCEFILLING();
#include <OSD_Chronometer.hxx>
extern double t_t2cornerinit, t_perf2cornerbyinter, t_chfikpartcompdata, t_cheminement,
t_remplissage, t_t2cornerDS;
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
#endif
//=======================================================================
// function : ToricRotule
// purpose : Test if it is a particular case of torus routine.
@@ -142,10 +130,6 @@ static void RemoveSD(occ::handle<ChFiDS_Stripe>& Stripe, const int num1, const i
void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
{
#ifdef OCCT_DEBUG
OSD_Chronometer ch;
ChFi3d_InitChron(ch); // init perf initialisation
#endif
done = false;
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Index);
@@ -451,10 +435,6 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
}
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_t2cornerinit); // result perf initialisation
#endif
// bevel
//------
ChFiDS_CommonPoint cp11, cp12, cp21, cp22;
@@ -462,16 +442,9 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
if (c1biseau)
{
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
#endif
done = PerformTwoCornerbyInter(Index);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_perf2cornerbyinter); // result perf PerformTwoCornerbyInter
#endif
if (!done)
{
PerformMoreThreeCorner(Index, 2);
@@ -489,15 +462,9 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
intf12 = sd1->InterferenceOnS2();
intf21 = sd2->InterferenceOnS1();
intf22 = sd2->InterferenceOnS2();
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf PerformTwoCornerbyInter
#endif
done = PerformTwoCornerbyInter(Index);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_perf2cornerbyinter); // result perf PerformTwoCornerbyInter
#endif
if (!done)
{
// restore
@@ -543,11 +510,8 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
{
bid = ChFi3d::ConcaveSide(BRS1, BRS2, pivot, op1, op2);
}
op1 = TopAbs::Reverse(op1);
op2 = TopAbs::Reverse(op2);
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf ChFiKPart_ComputeData
#endif
op1 = TopAbs::Reverse(op1);
op2 = TopAbs::Reverse(op2);
double radius = occ::down_cast<ChFiDS_FilSpine>(st1->Spine())->Radius();
done = ChFiKPart_ComputeData::ComputeCorner(DStr,
coin,
@@ -559,9 +523,6 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
op1,
op2,
radius);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_chfikpartcompdata); // result perf ChFiKPart_ComputeData
#endif
}
else
{
@@ -579,9 +540,6 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
p2da2 = sd2->Interference(IFaArc2).PCurveOnSurf()->Value(uPCArc2);
p2df2 = sd2->Interference(IFaCo2).PCurveOnSurf()->Value(uPCArc2);
sd2->Interference(IFaCo2).PCurveOnFace()->D1(uPCArc2, p2dfac2, v2dfac2);
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf filling
#endif
B1 = ChFi3d_mkbound(surf1, p2df1, p2da1, tolapp3d, 2.e-4);
B2 = ChFi3d_mkbound(surf2, p2df2, p2da2, tolapp3d, 2.e-4);
occ::handle<Geom2d_Curve> PCurveOnFace;
@@ -676,13 +634,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
false,
false,
false);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_remplissage); // result perf filling
#endif
}
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf update DS
#endif
if (done)
{
// Update 3 CornerData and the DS
@@ -854,9 +806,6 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
st2->SetOrientation(TopAbs_REVERSED, isfirst2);
}
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_t2cornerDS); // result perf update DS
#endif
}
else
{
@@ -926,9 +875,6 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
throw Standard_Failure("TwoCorner : No common face to loop the contour");
}
}
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf filling
#endif
occ::handle<GeomFill_Boundary> Bsam, Bdif, Bfac;
gp_Pnt2d ppopsam = sdsam->Interference(ifaopsam).PCurveOnSurf()->Value(uintpcsam);
gp_Pnt2d ppcosam = sdsam->Interference(ifacosam).PCurveOnSurf()->Value(uintpcsam);
@@ -995,16 +941,10 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
false,
false,
false);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_remplissage); // result perf filling
#endif
if (!done)
{
throw Standard_Failure("concavites inverted : fail");
}
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf update DS
#endif
// Update 3 CornerData and the DS
// ----------------------------------------
// the corner to start,
@@ -1138,9 +1078,6 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const int Index)
{
stdif->SetOrientation(TopAbs_REVERSED, isfirstdif);
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_t2cornerDS); // result perf update DS
#endif
}
if (!myEVIMap.IsBound(Vtx))
{
@@ -59,20 +59,6 @@
#include <TopOpeBRepDS_HDataStructure.hxx>
#include <TopOpeBRepDS_Surface.hxx>
#ifdef OCCT_DEBUG
#include <Geom_TrimmedCurve.hxx>
extern bool ChFi3d_GettraceDRAWSPINE();
extern bool ChFi3d_GetcontextSPINEBEZIER();
extern bool ChFi3d_GetcontextSPINECIRCLE();
extern bool ChFi3d_GetcontextSPINECE();
extern bool ChFi3d_GetcontextFORCEFILLING();
#include <OSD_Chronometer.hxx>
extern double t_t3cornerinit, t_spherique, t_torique, t_notfilling, t_filling, t_t3cornerDS;
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
#endif
//=================================================================================================
static int SearchPivot(int* s, double u[3][3], const double t)
@@ -241,11 +227,6 @@ static bool ToricCorner(const TopoDS_Face& F, const double rd, const double rf,
void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
{
#ifdef OCCT_DEBUG
OSD_Chronometer ch;
ChFi3d_InitChron(ch); // init perf initialisation
#endif
TopOpeBRepDS_DataStructure& DStr = myDS->ChangeDS();
const TopoDS_Vertex& Vtx = myVDataMap.FindKey(Jndex);
NCollection_List<occ::handle<ChFiDS_Stripe>>::Iterator It;
@@ -673,22 +654,10 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
->Value(p[pivot][fin]);
done = false;
#ifdef OCCT_DEBUG
if (ChFi3d_GetcontextFORCEFILLING())
c1spheric = c1toric = 0;
#endif
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_t3cornerinit); // result perf initialisations
#endif
if (c1toric)
{
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf case torus
#endif
// Direct Construction.
// ---------------------
done = ChFiKPart_ComputeData::ComputeCorner(DStr,
@@ -705,18 +674,10 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
pfac2,
psurf1,
psurf2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_torique); // result perf case torus
#endif
}
else if (c1spheric)
{
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf case sphere
#endif
done = ChFiKPart_ComputeData::ComputeCorner(DStr,
coin,
Fac,
@@ -729,10 +690,6 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
pfac1,
psurf1,
psurf2);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_spherique); // result perf cas sphere
#endif
}
else if (c1pointu)
{
@@ -743,10 +700,6 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
if (!filling)
{
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf not filling
#endif
// Calculate a guideline,
//------------------------------
// Numerous problems with loops and half-turns connected to
@@ -834,10 +787,6 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
Gf2,
false,
true);
#ifdef OCCT_DEBUG
if (ChFi3d_GetcontextFORCEFILLING())
done = 0;
#endif
if (done && Gf2)
{
done = CompleteData(coin, func, lin, Fac, Surf, OFac, Gd1, false, Gf1, false);
@@ -887,10 +836,6 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
Gf2,
false,
true);
#ifdef OCCT_DEBUG
if (ChFi3d_GetcontextFORCEFILLING())
done = 0;
#endif
if (done && Gf2)
{
done = CompleteData(coin, func, lin, Fac, Surf, OFac, Gd1, false, Gf1, false);
@@ -901,19 +846,11 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
filling = true;
}
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_notfilling); // result perf not filling
#endif
}
if (filling)
{
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf filling
#endif
// the contour to be fillet consists of straight lines uv in beginning and end
// of two pcurves (only one if c1pointu) calculated as possible
// on piv and the opposite face.
@@ -1008,10 +945,6 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
false,
false,
false);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_filling); // result perf filling
#endif
}
}
double P1deb, P2deb, P1fin, P2fin;
@@ -1026,10 +959,6 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
// Update of 4 Stripes and the DS
// -------------------------------------
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch); // init perf update DS
#endif
gp_Pnt2d pp1, pp2;
double parpp1, parpp2;
int If1, If2, Il1, Il2, Icf, Icl;
@@ -1324,8 +1253,4 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const int Jndex)
myEVIMap.ChangeFind(Vtx).Append(coin->Surf());
corner->SetSolidIndex(CD[pivot]->SolidIndex());
myListStripe.Append(corner);
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_t3cornerDS); // result perf update DS
#endif
}
@@ -20,7 +20,6 @@ set(OCCT_ChFi3d_FILES
ChFi3d_ChBuilder.hxx
ChFi3d_ChBuilder_C2.cxx
ChFi3d_ChBuilder_C3.cxx
ChFi3d_Debug.cxx
ChFi3d_FilBuilder.cxx
ChFi3d_FilBuilder.hxx
ChFi3d_FilBuilder_C2.cxx
@@ -78,20 +78,9 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#ifdef OCCT_DEBUG
#include <OSD_Chronometer.hxx>
#endif
#include <cstdio>
// include - all hxx,
// - all small static functions.
//======================== START STATIC FUNCTIONS ============
// variables for performance
double t_mkcurve;
#ifdef OCCT_DEBUG
extern void ChFi3d_InitChron(OSD_Chronometer& ch);
extern void ChFi3d_ResultChron(OSD_Chronometer& ch, double& time);
#endif
//=================================================================================================
@@ -415,11 +404,6 @@ occ::handle<Geom_Curve> MakeCurve(const BiTgte_CurveOnEdge& HC)
{
occ::handle<Geom_Curve> C;
#ifdef OCCT_DEBUG
OSD_Chronometer ch;
ChFi3d_InitChron(ch);
#endif
if (HC.GetType() == GeomAbs_Circle)
{
C = new Geom_Circle(HC.Circle());
@@ -462,10 +446,6 @@ occ::handle<Geom_Curve> MakeCurve(const BiTgte_CurveOnEdge& HC)
C = new Geom_BSplineCurve(NewPoles, NewKnots, NewMults, Conv.Degree());
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_mkcurve);
#endif
return C;
}
@@ -848,18 +828,6 @@ void BiTgte_Blend::Perform(const bool BuildShape)
myShape = SewedShape;
// end Sewing for false free borders.
#ifdef OCCT_DEBUG
OSD_Chronometer cl_total, ch;
double t_total, t_center, t_surface, t_shape;
t_total = 0;
t_center = 0;
t_surface = 0;
t_mkcurve = 0;
t_shape = 0;
ChFi3d_InitChron(cl_total);
#endif
// ----------------------------------------------------------------
// place faces with the proper orientation in the initial shape
// ----------------------------------------------------------------
@@ -882,60 +850,28 @@ void BiTgte_Blend::Perform(const bool BuildShape)
// ----------------------------------------------
// Calculate lines of centers and of surfaces
// ----------------------------------------------
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch);
#endif
ComputeCenters();
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_center);
#endif
// -----------------------------
// Calculate connection Surfaces
// -----------------------------
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch);
#endif
ComputeSurfaces();
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_surface);
#endif
// ----------------------------------
// Calculate the generated shape if required
// ----------------------------------
#ifdef OCCT_DEBUG
ChFi3d_InitChron(ch);
#endif
if (myBuildShape)
{
ComputeShape();
}
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(ch, t_shape);
#endif
// Finally construct curves 3d from edges to be transferred
// since the partition is provided ( A Priori);
BRepLib::BuildCurves3d(myResult, Precision::Confusion());
#ifdef OCCT_DEBUG
ChFi3d_ResultChron(cl_total, t_total);
std::cout << std::endl;
std::cout << "Blend_PERFORM: temps total " << t_total << " s dont :" << std::endl;
std::cout << "- ComputeCenters " << t_center << " s" << std::endl;
std::cout << "- ComputeSurfaces " << t_surface << " s" << std::endl;
std::cout << "----> MakeCurve " << t_mkcurve << " s" << std::endl;
if (myBuildShape)
std::cout << "- ComputeShape " << t_shape << " s" << std::endl;
#endif
myDone = true;
}