0024387: Tests - use system-independent fonts in test cases
[occt.git] / tests / bugs / vis / bug24351_1
CommitLineData
1d7ca641 1puts "============"
2puts "CR24351"
3puts "============"
4puts ""
5#######################################################################
6# Test AIS Length dimensions: label position and arrow orientation
7#######################################################################
8pload VISUALIZATION
9
6fb1a930 10vfont add [locate_data_file DejaVuSans.ttf] SansFont
11
1d7ca641 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
22vpoint arrow_p1 0 0 0
23vpoint arrow_p2 50 0 0
24
25vpoint arrow_p3 100 0 0
26vpoint arrow_p4 150 0 0
27
fe83e1ea 28vpoint arrow_p5 100 0 50
29vpoint arrow_p6 127 0 50
1d7ca641 30
fe83e1ea 31vpoint arrow_p7 0 0 50
32vpoint arrow_p8 10 0 50
1d7ca641 33
fe83e1ea 34# test forced internal arrow orientation
6fb1a930 35vdimension arrow_d1 -length -shapes arrow_p1 arrow_p2 -text 3d -plane zox -label hfit -flyout 10.0 -arrow internal -font SansFont
fe83e1ea 36
37# test forced external arrow orientation
6fb1a930 38vdimension arrow_d2 -length -shapes arrow_p3 arrow_p4 -text 3d -plane zox -label hfit -flyout 10.0 -arrow external -font SansFont
fe83e1ea 39
40# test that auto-fit for arrow places them externally for small geometry
6fb1a930 41vdimension arrow_d3 -length -shapes arrow_p5 arrow_p6 -text 3d -plane zox -label hcenter -flyout 10.0 -arrow fit -font SansFont
fe83e1ea 42
43# test that auto-fit for text places the label externally for small geometry
6fb1a930 44vdimension arrow_d4 -length -shapes arrow_p7 arrow_p8 -text 3d -plane zox -label hfit -flyout 10.0 -arrow fit -font SansFont
fe83e1ea 45
1d7ca641 46vfit
47
48# ------------------------------------------------
49# create dimension with different label positions
50# ------------------------------------------------
51
52vinit Viewer2/View2
53vright
54
55set idx 0
56for {set r 0} {$r < 3} {incr r} {
57 for {set c 0} {$c < 3} {incr c} {
58
59 set point1 p_[expr "$idx * 2 + 0"]
60 set point2 p_[expr "$idx * 2 + 1"]
61
62 vpoint $point1 [expr "50.0 * ($c*2 + 0)"] 0.0 [expr "50.0 * $r"]
63 vpoint $point2 [expr "50.0 * ($c*2 + 1)"] 0.0 [expr "50.0 * $r"]
64
65 set dimension d_$idx
66
6fb1a930 67 vdimension $dimension -length -shapes $point1 $point2 -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 10.0 -font SansFont
1d7ca641 68 vdisplay $dimension
69
70 incr idx
71 }
72}
73vfit
74
75set only_screen 1