f751596e |
1 | puts "============" |
0d828ac8 |
2 | puts "OCC24623_3: Visualization - improve selection mechanism" |
3 | puts "Tests memory leaks in creation of selection primitives for connected interactive objects:" |
4 | puts "checks that there is no 'dead links' in removing Select3D_BVHPrimitiveContent" |
f751596e |
5 | puts "============" |
6 | puts "" |
f751596e |
7 | |
f751596e |
8 | pload MODELING VISUALIZATION |
9 | psphere s 0.5 |
10 | tclean s |
11 | incmesh s 0.001 |
12 | trinfo s |
13 | |
14 | set aMemInit [meminfo h] |
f751596e |
15 | set aNb 1000 |
16 | |
17 | # display as copies |
18 | eval compound [lrepeat $aNb s] ss |
19 | explode ss |
1beb58d7 |
20 | for {set i 1} {$i <= $aNb} {incr i} { vloadselection ss_${i}; vsetlocation -noupdate ss_${i} ${i} 0 0 } |
f751596e |
21 | vfit |
22 | set aMemSel1 [meminfo h] |
23 | vclear |
24 | set aMemClear1 [meminfo h] |
25 | |
26 | # display as connected instances of single presentation |
27 | vconnectto i_1 0 0 0 s -nodisplay |
28 | vloadselection i_1 |
29 | for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 -nodisplay; vloadselection i_${i} } |
30 | set aMemSel2 [meminfo h] |
31 | vclear |
32 | set aMemClear2 [meminfo h] |
33 | |
34 | puts "Initial memory : [expr $aMemInit / (1024 * 1024)] MiB" |
35 | puts "Compute selection (simple) : [expr $aMemSel1 / (1024 * 1024)] MiB" |
36 | puts "Clearing (simple) : [expr $aMemClear1 / (1024 * 1024)] MiB" |
37 | puts "Compute selection (connected): [expr $aMemSel2 / (1024 * 1024)] MiB" |
38 | puts "Clearing (connected) : [expr $aMemClear2 / (1024 * 1024)] MiB" |
39 | |
40 | set aRatio [expr $aMemClear2 / double($aMemClear1)] |
41 | |
42 | # check if the memory difference is greater than 10% |
0d828ac8 |
43 | if {[expr $aRatio > 1.1]} { puts "Error : TEST FAILED" } |
44 | vdump $imagedir/${casename}.png |