Use std::mt19937 random number generator instead of rand() in NCollection_UBTreeFiller.
boolean gdml_private ZI7 ZJ7 - TODO "bopcheck failed" is only for Linux now, checkshape faulty is unstable (issue #27052)
boolean volumemaker B6 - Added TODO (bopcheck and checkshape faulties)
boolean volumemaker C9 - Added TODO (checkprops and checkshape faulties)
boolean volumemaker D2 - Added TODO (checkshape faulty)
boolean volumemaker H4 - Added TODO (checkprops and checkshape faulties Linux only)
boolean volumemaker D5 - IMVPROVEMENT, TODOs were deleted (bopcheck and checkshape faulties)
bugs modalg_1 buc60462_2 - modified TODOs according to new behavior
boolean gdml_private ZI7 ZJ7 - unstable case, added check for surface area and TODO
samples/tcl/ANC101.tcl - amended due to changed order of edges in BOP result
explode _model e
# Make a weld at joint edges of platform and wedge
+blend _model _model 2 _model_26
+blend _model _model 2 _model_27
blend _model _model 2 _model_28
blend _model _model 2 _model_29
-blend _model _model 2 _model_30
blend _model _model 2 _model_31
-blend _model _model 2 _model_33
# Cylinder on wedge
blend result _model 2 _model_161
#include <NCollection_UBTree.hxx>
#include <NCollection_Vector.hxx>
-#include <stdlib.h>
-#include <stdio.h>
+
+#include <random>
/**
* This class is used to fill an UBTree in a random order.
const Handle(NCollection_BaseAllocator)& theAlloc=0L,
const Standard_Boolean isFullRandom = Standard_True)
: myTree(theTree), mySeqPtr(1000, theAlloc),
- mySeed(1), myIsFullRandom (isFullRandom)
- {
-#ifndef _REENTRANT
- // We use srand/rand for a single threaded application
- // and rand_r for a multi threaded one.
- // _REENTRANT must be defined for a multi threaded application.
- srand (mySeed);
-#endif
- }
+ myRandGen (5489u /* == std::mt19937::default_seed, not defined in older environments, e.g, on Debian 6.0 with GCC 4.4.5 */),
+ myIsFullRandom (isFullRandom) {}
//! Adds a pair (theObj, theBnd) to my sequence
void Add (const TheObjType& theObj, const TheBndType& theBnd)
UBTree& myTree;
NCollection_Vector<ObjBnd> mySeqPtr;
- int mySeed; //!< seed for rand
+ std::mt19937 myRandGen; //!< random number generator
Standard_Boolean myIsFullRandom;
};
-#ifdef _REENTRANT
-inline int take_random (int * theSeed)
-{
- return rand_r ((unsigned *) theSeed);
-}
-#else
-inline int take_random (int *)
-{
- return rand();
-}
-#endif
-
//=======================================================================
//function : Fill
//purpose :
// Fisher-Yates randomization
if (myIsFullRandom)
for (i = nbAdd; i > 0; i--) {
- unsigned int ind = take_random(&mySeed);
- if (i > RAND_MAX) {
- const unsigned int ind1 = take_random(&mySeed);
- ind += (ind1 << 15);
- }
+ unsigned int ind = myRandGen();
ind = ind % i;
const ObjBnd& aObjBnd = mySeqPtr(ind);
myTree.Add (aObjBnd.myObj, aObjBnd.myBnd);
}
else
for (i = nbAdd; i > 0; i--) {
- unsigned int ind = take_random(&mySeed);
+ unsigned int ind = myRandGen();
ind = i - (ind % i) - 1;
const ObjBnd& aObjBnd = mySeqPtr(ind);
myTree.Add (aObjBnd.myObj, aObjBnd.myBnd);
-puts "TODO ?OCC27052 All: Faulty shapes in variables faulty_1 to"
-puts "TODO OCC26018 ALL: bopcheck failed"
+puts "TODO ?OCC27052 ALL: Faulty shapes in variables faulty_1 to"
+puts "TODO OCC27052 Windows: Error : The command is not valid. The area is"
+puts "TODO OCC27052 Windows: Error : The area of result shape is"
+puts "TODO OCC26018 Linux: bopcheck failed"
source [locate_data_file mos2014-asm-scf-final.asm.1.gdml.tcl]
set bcheck [bopcheck result]
puts $bcheck
if {![regexp {This shape seems to be OK.} $bcheck]} {
- puts "Error: bopcheck failed"
-}
\ No newline at end of file
+ puts "Error: bopcheck failed"
+}
+checkprops result -s 618615
\ No newline at end of file
-puts "TODO ?OCC27052 All: Faulty shapes in variables faulty_1 to"
-puts "TODO OCC26018 ALL: bopcheck failed"
+puts "TODO ?OCC27052 ALL: Faulty shapes in variables faulty_1 to"
+puts "TODO OCC27052 Windows: Error : The command is not valid. The area is"
+puts "TODO OCC27052 Windows: Error : The area of result shape is"
+puts "TODO OCC26018 Linux: bopcheck failed"
source [locate_data_file mos2014-scf-final.prt.1.gdml.tcl]
set bcheck [bopcheck result]
puts $bcheck
if {![regexp {This shape seems to be OK.} $bcheck]} {
- puts "Error: bopcheck failed"
-}
\ No newline at end of file
+ puts "Error: bopcheck failed"
+}
+checkprops result -s 618615
\ No newline at end of file
+puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC26020 ALL: Error: bopcheck failed"
+
# test script on make volume operation
# plane
+puts "TODO OCC26020 ALL: Error : The area of result shape is"
+puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
# test script on make volume operation
# cylinder plane unstable
+puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
+
# test script on make volume operation
# cylinder plane unstable
# test script on make volume operation
# cylinder plane
-
-puts "TODO OCC26020 Linux: Error: bopcheck failed"
-puts "TODO OCC26020 Linux: Faulty shapes in variables faulty_1 to"
-
# planar face
plane pln_f1 0 -1450 -4.4408920985006262e-015 0 1 1.1102230246251565e-016
erase pln_f1
+puts "TODO OCC26020 Linux: Error : The area of result shape is"
+puts "TODO OCC26020 Linux: Error: bopcheck failed"
+
# test script on make volume operation
# cylinder plane
-#puts "TODO OCC27024 ALL: Faulty shapes in variables faulty_1 to faulty_"
-puts "TODO OCC27024 ALL: Tcl Exception: result is not a topological shape!!!"
-puts "TODO OCC27024 All:TEST INCOMPLETE"
+puts "TODO OCC27024 ALL: Error : operation bfuse is WRONG because number of SOLID entities in shape"
+puts "TODO OCC27024 ALL: Faulty shapes in variables faulty_1 to faulty_"
puts "=========="
puts "BUC60462"