mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0023535: Exception in BSplCLib::BuildCache()
Preliminary result. It was tested with spl_2.brep file only. Add "const" Adding test cases for this fix Signed-off-by: skv <skv@opencascade.com>
This commit is contained in:
parent
cbadf17e88
commit
c0716da1cd
@ -214,6 +214,27 @@ is
|
|||||||
is static private;
|
is static private;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
InternalCompositePerform_noRecurs(me: in out;
|
||||||
|
NbInterC1: Integer from Standard;
|
||||||
|
C1: TheCurve;
|
||||||
|
NumInterC1: Integer from Standard;
|
||||||
|
Tab1: Array1OfReal from TColStd;
|
||||||
|
D1: Domain from IntRes2d;
|
||||||
|
NbInterC2: Integer from Standard;
|
||||||
|
C2: TheCurve;
|
||||||
|
NumInterC2: Integer from Standard;
|
||||||
|
Tab2: Array1OfReal from TColStd;
|
||||||
|
D2: Domain from IntRes2d;
|
||||||
|
TolConf,Tol: Real from Standard)
|
||||||
|
|
||||||
|
---Purpose: Part of InternalCompositePerform function
|
||||||
|
|
||||||
|
raises ConstructionError from Standard
|
||||||
|
is static private;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
InternalCompositePerform(me: in out;
|
InternalCompositePerform(me: in out;
|
||||||
C1: TheCurve; D1: Domain from IntRes2d;
|
C1: TheCurve; D1: Domain from IntRes2d;
|
||||||
N1,NB1: Integer from Standard;
|
N1,NB1: Integer from Standard;
|
||||||
|
@ -805,6 +805,102 @@ void IntCurve_IntCurveCurveGen::InternalPerform (const TheCurve& C1,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IntCurve_IntCurveCurveGen::InternalCompositePerform_noRecurs(
|
||||||
|
const Standard_Integer NbInterC1,
|
||||||
|
const TheCurve& C1,
|
||||||
|
const Standard_Integer NumInterC1,
|
||||||
|
const TColStd_Array1OfReal& Tab1,
|
||||||
|
const IntRes2d_Domain& D1,
|
||||||
|
const Standard_Integer NbInterC2,
|
||||||
|
const TheCurve& C2,
|
||||||
|
const Standard_Integer NumInterC2,
|
||||||
|
const TColStd_Array1OfReal& Tab2,
|
||||||
|
const IntRes2d_Domain& D2,
|
||||||
|
const Standard_Real TolConf,
|
||||||
|
const Standard_Real Tol)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if(NumInterC2>NbInterC2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
IntRes2d_Domain DomainC1NumInter;
|
||||||
|
IntRes2d_Domain DomainC2NumInter;
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
//-- Creation du domaine associe a la portion de C1
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
Standard_Boolean DomainIsOK = Standard_True;
|
||||||
|
Standard_Real ParamInf,ParamSup;
|
||||||
|
|
||||||
|
if(NbInterC1>1) {
|
||||||
|
TheCurveTool::GetInterval(C1,NumInterC1,Tab1,ParamInf,ParamSup);
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
//-- Verification : Domaine Inclu dans Intervalle de Definition
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
|
Standard_Real u;
|
||||||
|
|
||||||
|
u = D1.FirstParameter();
|
||||||
|
if(ParamInf < u) { ParamInf = u; }
|
||||||
|
|
||||||
|
u = D1.LastParameter();
|
||||||
|
if(ParamSup > u) { ParamSup = u; }
|
||||||
|
|
||||||
|
if((ParamSup - ParamInf) > 1e-10) {
|
||||||
|
DomainC1NumInter.SetValues(TheCurveTool::Value(C1,ParamInf),
|
||||||
|
ParamInf,
|
||||||
|
D1.FirstTolerance(),
|
||||||
|
TheCurveTool::Value(C1,ParamSup),
|
||||||
|
ParamSup,
|
||||||
|
D1.LastTolerance());
|
||||||
|
} else {
|
||||||
|
DomainIsOK = Standard_False;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DomainC1NumInter = D1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
//-- Creation du domaine associe a la portion de C2
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
if(NbInterC2 > 1) {
|
||||||
|
TheCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
//-- Verification : Domaine Inclu dans Intervalle de Definition
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
|
Standard_Real u;
|
||||||
|
|
||||||
|
u = D2.FirstParameter();
|
||||||
|
if(ParamInf < u) { ParamInf = u; }
|
||||||
|
u = D2.LastParameter();
|
||||||
|
|
||||||
|
if(ParamSup > u) { ParamSup = u; }
|
||||||
|
|
||||||
|
if((ParamSup - ParamInf) > 1e-10) {
|
||||||
|
DomainC2NumInter.SetValues(TheCurveTool::Value(C2,ParamInf),
|
||||||
|
ParamInf,
|
||||||
|
D2.FirstTolerance(),
|
||||||
|
TheCurveTool::Value(C2,ParamSup),
|
||||||
|
ParamSup,
|
||||||
|
D2.LastTolerance());
|
||||||
|
} else {
|
||||||
|
DomainIsOK = Standard_False;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DomainC2NumInter = D2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(DomainIsOK) {
|
||||||
|
InternalPerform(C2,DomainC2NumInter,
|
||||||
|
C1,DomainC1NumInter,
|
||||||
|
TolConf,Tol,
|
||||||
|
Standard_True);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -832,109 +928,33 @@ IntCurve_IntCurveCurveGen::InternalCompositePerform(const TheCurve& C1,
|
|||||||
|
|
||||||
// Standard_Boolean Arret=Standard_False;
|
// Standard_Boolean Arret=Standard_False;
|
||||||
|
|
||||||
if(NumInterC2<=NbInterC2) {
|
if(NumInterC2>NbInterC2)
|
||||||
if(RecursOnC2) {
|
return;
|
||||||
for(Standard_Integer i=NumInterC1 ; i<=NbInterC1; i++) {
|
|
||||||
NumInterC1=i;
|
|
||||||
InternalCompositePerform(C2,D2,NumInterC2,NbInterC2,Tab2,
|
|
||||||
C1,D1,NumInterC1,NbInterC1,Tab1,
|
|
||||||
TolConf,Tol,
|
|
||||||
Standard_False);
|
|
||||||
}
|
|
||||||
if(NumInterC2<NbInterC2) {
|
|
||||||
NumInterC2++;
|
|
||||||
NumInterC1=1;
|
|
||||||
InternalCompositePerform(C1,D1,NumInterC1,NbInterC1,Tab1,
|
|
||||||
C2,D2,NumInterC2,NbInterC2,Tab2,
|
|
||||||
TolConf,Tol,
|
|
||||||
Standard_True);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
//~~~~~~~~~~~~~~~~ I n t e r s e c t i o n ~~~~~~~~~~~~~~~~
|
|
||||||
//~~~~~~~~~~~~~~~~ de C2[NumInterC2] ~~~~~~~~~~~~~~~~
|
|
||||||
//~~~~~~~~~~~~~~~~ et C1[NumInterC1] ~~~~~~~~~~~~~~~~
|
|
||||||
//~~~~~~~~~~~~~~~~ (pour respecter l ordre) ~~~~~~~~~~~~~~~~
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
IntRes2d_Domain DomainC1NumInter;
|
if(!RecursOnC2){
|
||||||
IntRes2d_Domain DomainC2NumInter;
|
InternalCompositePerform_noRecurs(NbInterC1, C1, NumInterC1, Tab1, D1, NbInterC2, C2, NumInterC2, Tab2, D2, TolConf, Tol);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
for(Standard_Integer i=NumInterC1 ; i<=NbInterC1; i++) {
|
||||||
//-- Creation du domaine associe a la portion de C1
|
NumInterC1=i;
|
||||||
//----------------------------------------------------------------------
|
/*
|
||||||
Standard_Boolean DomainIsOK = Standard_True;
|
InternalCompositePerform(C2,D2,NumInterC2,NbInterC2,Tab2,
|
||||||
Standard_Real ParamInf,ParamSup;
|
C1,D1,NumInterC1,NbInterC1,Tab1,
|
||||||
|
TolConf,Tol,Standard_False);
|
||||||
|
*/
|
||||||
|
|
||||||
if(NbInterC1>1) {
|
InternalCompositePerform_noRecurs(NbInterC2,C2,NumInterC2,Tab2,D2,NbInterC1,C1,NumInterC1,Tab1,D1,TolConf,Tol);
|
||||||
TheCurveTool::GetInterval(C1,NumInterC1,Tab1,ParamInf,ParamSup);
|
}
|
||||||
//--------------------------------------------------------------
|
|
||||||
//-- Verification : Domaine Inclu dans Intervalle de Definition
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
Standard_Real u;
|
|
||||||
|
|
||||||
u = D1.FirstParameter();
|
if(NumInterC2<NbInterC2) {
|
||||||
if(ParamInf < u) { ParamInf = u; }
|
NumInterC2++;
|
||||||
|
NumInterC1=1;
|
||||||
|
|
||||||
u = D1.LastParameter();
|
InternalCompositePerform(C1,D1,NumInterC1,NbInterC1,Tab1,
|
||||||
if(ParamSup > u) { ParamSup = u; }
|
C2,D2,NumInterC2,NbInterC2,Tab2,
|
||||||
|
TolConf,Tol,
|
||||||
if((ParamSup - ParamInf) > 1e-10) {
|
Standard_True);
|
||||||
DomainC1NumInter.SetValues(TheCurveTool::Value(C1,ParamInf),
|
|
||||||
ParamInf,
|
|
||||||
D1.FirstTolerance(),
|
|
||||||
TheCurveTool::Value(C1,ParamSup),
|
|
||||||
ParamSup,
|
|
||||||
D1.LastTolerance());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DomainIsOK = Standard_False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DomainC1NumInter = D1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
//-- Creation du domaine associe a la portion de C2
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
if(NbInterC2 > 1) {
|
|
||||||
TheCurveTool::GetInterval(C2,NumInterC2,Tab2,ParamInf,ParamSup);
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
//-- Verification : Domaine Inclu dans Intervalle de Definition
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
Standard_Real u;
|
|
||||||
|
|
||||||
u = D2.FirstParameter();
|
|
||||||
if(ParamInf < u) { ParamInf = u; }
|
|
||||||
|
|
||||||
u = D2.LastParameter();
|
|
||||||
if(ParamSup > u) { ParamSup = u; }
|
|
||||||
|
|
||||||
if((ParamSup - ParamInf) > 1e-10) {
|
|
||||||
DomainC2NumInter.SetValues(TheCurveTool::Value(C2,ParamInf),
|
|
||||||
ParamInf,
|
|
||||||
D2.FirstTolerance(),
|
|
||||||
TheCurveTool::Value(C2,ParamSup),
|
|
||||||
ParamSup,
|
|
||||||
D2.LastTolerance());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DomainIsOK = Standard_False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DomainC2NumInter = D2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(DomainIsOK) {
|
|
||||||
InternalPerform(C2,DomainC2NumInter,
|
|
||||||
C1,DomainC1NumInter,
|
|
||||||
TolConf,Tol,
|
|
||||||
Standard_True);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
tests/bugs/fclasses/bug23535_1
Executable file
9
tests/bugs/fclasses/bug23535_1
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_13.brep] result
|
9
tests/bugs/fclasses/bug23535_2
Executable file
9
tests/bugs/fclasses/bug23535_2
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_14.brep] result
|
9
tests/bugs/fclasses/bug23535_3
Executable file
9
tests/bugs/fclasses/bug23535_3
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_2.brep] result
|
9
tests/bugs/fclasses/bug23535_4
Executable file
9
tests/bugs/fclasses/bug23535_4
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_3.brep] result
|
9
tests/bugs/fclasses/bug23535_5
Executable file
9
tests/bugs/fclasses/bug23535_5
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_5.brep] result
|
9
tests/bugs/fclasses/bug23535_6
Executable file
9
tests/bugs/fclasses/bug23535_6
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_7.brep] result
|
9
tests/bugs/fclasses/bug23535_7
Executable file
9
tests/bugs/fclasses/bug23535_7
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC23535"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Exception in BSplCLib::BuildCache()
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug23535_spl_8.brep] result
|
Loading…
x
Reference in New Issue
Block a user