mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0031190: Modeling Algorithms - progress indication in GeomPlate is inconsistent
Added ability to display progress indicator in plate commands Added tests
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include <GeometryTest.hxx>
|
||||
#include <Draw_Interpretor.hxx>
|
||||
#include <Draw_Appli.hxx>
|
||||
#include <Draw_ProgressIndicator.hxx>
|
||||
#include <DrawTrSurf.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
@@ -167,8 +168,13 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
NbPtsCur->Value(i));
|
||||
Henri.Add(Cont);
|
||||
}
|
||||
|
||||
Henri.Perform();
|
||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||
Henri.Perform(aProgress->Start());
|
||||
if (aProgress->UserBreak())
|
||||
{
|
||||
di << "Error: UserBreak\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Real ErrG0 = 1.1*Henri.G0Error();
|
||||
//std::cout<<" dist. max = "<<Henri.G0Error()<<" ; angle max = "<<Henri.G1Error()<<std::endl;
|
||||
@@ -217,7 +223,7 @@ static Standard_Integer plate (Draw_Interpretor & di,Standard_Integer n,const ch
|
||||
// commande gplate : resultat face egale a la surface approchee
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const char** a)
|
||||
static Standard_Integer gplate (Draw_Interpretor & di,Standard_Integer n,const char** a)
|
||||
{
|
||||
if (n < 6 ) return 1;
|
||||
Standard_Integer NbCurFront=Draw::Atoi(a[2]),
|
||||
@@ -298,7 +304,13 @@ static Standard_Integer gplate (Draw_Interpretor & ,Standard_Integer n,const cha
|
||||
Henri.Add(PCont);
|
||||
}
|
||||
}
|
||||
Henri.Perform();
|
||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||
Henri.Perform(aProgress->Start());
|
||||
if (aProgress->UserBreak())
|
||||
{
|
||||
di << "Error: UserBreak\n";
|
||||
return 0;
|
||||
}
|
||||
Standard_Integer nbcarreau=9;
|
||||
Standard_Integer degmax=8;
|
||||
Standard_Real seuil;
|
||||
@@ -368,7 +380,13 @@ static Standard_Integer approxplate (Draw_Interpretor & di,Standard_Integer n,co
|
||||
Henri.Add(Cont);
|
||||
}
|
||||
|
||||
Henri.Perform();
|
||||
Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
|
||||
Henri.Perform(aProgress->Start());
|
||||
if (aProgress->UserBreak())
|
||||
{
|
||||
di << "Error: UserBreak\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Standard_Real dmax = Henri.G0Error(),
|
||||
anmax = Henri.G1Error();
|
||||
|
@@ -470,7 +470,7 @@ void GeomPlate_BuildPlateSurface::Perform(const Message_ProgressRange& theProgre
|
||||
//======================================================================
|
||||
// Initial Surface
|
||||
//======================================================================
|
||||
Message_ProgressScope aPS(theProgress, NULL, 100, Standard_True);
|
||||
Message_ProgressScope aPS(theProgress, "Calculating the surface filled", 100, Standard_True);
|
||||
if (!mySurfInitIsGive)
|
||||
{
|
||||
ComputeSurfInit (aPS.Next(10));
|
||||
@@ -1716,7 +1716,8 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit(const Message_ProgressRange& t
|
||||
//====================================================================
|
||||
// Construction of the surface
|
||||
//====================================================================
|
||||
myPlate.SolveTI(2, ComputeAnisotropie(), theProgress);
|
||||
Message_ProgressScope aPS(theProgress, "ComputeSurfInit", 1);
|
||||
myPlate.SolveTI(2, ComputeAnisotropie(), aPS.Next());
|
||||
if (theProgress.UserBreak())
|
||||
{
|
||||
return;
|
||||
|
@@ -345,7 +345,7 @@ void Plate_Plate::SolveTI1(const Standard_Integer IterationNumber,
|
||||
Standard_Real pivot_max = 1.e-12;
|
||||
OK = Standard_True;
|
||||
|
||||
Message_ProgressScope aScope (theProgress, NULL, 10);
|
||||
Message_ProgressScope aScope (theProgress, "Plate_Plate::SolveTI1()", 10);
|
||||
math_Gauss algo_gauss(mat,pivot_max, aScope.Next (7));
|
||||
|
||||
if (aScope.UserBreak())
|
||||
@@ -459,7 +459,7 @@ void Plate_Plate::SolveTI2(const Standard_Integer IterationNumber,
|
||||
Standard_Real pivot_max = 1.e-12;
|
||||
OK = Standard_True; // ************ JHH
|
||||
|
||||
Message_ProgressScope aScope (theProgress, NULL, 10);
|
||||
Message_ProgressScope aScope (theProgress, "Plate_Plate::SolveTI2()", 10);
|
||||
math_Gauss algo_gauss(mat,pivot_max, aScope.Next (7));
|
||||
|
||||
if (aScope.UserBreak())
|
||||
@@ -733,7 +733,7 @@ void Plate_Plate::SolveTI3(const Standard_Integer IterationNumber,
|
||||
Standard_Real pivot_max = 1.e-12;
|
||||
OK = Standard_True; // ************ JHH
|
||||
|
||||
Message_ProgressScope aScope (theProgress, NULL, 10);
|
||||
Message_ProgressScope aScope (theProgress, "Plate_Plate::SolveTI3()", 10);
|
||||
math_Gauss algo_gauss(mat,pivot_max, aScope.Next (7));
|
||||
|
||||
if (aScope.UserBreak())
|
||||
|
@@ -185,7 +185,7 @@ Standard_Integer LU_Decompose(math_Matrix& a,
|
||||
Standard_Integer n = a.RowNumber();
|
||||
d = 1.0;
|
||||
|
||||
Message_ProgressScope aPS(theProgress, "", n);
|
||||
Message_ProgressScope aPS(theProgress, "math_Gauss LU_Decompose", n);
|
||||
|
||||
for(i = 1; i <= n; i++) {
|
||||
big = 0.0;
|
||||
|
Reference in New Issue
Block a user