0031999: Tests - request Core Profile on macOS for Ray-Tracing tests
[occt.git] / tests / bugs / vis / bug25532
CommitLineData
c8be748c 1puts "============"
2puts "OCC25532"
3puts "============"
4puts ""
5#######################################################################
6# Visualization - fix cross-references between AIS_ConnectedInteractive
7# and connected presentation
8#######################################################################
9
10pload MODELING VISUALIZATION
11psphere s 0.5
12tclean s
13incmesh s 0.001
14trinfo s
15
c8be748c 16vclear
14c7f553 17vinit View1
c8be748c 18vaxo
19vcaps -vbo 0
20vsetdispmode 1
14c7f553 21vdefaults -absDefl 1.0
8e5fb5ea 22vselprops -autoactivate 0
c8be748c 23set aMemInit [meminfo h]
24
25set aNb 1000
26
27# display as copies
28eval compound [lrepeat $aNb s] ss
29explode ss
1beb58d7 30for {set i 1} {$i <= $aNb} {incr i} { vdisplay -noupdate ss_${i}; vsetlocation -noupdate ss_${i} ${i} 0 0 }
c8be748c 31vfit
32set aMemDisp1 [meminfo h]
33vclear
34set aMemClear1 [meminfo h]
35
36# display as connected instances of single presentation
37vconnectto i_1 0 0 0 s
38for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 }
39set aMemDisp2 [meminfo h]
40vclear
41set aMemClear2 [meminfo h]
42
43puts "Initial memory: [expr $aMemInit / (1024 * 1024)] MiB"
44puts "Displaying (simple): [expr $aMemDisp1 / (1024 * 1024)] MiB"
45puts "Clearing (simple): [expr $aMemClear1 / (1024 * 1024)] MiB"
46puts "Displaying (connected): [expr $aMemDisp2 / (1024 * 1024)] MiB"
47puts "Clearing (connected): [expr $aMemClear2 / (1024 * 1024)] MiB"
48
49set aRatio [expr $aMemClear2 / double($aMemClear1)]
50
7f917335 51# check if the memory difference is greater than 20%
52if [expr $aRatio > 1.2] {
c8be748c 53 puts "Error : TEST FAILED"
54}
55