0027818: Visualization - provide an interface to define highlight presentation properties
[occt.git] / tests / bugs / vis / bug26413
CommitLineData
29a4908e 1puts "============"
2puts "CR26413"
3puts "============"
4puts ""
5###################################################################################
6puts "Visualization, SelectMgr_ViewerSelector - Pixel tolerance is overridden by selection sensitivity"
7###################################################################################
8
9pload VISUALIZATION MODELING
10
11vinit View1
12box b 1 1 1
13vdisplay b
14vfit
15
16set x_on_edge 320
17set y_on_edge 340
18set x_on_vert 383
19set y_on_vert 306
20
21set x_sel_precise 228
22set y_sel_precise 393
23set x_sel_tol 228
24set y_sel_tol 400
25
26set x_notol 374
27set y_notol 309
28set x_tol 370
29set y_tol 312
30
31vselmode b 2 1
32
33# check precise selection of the edge
34vmoveto ${x_sel_precise} ${y_sel_precise}
35checkcolor ${x_on_edge} ${y_on_edge} 0 1 1
36# check selection in neighborhood of the edge
37vmoveto 0 0
38vmoveto ${x_sel_tol} ${y_sel_tol}
39checkcolor ${x_on_edge} ${y_on_edge} 1 1 0
40
41vmoveto 0 0
42# increase selection precision
8e5fb5ea 43vselprops -pixtol 8
29a4908e 44
45# check precise selection of the edge
46vmoveto ${x_sel_precise} ${y_sel_precise}
47checkcolor ${x_on_edge} ${y_on_edge} 0 1 1
48# check selection in neighborhood of the edge
49vmoveto 0 0
50vmoveto $x_sel_tol ${y_sel_tol}
51checkcolor ${x_on_edge} ${y_on_edge} 0 1 1
52
53# check that after precision reset selection works as usual
54vmoveto 0 0
8e5fb5ea 55vselprops -pixtol -1
29a4908e 56vmoveto ${x_sel_precise} ${y_sel_precise}
57checkcolor ${x_on_edge} ${y_on_edge} 0 1 1
58vmoveto 0 0
59vmoveto ${x_sel_tol} ${y_sel_tol}
60checkcolor ${x_on_edge} ${y_on_edge} 1 1 0
61
62# check that point sensitivity is inreased for all types of
63# sensitive entities
64vmoveto 0 0
65vselmode b 1 1
8e5fb5ea 66vselprops -pixtol -1
29a4908e 67
68vmoveto ${x_notol} ${y_notol}
69# check that vertex is highlighted and edge is not
70checkcolor ${x_on_edge} ${y_on_edge} 1 1 0
71checkcolor ${x_on_vert} ${y_on_vert} 0 1 1
72
73vmoveto 0 0
8e5fb5ea 74vselprops -pixtol 8
29a4908e 75vmoveto ${x_tol} ${y_tol}
76# check that vertex is highlighted and edge is not
77checkcolor ${x_on_edge} ${y_on_edge} 1 1 0
78checkcolor $x_on_vert $y_on_vert 0 1 1
79
80vdump ${imagedir}/${casename}