mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0024211: Definition of Basic Runtime Check parameter causes regression in debug mode
Out of ChoixRef array boundaries. Uninitialized variable in IntCurve_IntPolyPolyGen::findIntersect(...) function. Handling of infinity numbers in sprops command is added. test (CPU-limit)
This commit is contained in:
parent
1c9cffdb4b
commit
c63628e845
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@
|
|||||||
#include <IntImp_ConstIsoparametric.hxx>
|
#include <IntImp_ConstIsoparametric.hxx>
|
||||||
#include <Standard_ConstructionError.hxx>
|
#include <Standard_ConstructionError.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
|
|
||||||
//Standard_IMPORT extern IntImp_ConstIsoparametric *ChoixRef;
|
//Standard_IMPORT extern IntImp_ConstIsoparametric *ChoixRef;
|
||||||
|
|
||||||
@ -41,72 +41,72 @@ IntImp_Int2S::IntImp_Int2S() {
|
|||||||
|
|
||||||
|
|
||||||
IntImp_Int2S::IntImp_Int2S(const ThePSurface& surf1,
|
IntImp_Int2S::IntImp_Int2S(const ThePSurface& surf1,
|
||||||
const ThePSurface& surf2,
|
const ThePSurface& surf2,
|
||||||
const Standard_Real TolTangency ) :
|
const Standard_Real TolTangency ) :
|
||||||
done(Standard_True),
|
done(Standard_True),
|
||||||
empty(Standard_True),
|
empty(Standard_True),
|
||||||
myZerParFunc(surf1,surf2),
|
myZerParFunc(surf1,surf2),
|
||||||
tol(TolTangency*TolTangency)
|
tol(TolTangency*TolTangency)
|
||||||
{
|
{
|
||||||
ua0 = ThePSurfaceTool::FirstUParameter(surf1); //-- ThePSurfaceTool::UIntervalFirst(surf1);
|
ua0 = ThePSurfaceTool::FirstUParameter(surf1); //-- ThePSurfaceTool::UIntervalFirst(surf1);
|
||||||
va0 = ThePSurfaceTool::FirstVParameter(surf1); //-- ThePSurfaceTool::VIntervalFirst(surf1);
|
va0 = ThePSurfaceTool::FirstVParameter(surf1); //-- ThePSurfaceTool::VIntervalFirst(surf1);
|
||||||
ua1 = ThePSurfaceTool::LastUParameter(surf1); //-- ThePSurfaceTool::UIntervalLast(surf1);
|
ua1 = ThePSurfaceTool::LastUParameter(surf1); //-- ThePSurfaceTool::UIntervalLast(surf1);
|
||||||
va1 = ThePSurfaceTool::LastVParameter(surf1); //-- ThePSurfaceTool::VIntervalLast(surf1);
|
va1 = ThePSurfaceTool::LastVParameter(surf1); //-- ThePSurfaceTool::VIntervalLast(surf1);
|
||||||
|
|
||||||
ub0 = ThePSurfaceTool::FirstUParameter(surf2); //-- ThePSurfaceTool::UIntervalFirst(surf2);
|
ub0 = ThePSurfaceTool::FirstUParameter(surf2); //-- ThePSurfaceTool::UIntervalFirst(surf2);
|
||||||
vb0 = ThePSurfaceTool::FirstVParameter(surf2); //-- ThePSurfaceTool::VIntervalFirst(surf2);
|
vb0 = ThePSurfaceTool::FirstVParameter(surf2); //-- ThePSurfaceTool::VIntervalFirst(surf2);
|
||||||
ub1 = ThePSurfaceTool::LastUParameter(surf2); //-- ThePSurfaceTool::UIntervalLast(surf2);
|
ub1 = ThePSurfaceTool::LastUParameter(surf2); //-- ThePSurfaceTool::UIntervalLast(surf2);
|
||||||
vb1 = ThePSurfaceTool::LastVParameter(surf2); //-- ThePSurfaceTool::VIntervalLast(surf2);
|
vb1 = ThePSurfaceTool::LastVParameter(surf2); //-- ThePSurfaceTool::VIntervalLast(surf2);
|
||||||
|
|
||||||
ures1 = ThePSurfaceTool::UResolution(surf1,Precision::Confusion());
|
ures1 = ThePSurfaceTool::UResolution(surf1,Precision::Confusion());
|
||||||
vres1 = ThePSurfaceTool::VResolution(surf1,Precision::Confusion());
|
vres1 = ThePSurfaceTool::VResolution(surf1,Precision::Confusion());
|
||||||
|
|
||||||
ures2 = ThePSurfaceTool::UResolution(surf2,Precision::Confusion());
|
ures2 = ThePSurfaceTool::UResolution(surf2,Precision::Confusion());
|
||||||
vres2 = ThePSurfaceTool::VResolution(surf2,Precision::Confusion());
|
vres2 = ThePSurfaceTool::VResolution(surf2,Precision::Confusion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
IntImp_Int2S::IntImp_Int2S(const TColStd_Array1OfReal& Param,
|
IntImp_Int2S::IntImp_Int2S(const TColStd_Array1OfReal& Param,
|
||||||
const ThePSurface& surf1,
|
const ThePSurface& surf1,
|
||||||
const ThePSurface& surf2,
|
const ThePSurface& surf2,
|
||||||
const Standard_Real TolTangency ) :
|
const Standard_Real TolTangency ) :
|
||||||
done(Standard_True),
|
done(Standard_True),
|
||||||
empty(Standard_True),
|
empty(Standard_True),
|
||||||
myZerParFunc(surf1,surf2),
|
myZerParFunc(surf1,surf2),
|
||||||
tol(TolTangency*TolTangency)
|
tol(TolTangency*TolTangency)
|
||||||
{
|
{
|
||||||
math_FunctionSetRoot Rsnld(myZerParFunc,15); //-- Modif lbr 18 MAI ?????????????
|
math_FunctionSetRoot Rsnld(myZerParFunc,15); //-- Modif lbr 18 MAI ?????????????
|
||||||
ua0 = ThePSurfaceTool::FirstUParameter(surf1); //-- ThePSurfaceTool::UIntervalFirst(surf1);
|
ua0 = ThePSurfaceTool::FirstUParameter(surf1); //-- ThePSurfaceTool::UIntervalFirst(surf1);
|
||||||
va0 = ThePSurfaceTool::FirstVParameter(surf1); //-- ThePSurfaceTool::VIntervalFirst(surf1);
|
va0 = ThePSurfaceTool::FirstVParameter(surf1); //-- ThePSurfaceTool::VIntervalFirst(surf1);
|
||||||
ua1 = ThePSurfaceTool::LastUParameter(surf1); //-- ThePSurfaceTool::UIntervalLast(surf1);
|
ua1 = ThePSurfaceTool::LastUParameter(surf1); //-- ThePSurfaceTool::UIntervalLast(surf1);
|
||||||
va1 = ThePSurfaceTool::LastVParameter(surf1); //-- ThePSurfaceTool::VIntervalLast(surf1);
|
va1 = ThePSurfaceTool::LastVParameter(surf1); //-- ThePSurfaceTool::VIntervalLast(surf1);
|
||||||
|
|
||||||
ub0 = ThePSurfaceTool::FirstUParameter(surf2); //-- ThePSurfaceTool::UIntervalFirst(surf2);
|
ub0 = ThePSurfaceTool::FirstUParameter(surf2); //-- ThePSurfaceTool::UIntervalFirst(surf2);
|
||||||
vb0 = ThePSurfaceTool::FirstVParameter(surf2); //-- ThePSurfaceTool::VIntervalFirst(surf2);
|
vb0 = ThePSurfaceTool::FirstVParameter(surf2); //-- ThePSurfaceTool::VIntervalFirst(surf2);
|
||||||
ub1 = ThePSurfaceTool::LastUParameter(surf2); //-- ThePSurfaceTool::UIntervalLast(surf2);
|
ub1 = ThePSurfaceTool::LastUParameter(surf2); //-- ThePSurfaceTool::UIntervalLast(surf2);
|
||||||
vb1 = ThePSurfaceTool::LastVParameter(surf2); //-- ThePSurfaceTool::VIntervalLast(surf2);
|
vb1 = ThePSurfaceTool::LastVParameter(surf2); //-- ThePSurfaceTool::VIntervalLast(surf2);
|
||||||
|
|
||||||
ures1 = ThePSurfaceTool::UResolution(surf1,Precision::Confusion());
|
ures1 = ThePSurfaceTool::UResolution(surf1,Precision::Confusion());
|
||||||
vres1 = ThePSurfaceTool::VResolution(surf1,Precision::Confusion());
|
vres1 = ThePSurfaceTool::VResolution(surf1,Precision::Confusion());
|
||||||
|
|
||||||
ures2 = ThePSurfaceTool::UResolution(surf2,Precision::Confusion());
|
ures2 = ThePSurfaceTool::UResolution(surf2,Precision::Confusion());
|
||||||
vres2 = ThePSurfaceTool::VResolution(surf2,Precision::Confusion());
|
vres2 = ThePSurfaceTool::VResolution(surf2,Precision::Confusion());
|
||||||
Perform(Param,Rsnld);
|
Perform(Param,Rsnld);
|
||||||
}
|
}
|
||||||
|
|
||||||
IntImp_ConstIsoparametric IntImp_Int2S::
|
IntImp_ConstIsoparametric IntImp_Int2S:: Perform(const TColStd_Array1OfReal& Param,
|
||||||
Perform(const TColStd_Array1OfReal& Param,
|
math_FunctionSetRoot& Rsnld,
|
||||||
math_FunctionSetRoot& Rsnld,
|
const IntImp_ConstIsoparametric ChoixIso)
|
||||||
const IntImp_ConstIsoparametric ChoixIso )
|
|
||||||
{
|
{
|
||||||
Standard_Real BornInfBuf[3], BornSupBuf[3], ToleranceBuf[3], UVapBuf[3];
|
Standard_Real BornInfBuf[3], BornSupBuf[3], ToleranceBuf[3], UVapBuf[3];
|
||||||
Standard_Real UvresBuf[4];
|
Standard_Real UvresBuf[4];
|
||||||
math_Vector BornInf (BornInfBuf, 1, 3), BornSup (BornSupBuf, 1, 3), Tolerance (ToleranceBuf, 1, 3), UVap (UVapBuf, 1, 3);
|
math_Vector BornInf (BornInfBuf, 1, 3), BornSup (BornSupBuf, 1, 3),
|
||||||
|
Tolerance (ToleranceBuf, 1, 3), UVap (UVapBuf, 1, 3);
|
||||||
TColStd_Array1OfReal Uvres (UvresBuf[0], 1, 4);
|
TColStd_Array1OfReal Uvres (UvresBuf[0], 1, 4);
|
||||||
|
|
||||||
IntImp_ConstIsoparametric BestChoix;
|
IntImp_ConstIsoparametric BestChoix;
|
||||||
myZerParFunc.ComputeParameters(ChoixIso,Param,UVap,
|
|
||||||
BornInf,BornSup,Tolerance);
|
myZerParFunc.ComputeParameters(ChoixIso,Param,UVap,BornInf,BornSup,Tolerance);
|
||||||
Rsnld.SetTolerance(Tolerance);
|
Rsnld.SetTolerance(Tolerance);
|
||||||
Rsnld.Perform(myZerParFunc,UVap,BornInf,BornSup);
|
Rsnld.Perform(myZerParFunc,UVap,BornInf,BornSup);
|
||||||
BestChoix = ChoixIso;
|
BestChoix = ChoixIso;
|
||||||
@ -118,9 +118,9 @@ IntImp_ConstIsoparametric IntImp_Int2S::
|
|||||||
tangent = myZerParFunc.IsTangent(UVap,Uvres,BestChoix);
|
tangent = myZerParFunc.IsTangent(UVap,Uvres,BestChoix);
|
||||||
pint.SetValue(myZerParFunc.Point(),Uvres(1),Uvres(2),Uvres(3),Uvres(4));
|
pint.SetValue(myZerParFunc.Point(),Uvres(1),Uvres(2),Uvres(3),Uvres(4));
|
||||||
if (!tangent) {
|
if (!tangent) {
|
||||||
d3d = myZerParFunc.Direction();
|
d3d = myZerParFunc.Direction();
|
||||||
d2d1 = myZerParFunc.DirectionOnS1();
|
d2d1 = myZerParFunc.DirectionOnS1();
|
||||||
d2d2 = myZerParFunc.DirectionOnS2();
|
d2d2 = myZerParFunc.DirectionOnS2();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -133,9 +133,8 @@ IntImp_ConstIsoparametric IntImp_Int2S::
|
|||||||
return BestChoix;
|
return BestChoix;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
|
IntImp_ConstIsoparametric IntImp_Int2S:: Perform(const TColStd_Array1OfReal& Param,
|
||||||
const TColStd_Array1OfReal& Param,
|
math_FunctionSetRoot& Rsnld)
|
||||||
math_FunctionSetRoot& Rsnld)
|
|
||||||
{
|
{
|
||||||
gp_Vec DPUV[4];
|
gp_Vec DPUV[4];
|
||||||
gp_Pnt P1,P2;
|
gp_Pnt P1,P2;
|
||||||
@ -157,15 +156,20 @@ IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
|
|||||||
Epsuv[2] = ThePSurfaceTool::UResolution(Caro2,Precision::Confusion());
|
Epsuv[2] = ThePSurfaceTool::UResolution(Caro2,Precision::Confusion());
|
||||||
Epsuv[3] = ThePSurfaceTool::VResolution(Caro2,Precision::Confusion());
|
Epsuv[3] = ThePSurfaceTool::VResolution(Caro2,Precision::Confusion());
|
||||||
|
|
||||||
for (Standard_Integer j=0;j<=3;j++) UVd[j] = Param(j+1);
|
for (Standard_Integer j=0;j<=3;j++)
|
||||||
|
UVd[j] = Param(j+1);
|
||||||
|
|
||||||
empty = Standard_True;
|
empty = Standard_True;
|
||||||
|
|
||||||
Standard_Boolean Tangent = IntImp_ComputeTangence(DPUV,Epsuv,UVd,ChoixIso);
|
Standard_Boolean Tangent = IntImp_ComputeTangence(DPUV,Epsuv,UVd,ChoixIso);
|
||||||
if (Tangent) return BestChoix;
|
if (Tangent)
|
||||||
|
return BestChoix;
|
||||||
|
|
||||||
Standard_Integer i=0;
|
Standard_Integer i=0;
|
||||||
IntImp_ConstIsoparametric CurrentChoix = BestChoix; //-- Modif 17 Mai 93
|
IntImp_ConstIsoparametric CurrentChoix = BestChoix; //-- Modif 17 Mai 93
|
||||||
while (empty && i<= 3) {
|
|
||||||
|
while (empty && i<= 3)
|
||||||
|
{
|
||||||
CurrentChoix = Perform(Param,Rsnld,ChoixIso[i]);
|
CurrentChoix = Perform(Param,Rsnld,ChoixIso[i]);
|
||||||
if(!empty) {
|
if(!empty) {
|
||||||
BestChoix = CurrentChoix;
|
BestChoix = CurrentChoix;
|
||||||
@ -174,7 +178,7 @@ IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
|
|||||||
}
|
}
|
||||||
if (!empty) { // verifier que l on ne deborde pas les frontieres
|
if (!empty) { // verifier que l on ne deborde pas les frontieres
|
||||||
pint.Parameters(Duv(1),Duv(2),Duv(3),Duv(4));
|
pint.Parameters(Duv(1),Duv(2),Duv(3),Duv(4));
|
||||||
|
|
||||||
UVd[0] = ua0; //-- ThePSurfaceTool::UIntervalFirst(Caro1);
|
UVd[0] = ua0; //-- ThePSurfaceTool::UIntervalFirst(Caro1);
|
||||||
UVd[1] = va0; //-- ThePSurfaceTool::VIntervalFirst(Caro1);
|
UVd[1] = va0; //-- ThePSurfaceTool::VIntervalFirst(Caro1);
|
||||||
UVf[0] = ua1; //-- ThePSurfaceTool::UIntervalLast(Caro1);
|
UVf[0] = ua1; //-- ThePSurfaceTool::UIntervalLast(Caro1);
|
||||||
@ -184,7 +188,7 @@ IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
|
|||||||
UVd[3] = vb0; //-- ubThePSurfaceTool::VIntervalFirst(Caro2);
|
UVd[3] = vb0; //-- ubThePSurfaceTool::VIntervalFirst(Caro2);
|
||||||
UVf[2] = ub1; //-- ThePSurfaceTool::UIntervalLast(Caro2);
|
UVf[2] = ub1; //-- ThePSurfaceTool::UIntervalLast(Caro2);
|
||||||
UVf[3] = vb1; //-- ThePSurfaceTool::VIntervalLast(Caro2);
|
UVf[3] = vb1; //-- ThePSurfaceTool::VIntervalLast(Caro2);
|
||||||
|
|
||||||
Standard_Integer Nc,Iiso;
|
Standard_Integer Nc,Iiso;
|
||||||
if (Duv(1) <= UVd[0]-Epsuv[0]) {
|
if (Duv(1) <= UVd[0]-Epsuv[0]) {
|
||||||
Duv(1) = UVd[0];
|
Duv(1) = UVd[0];
|
||||||
@ -233,18 +237,28 @@ IntImp_ConstIsoparametric IntImp_Int2S:: Perform(
|
|||||||
if (!empty) { // verification si l on ne deborde pas sur le carreau
|
if (!empty) { // verification si l on ne deborde pas sur le carreau
|
||||||
// reciproque
|
// reciproque
|
||||||
Nc =3-Nc;
|
Nc =3-Nc;
|
||||||
if (Duv(Nc) <= UVd[Nc-1]-Epsuv[Nc-1]) Duv(Nc)=UVd[Nc-1];
|
if (Duv(Nc) <= UVd[Nc-1]-Epsuv[Nc-1])
|
||||||
else if (Duv(Nc) >=UVf[Nc-1]+Epsuv[Nc-1]) Duv(Nc)=UVf[Nc-1];
|
Duv(Nc)=UVd[Nc-1];
|
||||||
else if (Duv(Nc+1) <= UVd[Nc]) {
|
else if (Duv(Nc) >=UVf[Nc-1]+Epsuv[Nc-1])
|
||||||
Nc = Nc +1;
|
Duv(Nc)=UVf[Nc-1];
|
||||||
Duv(Nc)=UVd[Nc-1];
|
else if (Duv(Nc+1) <= UVd[Nc])
|
||||||
|
{
|
||||||
|
Nc = Nc + 1;
|
||||||
|
Duv(Nc)=UVd[Nc-1];
|
||||||
}
|
}
|
||||||
else if (Duv(Nc+1) >=UVf[Nc]) {
|
else if (Duv(Nc+1) >=UVf[Nc])
|
||||||
Nc = Nc +1;
|
{
|
||||||
Duv(Nc)=UVf[Nc-1];
|
Nc = Nc + 1;
|
||||||
|
Duv(Nc)=UVf[Nc-1];
|
||||||
}
|
}
|
||||||
else return BestChoix;
|
else
|
||||||
|
return BestChoix;
|
||||||
|
|
||||||
empty = Standard_True;
|
empty = Standard_True;
|
||||||
|
|
||||||
|
if(Nc == 4)
|
||||||
|
Nc = 0;
|
||||||
|
|
||||||
BestChoix = ChoixRef[Nc]; //en attendant
|
BestChoix = ChoixRef[Nc]; //en attendant
|
||||||
BestChoix = Perform(Duv,Rsnld,BestChoix);
|
BestChoix = Perform(Duv,Rsnld,BestChoix);
|
||||||
}
|
}
|
||||||
|
@ -379,11 +379,9 @@ Standard_Boolean IntWalk_PWalking::PerformFirstPoint (const TColStd_Array1OfRea
|
|||||||
close = Standard_False;
|
close = Standard_False;
|
||||||
//
|
//
|
||||||
Standard_Integer i;
|
Standard_Integer i;
|
||||||
Standard_Real aTmp;
|
|
||||||
TColStd_Array1OfReal Param(1,4);
|
TColStd_Array1OfReal Param(1,4);
|
||||||
//
|
//
|
||||||
for (i=1; i<=4; ++i) {
|
for (i=1; i<=4; ++i) {
|
||||||
aTmp = ParDep(i);
|
|
||||||
Param(i) = ParDep(i);
|
Param(i) = ParDep(i);
|
||||||
}
|
}
|
||||||
//-- calculate the first solution point
|
//-- calculate the first solution point
|
||||||
@ -393,9 +391,11 @@ Standard_Boolean IntWalk_PWalking::PerformFirstPoint (const TColStd_Array1OfRea
|
|||||||
if (!myIntersectionOn2S.IsDone()) {
|
if (!myIntersectionOn2S.IsDone()) {
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myIntersectionOn2S.IsEmpty()) {
|
if (myIntersectionOn2S.IsEmpty()) {
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
FirstPoint = myIntersectionOn2S.Point();
|
FirstPoint = myIntersectionOn2S.Point();
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ puts ""
|
|||||||
# Fuse problem of symetrical shapes. Appendix for NPAL19789
|
# Fuse problem of symetrical shapes. Appendix for NPAL19789
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|
||||||
cpulimit 500
|
cpulimit 1000
|
||||||
#cpulimit 4500
|
#cpulimit 4500
|
||||||
set BugNumber OCC19793
|
set BugNumber OCC19793
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user