0028107: Visualization - provide a flexible interface to set custom hatch styles
[occt.git] / tests / bugs / vis / bug24623_2
CommitLineData
f751596e 1puts "============"
2puts "OCC24623_2"
3puts "============"
4puts ""
5#######################################################################
6puts "Visualization - improve selection mechanism"
7# tests performance of selection algorithm. Creates a spiral via polyline
8# and checks its selection in neutral point. For representative result,
9# increase the number of points in POINTS_NUM and check time measurments
10# in comparsion to previous OCCT versions.
11#######################################################################
12
13set POINTS_NUM 1000
14set STEP 0.3
15
16pload ALL
17
18set aCoef 0.2
19set aZ 0
20# unset aPointCoords
21list aPointCoords
22for {set i 0} {$i < $POINTS_NUM} {incr i} {
23 set aX [expr $aCoef * $aZ * cos($aZ)]
24 set aY [expr $aCoef * $aZ * sin($aZ)]
25 set aZ [expr $aZ + $STEP]
26 lappend aPointCoords $aX
27 lappend aPointCoords $aY
28 lappend aPointCoords $aZ
29}
30
31vinit
32set aMemInit [meminfo h]
33puts "Initial mem: [expr $aMemInit / (1024 * 1024)] MiB ([expr $aMemInit])"
34polyline p {*}$aPointCoords
35vdisplay p
36
37vfit
38
39puts "Selection time before the transformations:"
40chrono aTimer reset
41chrono aTimer start
42vmoveto 223 236
43chrono aTimer stop
44chrono aTimer show
45vmoveto 0 0
46chrono aTimer reset
47chrono aTimer start
48vmoveto 223 236
49chrono aTimer stop
50chrono aTimer show
51
52puts ""
53puts "Applying transformations..."
54vtranslateview 1 0 0
55vrotate 100 100 100
56
57puts ""
58puts "Selection time after the transformations:"
59chrono aTimer reset
60chrono aTimer start
61vmoveto 115 160
62chrono aTimer stop
63chrono aTimer show
64vmoveto 0 0
65chrono aTimer reset
66chrono aTimer start
67vmoveto 115 160
68chrono aTimer stop
69chrono aTimer show
70
71set aMemSel [meminfo h]
72puts "Selection mem: [expr $aMemSel / (1024 * 1024)] MiB ([expr $aMemSel])"
73
74checkcolor 131 195 0 1 1