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

0023952: Improving thread-safety of intersections, approximations and other modeling algorithms

AdvApp2Var_SysBase::mcrgene_ size reduced from 1000 to 32 elements, and each element reworked into typed structure.
fixed IntAna_Curve.cxx to prevent access to #NAN# SigneSqrtDis
fixed alignment of doubles by 8 bytes, and minor corrections
Minor correction: static const N given more specific name (MAX_ALLOC_NB)
Added QAcommands OCC23952sweep and OCC23952intersect
Added test cases bugs/modalg_5/bug23952_1 bug23952_2
This commit is contained in:
Roman Lygin
2013-05-31 17:04:58 +04:00
parent 416d012709
commit 1ef32e96ee
30 changed files with 857 additions and 614 deletions

View File

@@ -62,11 +62,6 @@ raises NotDone from StdFail,
is
Create
returns IWalking from IntWalk;
Create(Epsilon, Deflection, Step : Real from Standard)
---Purpose: Deflection is the maximum deflection admitted between two
@@ -303,6 +298,7 @@ fields
previousd2d : Dir2d from gp;
seqAjout : SequenceOfInteger from TColStd;
lines : SequenceOfIWLine;
NbPointsConfondusConsecutifs: Integer from Standard;
EpsilonSembleTropGrand : Integer from Standard;
end IWalking;

View File

@@ -31,7 +31,9 @@ IntWalk_IWalking::IntWalk_IWalking (const Standard_Real Epsilon,
fleche(Deflection),
pas(Increment),
tolerance(1,2),
epsilon(Epsilon*Epsilon)
epsilon(Epsilon*Epsilon),
NbPointsConfondusConsecutifs(0),
EpsilonSembleTropGrand(0)
{
}

View File

@@ -328,8 +328,9 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
}
}
if (Arrive) {
static math_Vector bidF(1,1);
static math_Matrix bidD(1,1,1,2);
Standard_Real abidF[1], abidD[1][2];
math_Vector bidF(abidF,1,1);
math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
break;
}
@@ -570,8 +571,9 @@ Standard_Boolean IntWalk_IWalking::TestArretAjout
Arrive = Standard_True;
UV(1) = U1;
UV(2) = V1;
static math_Vector bidF(1,1);
static math_Matrix bidD(1,1,1,2);
Standard_Real abidF[1], abidD[1][2];
math_Vector bidF(abidF,1,1);
math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
break;
}
@@ -667,8 +669,9 @@ void IntWalk_IWalking::TestArretCadre
}
}
if (Found) {
static math_Vector bidF(1,1);
static math_Matrix bidD(1,1,1,2);
Standard_Real abidF[1], abidD[1][2];
math_Vector bidF(abidF,1,1);
math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
Standard_Integer NBP = Line->NbPoints();
Standard_Integer Indextg;
@@ -742,8 +745,9 @@ void IntWalk_IWalking::TestArretCadre
}
if (Found) {
Irang = -Irang; // jag 941017
static math_Vector bidF(1,1);
static math_Matrix bidD(1,1,1,2);
Standard_Real abidF[1], abidD[1][2];
math_Vector bidF(abidF,1,1);
math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
return;
}

View File

@@ -73,7 +73,8 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
{
Standard_Integer I, N;
static math_Vector BornInf(1,2), BornSup(1,2), UVap(1,2);
Standard_Real aBornInf[2], aBornSup[2], aUVap[2];
math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2), UVap(aUVap,1,2);
Standard_Real PasC, PasCu, PasCv;
Standard_Boolean Arrive; // shows if the line ends
Standard_Boolean Cadre; // shows if one is on border of the domain
@@ -498,8 +499,9 @@ static Standard_Boolean TestPassedSolutionWithNegativeState(const TColStd_Sequen
}
}
if (Arrive) {
static math_Vector bidF(1,1);
static math_Matrix bidD(1,1,1,2);
Standard_Real abidF[1], abidD[1][2];
math_Vector bidF(abidF,1,1);
math_Matrix bidD(abidD,1,1,1,2);
sp.Values(UV,bidF,bidD);
break;
}

View File

@@ -52,8 +52,9 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
{
Standard_Integer I,N;
static math_Vector BornInf(1,2),BornSup(1,2);
static math_Vector Uvap(1,2);// parameters of current approach
Standard_Real aBornInf[2], aBornSup[2], aUVap[2];
math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2);
math_Vector Uvap(aUVap,1,2);// parameters of current approach
Standard_Real PasC; // rate of advancement on the tangent
Standard_Real PasCu; // rate of advancement current by U
Standard_Real PasCv; // step of advancement current by V

View File

@@ -16,6 +16,15 @@
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
namespace {
static const Standard_Real CosRef3D = 0.98;// regle par tests dans U4
// correspond a 11.478 d
static const Standard_Real CosRef2D = 0.88; // correspond a 25 d
static const Standard_Integer MaxDivision = 60; // nombre maxi de division
// du pas a cause de
// l angle trop grand en 2d (U4)
}
IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection
(TheIWFunction& sp,
const Standard_Boolean Finished,
@@ -49,18 +58,10 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection
IntWalk_StatusDeflection Status = IntWalk_OK;
static const Standard_Real CosRef3D = 0.98;// regle par tests dans U4
// correspond a 11.478 d
static const Standard_Real CosRef2D = 0.88; // correspond a 25 d
static const Standard_Integer MaxDivision = 60; // nombre maxi de division
// du pas a cause de
// l angle trop grand en 2d (U4)
//---------------------------------------------------------------------------------
//-- lbr le 4 Avril 95 : On peut se trouver ds le cas ou Status renvoie point
//-- confondus si epsilon est assez grand (1e-11) . Dans ce cas on boucle
//-- sans jamais changer les valeurs envoyees a Rsnld.
static Standard_Integer NbPointsConfondusConsecutifs = 0 ;
static Standard_Integer EpsilonSembleTropGrand = 0 ;
//---------------------------------------------------------------------------------
Standard_Real Paramu, Paramv, StepU,StepV;
Standard_Real Cosi, Cosi2, Norme;

View File

@@ -58,9 +58,10 @@ void IntWalk_IWalking::MakeWalkingPoint
Psol.SetValue(sp.Point(),reversed, U, V);
}
else if (Case == 11 || Case == 12 ) {
static math_Vector UV(1, 2);
static math_Vector FF(1, 1);
static math_Matrix DD(1, 1, 1, 2);
Standard_Real aUV[2], aFF[1], aDD[1][2];
math_Vector UV(aUV,1, 2);
math_Vector FF(aFF,1, 1);
math_Matrix DD(aDD,1, 1, 1, 2);
UV(1) = U;
UV(2) = V;
sp.Values(UV, FF, DD);
@@ -85,9 +86,10 @@ void IntWalk_IWalking::OpenLine(const Standard_Integer N,
{
ThePointOfPath PathPnt;
static math_Vector UV(1, 2);
static math_Vector FF(1, 1);
static math_Matrix DD(1, 1, 1, 2);
Standard_Real aUV[2], aFF[1], aDD[1][2];
math_Vector UV(aUV,1, 2);
math_Vector FF(aFF,1, 1);
math_Matrix DD(aDD,1, 1, 1, 2);
previousPoint = Line->Value(1);
if (!reversed) {

View File

@@ -310,5 +310,6 @@ fields
firstd2 : Dir2d from gp;
myIntersectionOn2S : TheInt2S ;
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND : Integer from Standard;
STATIC_PRECEDENT_INFLEXION : Integer from Standard;
end PWalking;

View File

@@ -84,7 +84,9 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
fleche(Deflection),
tolconf(Epsilon),
sensCheminement(1),
myIntersectionOn2S(Caro1,Caro2,TolTangency)
myIntersectionOn2S(Caro1,Caro2,TolTangency),
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
STATIC_PRECEDENT_INFLEXION(0)
{
Standard_Real KELARG=20.;
//
@@ -222,7 +224,9 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
fleche(Deflection),
tolconf(Epsilon),
sensCheminement(1),
myIntersectionOn2S(Caro1,Caro2,TolTangency)
myIntersectionOn2S(Caro1,Caro2,TolTangency),
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND(0),
STATIC_PRECEDENT_INFLEXION(0)
{
Standard_Real KELARG=20.;
//

View File

@@ -21,6 +21,13 @@
//#define DEBUG 0
namespace {
//OCC431(apo): modified ->
static const Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
static const Standard_Real d = 7.0;
}
IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
// tester si fleche respectee en calculant un majorant de fleche
@@ -37,9 +44,6 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
// tester s il n y a pas changement de rive
//
{
static Standard_Integer STATIC_BLOCAGE_SUR_PAS_TROP_GRAND = 0;
static Standard_Integer STATIC_PRECEDENT_INFLEXION = 0;
if(line->NbPoints() ==1 ) {
STATIC_BLOCAGE_SUR_PAS_TROP_GRAND=STATIC_PRECEDENT_INFLEXION=0;
}
@@ -126,10 +130,7 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection()
return(IntWalk_ArretSurPointPrecedent);
}
//==================================================================================
//OCC431(apo): modified ->
static Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0;
static Standard_Real /*tolArea = 100.0,*/ d = 7.0;
Standard_Real tolArea = 100.0;
if (ResoU1 < Precision::PConfusion() ||
ResoV1 < Precision::PConfusion() ||