0027860: Visualization - clean up Transformation Persistence API
[occt.git] / tests / bugs / vis / bug27739
CommitLineData
099f3513 1puts "========"
2puts "OCC27739"
3puts "========"
4puts ""
5##################################################################
6puts "Visualization, TKV3d - implement individual acceleration data structure for selection of 2D persistent objects"
7##################################################################
8
9# Create view
10set win_width 409
11set win_height 409
12vinit View1 w=$win_width h=$win_height
13vclear
14
15# Display several different presentation types with orthographic camera
16vcamera -ortho
17vtrihedron tri1
18box box3d 100 100 100
19box box2d 100 100 1
20box box2d_pos 100 100 1
21box box2d_loc 100 100 1
22box box_zoom 100 100 100
23
24vdisplay box3d -dispMode 1 -highMode 0
778cd667 25vdisplay box2d -dispMode 1 -highMode 1 -2d center
26vdisplay box2d_pos -dispMode 1 -highMode 1 -2d bottomLeft
27vdisplay box2d_loc -dispMode 1 -highMode 1 -2d center
099f3513 28vdisplay box_zoom -dispMode 1 -highMode 0 -trsfPers zoom
29vdisplay box2d
30vsetlocation box2d_loc 100 0 0
31vsetlocation box_zoom -100 -100 100
32
33vsetmaterial box3d box2d box2d_pos box2d_loc box_zoom PLASTIC
34vsetcolor box3d GOLD
35vsetcolor box2d GREEN
36vsetcolor box2d_pos GREEN
37vsetcolor box2d_loc GREEN
38vsetcolor box_zoom RED
39vfit
40
41# ==========================================
42# Test selection for orthographic projection
43# ==========================================
44
45set test_1 {220 120}; # box2d
46set test_2 {350 150}; # box2d_pos
47set test_3 { 50 350}; # box2d_loc
48
49vmoveto {*}$test_1
50if {[vreadpixel {*}$test_1 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
51vdump $imagedir/${casename}_1.png
52
53vmoveto {*}$test_2
54if {[vreadpixel {*}$test_2 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
55vdump $imagedir/${casename}_2.png
56
57vmoveto {*}$test_3
58if {[vreadpixel {*}$test_3 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
59vdump $imagedir/${casename}_3.png
60
61# =========================================
62# Test selection for perspective projection
63# =========================================
64
65vcamera -persp
66vcamera -distance 1000
67set test_1 {220 120}; # box2d
68set test_2 {350 150}; # box2d_pos
69set test_3 { 50 350}; # box2d_loc
70
71vmoveto {*}$test_1
72if {[vreadpixel {*}$test_1 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
73vdump $imagedir/${casename}_4.png
74
75vmoveto {*}$test_2
76if {[vreadpixel {*}$test_2 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
77vdump $imagedir/${casename}_5.png
78
79vmoveto {*}$test_3
80if {[vreadpixel {*}$test_3 name] != "CYAN1 1"} { puts "ERROR: zoom persistent box is not detected!" }
81vdump $imagedir/${casename}_6.png