0024387: Tests - use system-independent fonts in test cases
[occt.git] / tests / bugs / vis / bug24351_4
... / ...
CommitLineData
1puts "============"
2puts "CR24351"
3puts "============"
4puts ""
5#######################################################################
6# Test AIS angle dimensions: label position and arrow orientation
7#######################################################################
8pload VISUALIZATION
9
10vfont add [locate_data_file DejaVuSans.ttf] SansFont
11
12vinit
13vright
14
15set hpos "left hcenter right"
16set vpos "above vcenter below"
17
18# ---------------------------------------------------------------------
19# create dimensions with different arrow orientation and fit algorithm
20# ---------------------------------------------------------------------
21
22# test forced internal arrow orientation
23vpoint angle1_p1 0 0 40
24vpoint angle1_p2 0 0 0
25vpoint angle1_p3 40 0 0
26vdimension ang1 -angle -shapes angle1_p1 angle1_p2 angle1_p3 -text 3d -plane zox -label hfit -flyout 40.0 -arrow internal -font SansFont
27
28# test forced external arrow orientation
29vpoint angle2_p1 80 0 40
30vpoint angle2_p2 80 0 0
31vpoint angle2_p3 120 0 0
32vdimension ang2 -angle -shapes angle2_p1 angle2_p2 angle2_p3 -text 3d -plane zox -label hfit -flyout 40.0 -arrow external -font SansFont
33
34# test that auto-fit for arrow places them externally for small geometry
35vpoint angle3_p1 0 0 100
36vpoint angle3_p2 0 0 80
37vpoint angle3_p3 20 0 80
38vdimension ang3 -angle -shapes angle3_p1 angle3_p2 angle3_p3 -text 3d -plane zox -label hcenter -flyout 20.0 -arrow fit -font SansFont
39
40# test that auto-fit for text places the label externally for small geometry
41vpoint angle4_p1 85 0 100
42vpoint angle4_p2 85 0 85
43vpoint angle4_p3 100 0 85
44vdimension ang4 -angle -shapes angle4_p1 angle4_p2 angle4_p3 -text 3d -plane zox -label hfit -flyout 15.0 -arrow fit -font SansFont
45
46vdisplay ang1 ang2 ang3 ang4
47vfit
48
49# ------------------------------------------------
50# create dimension with different label positions
51# ------------------------------------------------
52
53vinit Viewer2/View2
54vright
55
56set idx 0
57for {set r 0} {$r < 3} {incr r} {
58 for {set c 0} {$c < 3} {incr c} {
59
60 set point1 p_[expr "$idx * 3 + 0"]
61 set point2 p_[expr "$idx * 3 + 1"]
62 set point3 p_[expr "$idx * 3 + 2"]
63
64 vpoint $point1 [expr "60.0 * $c + 0"] 0.0 [expr "60.0 * $r + 40"]
65 vpoint $point2 [expr "60.0 * $c + 0"] 0.0 [expr "60.0 * $r + 0"]
66 vpoint $point3 [expr "60.0 * $c + 40"] 0.0 [expr "60.0 * $r + 0"]
67
68 set dimension r_$idx
69
70 vdimension $dimension -angle -shapes $point1 $point2 $point3 -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 40.0 -font SansFont
71 vdisplay $dimension
72
73 incr idx
74 }
75}
76vfit
77
78set only_screen 1