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