1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029719: Modeling Algorithms - GeomPlate_BuildPlateSurface has no progress information and is not abortable

The Message_ProgressIndicator handle is added as a parameter to the function LU_Decompose and the the member functions of math_Gauss, Plate_Plate and GeomPlate_BuildPlateSurface classes.
This commit is contained in:
drazmyslovich
2018-04-23 17:52:43 +03:00
committed by bugmaster
parent 25c35042b6
commit 9f785738a1
8 changed files with 104 additions and 37 deletions

View File

@@ -28,7 +28,8 @@
#include <StdFail_NotDone.hxx>
math_Gauss::math_Gauss(const math_Matrix& A,
const Standard_Real MinPivot)
const Standard_Real MinPivot,
const Handle(Message_ProgressIndicator) & aProgress)
: LU (1, A.RowNumber(), 1, A.ColNumber()),
Index(1, A.RowNumber()) {
@@ -37,7 +38,8 @@ math_Gauss::math_Gauss(const math_Matrix& A,
Standard_Integer Error = LU_Decompose(LU,
Index,
D,
MinPivot);
MinPivot,
aProgress);
if(!Error) {
Done = Standard_True;
}

View File

@@ -27,10 +27,12 @@
#include <Standard_Real.hxx>
#include <math_Vector.hxx>
#include <Standard_OStream.hxx>
class math_NotSquare;
class Standard_DimensionError;
class StdFail_NotDone;
class math_Matrix;
class Message_ProgressIndicator;
@@ -55,7 +57,9 @@ public:
//! If the largest pivot found is less than MinPivot the matrix A is
//! considered as singular.
//! Exception NotSquare is raised if A is not a square matrix.
Standard_EXPORT math_Gauss(const math_Matrix& A, const Standard_Real MinPivot = 1.0e-20);
Standard_EXPORT math_Gauss(const math_Matrix& A,
const Standard_Real MinPivot = 1.0e-20,
const Handle(Message_ProgressIndicator) & aProgress = Handle(Message_ProgressIndicator)());
//! Returns true if the computations are successful, otherwise returns false
Standard_Boolean IsDone() const;

View File

@@ -33,6 +33,7 @@
#include <Standard_Failure.hxx>
#include <Standard_NotImplemented.hxx>
#include <Message_ProgressSentry.hxx>
#include <math_Vector.hxx>
#include <math_IntegerVector.hxx>
@@ -175,7 +176,8 @@ Standard_Integer LU_Decompose(math_Matrix& a,
math_IntegerVector& indx,
Standard_Real& d,
math_Vector& vv,
Standard_Real TINY) {
Standard_Real TINY,
const Handle(Message_ProgressIndicator) & aProgress) {
Standard_Integer i, imax=0, j, k;
Standard_Real big, dum, sum, temp;
@@ -183,6 +185,8 @@ Standard_Integer LU_Decompose(math_Matrix& a,
Standard_Integer n = a.RowNumber();
d = 1.0;
Message_ProgressSentry aPSentry(aProgress, "", 0, n, 1);
for(i = 1; i <= n; i++) {
big = 0.0;
for (j = 1; j <= n; j++)
@@ -192,7 +196,8 @@ Standard_Integer LU_Decompose(math_Matrix& a,
}
vv(i) = 1.0 / big;
}
for(j = 1; j <= n; j++) {
for(j = 1; j <= n && aPSentry.More(); j++, aPSentry.Next()) {
for(i = 1; i < j; i++) {
sum = a(i,j);
for(k = 1; k < i; k++)
@@ -232,16 +237,23 @@ Standard_Integer LU_Decompose(math_Matrix& a,
a(i,j) *= dum;
}
}
if (j <= n)
{
return math_Status_UserAborted;
}
return math_Status_OK;
}
Standard_Integer LU_Decompose(math_Matrix& a,
math_IntegerVector& indx,
Standard_Real& d,
Standard_Real TINY) {
Standard_Real TINY,
const Handle(Message_ProgressIndicator) & aProgress) {
math_Vector vv(1, a.RowNumber());
return LU_Decompose(a, indx, d, vv, TINY);
return LU_Decompose(a, indx, d, vv, TINY, aProgress);
}
void LU_Solve(const math_Matrix& a,

View File

@@ -18,12 +18,14 @@
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Real.hxx>
#include <Standard_Handle.hxx>
class math_IntegerVector;
class math_Vector;
class math_Matrix;
class Message_ProgressIndicator;
const Standard_Integer math_Status_UserAborted = -1;
const Standard_Integer math_Status_OK = 0;
const Standard_Integer math_Status_SingularMatrix = 1;
const Standard_Integer math_Status_ArgumentError = 2;
@@ -32,7 +34,8 @@ const Standard_Integer math_Status_NoConvergence = 3;
Standard_EXPORT Standard_Integer LU_Decompose(math_Matrix& a,
math_IntegerVector& indx,
Standard_Real& d,
Standard_Real TINY = 1.0e-20);
Standard_Real TINY = 1.0e-20,
const Handle(Message_ProgressIndicator) & aProgress = Handle(Message_ProgressIndicator)());
// Given a matrix a(1..n, 1..n), this routine computes its LU decomposition,
// The matrix a is replaced by this LU decomposition and the vector indx(1..n)
@@ -44,7 +47,8 @@ Standard_EXPORT Standard_Integer LU_Decompose(math_Matrix& a,
math_IntegerVector& indx,
Standard_Real& d,
math_Vector& vv,
Standard_Real TINY = 1.0e-30);
Standard_Real TINY = 1.0e-30,
const Handle(Message_ProgressIndicator) & aProgress = Handle(Message_ProgressIndicator)());
// Idem to the previous LU_Decompose function. But the input Vector vv(1..n) is
// used internally as a scratch area.