0029528: Visualization, TKOpenGl - allow defining sRGB textures
[occt.git] / tests / bugs / vis / bug26199
1 puts "=========="
2 puts "OCC26199"
3 puts "=========="
4 puts ""
5 ############################################################
6 # Visualization - use NCollection_IndexedMap instead of NCollection_Sequence in OpenGl_BVHClipPrimitiveSet to improve performance
7 ############################################################
8
9 psphere s 0.5
10 tclean  s
11 incmesh s 0.1
12 trinfo  s
13
14 vinit View1
15 vclear
16 vaxo
17 vsetdispmode 1
18
19 vdefaults -defl 1.0 -autoTriang off
20 # Warning, unknown argument '-DEFL'
21
22 vdisplay s
23
24 set aNb1 100
25
26 # display 100x100 connected instances of single presentation
27 puts "Creating [expr $aNb1*$aNb1] instances..."
28 set t1 [time {for {set i 0} {$i < $aNb1} {incr i} {for {set j 0} {$j < $aNb1} {incr j} {vconnectto s_${i}_${j} ${i} ${j} 0 s -noupdate}}}]
29
30 # the following command is slow
31 set t2 [time {vclear}]
32
33 set d1 [lindex $t1 0]
34 puts "vconnectto done in $d1 microseconds!\n"
35
36 set d2 [lindex $t2 0]
37 puts "vclear done in $d2 microseconds!\n"
38
39 set t1_sec [expr $d1 * 1.e-6]
40 set t2_sec [expr $d2 * 1.e-6]
41
42 if { [regexp {Debug mode} [dversion]] } {
43   if { [regexp {Windows} [dversion]] } {
44     set max_time_vconnectto 5
45     set max_time_vclear 5
46   } else {
47     set max_time_vconnectto 5
48     set max_time_vclear 5
49   }
50 } else {
51   if { [regexp {Windows} [dversion]] } {
52     set max_time_vconnectto 1
53     set max_time_vclear 1
54   } else {
55     set max_time_vconnectto 1
56     set max_time_vclear 1
57   }
58 }
59
60 if { ${t1_sec} > ${max_time_vconnectto} } {                                         
61     puts "Elapsed time of vconnectto is more than ${max_time_vconnectto} seconds - Error"
62 } else {
63     puts "Elapsed time of vconnectto is less than ${max_time_vconnectto} seconds - OK"
64 }
65
66 if { ${t2_sec} > ${max_time_vclear} } {                                         
67     puts "Elapsed time of vclear is more than ${max_time_vclear} seconds - Error"
68 } else {
69     puts "Elapsed time of vclear is less than ${max_time_vclear} seconds - OK"
70 }