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

0025717: Non reentrant (and hence non-thread-safe) math_RealRandom / _IntegerRandom

Classes math_IntegerRandom and math_RealRandom, and method Random2 in math_Recipes, removed. Class math_BullardGenerator is used instead.
This commit is contained in:
abv
2015-01-18 17:08:40 +03:00
committed by bugmaster
parent 0bb09048e2
commit fd3ba7a1d9
8 changed files with 6 additions and 217 deletions

View File

@@ -30,7 +30,7 @@
#include <ElCLib.hxx>
#include <Geom_Surface.hxx>
#include <BRep_Tool.hxx>
#include <math_RealRandom.hxx>
#include <math_BullardGenerator.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
static
@@ -98,7 +98,7 @@ void BRepClass3d_SClassifier::PerformInfinitePoint(BRepClass3d_SolidExplorer& aS
gp_Pnt aPoint;
gp_Dir aDN;
math_RealRandom RandomGenerator(0.1, 0.9);
math_BullardGenerator aRandomGenerator;
myFace.Nullify();
myState=2;
@@ -114,10 +114,10 @@ void BRepClass3d_SClassifier::PerformInfinitePoint(BRepClass3d_SolidExplorer& aS
TopoDS_Face MinFace = aF;
for (;;)
{
aParam = RandomGenerator.Next();
bFound = aSE.FindAPointInTheFace(aF, aPoint, aU, aV, aParam);
if (!bFound)
return;
aParam = 0.1 + 0.8 * aRandomGenerator.NextReal(); // random number in range [0.1, 0.9]
bFound = aSE.FindAPointInTheFace(aF, aPoint, aU, aV, aParam);
if (!bFound)
return;
if (!FaceNormal(aF, aU, aV, aDN))
continue;