0025235: Draw Harness - improve commands vdimension and vdimparam
[occt.git] / tests / bugs / vis / bug24351_3
1 puts "============"
2 puts "CR24351"
3 puts "============"
4 puts ""
5 #######################################################################
6 #  Test AIS Radius dimensions: label position and arrow orientation
7 #######################################################################
8 pload VISUALIZATION
9
10 vinit
11 vright
12
13 set hpos "left hcenter"
14 set vpos "above vcenter below"
15
16 # ---------------------------------------------------------------------
17 # create dimensions with different arrow orientation and fit algorithm
18 # ---------------------------------------------------------------------
19
20 # test forced internal arrow orientation
21 vpoint  circle1_p1 0  0 30
22 vpoint  circle1_p2 30 0  0
23 vpoint  circle1_p3 60 0 30
24 vcircle circle1 circle1_p1 circle1_p2 circle1_p3 0
25 vdimension rad1 -radius -shapes circle1 -text 3d -plane zox -label hfit -flyout 0 -arrow internal
26
27 # test forced external arrow orientation
28 vpoint  circle2_p1 100 0 35
29 vpoint  circle2_p2 135 0  0
30 vpoint  circle2_p3 170 0 35
31 vcircle circle2 circle2_p1 circle2_p2 circle2_p3 0
32 vdimension rad2 -radius -shapes circle2 -text 3d -plane zox -label hfit -flyout 0 -arrow external
33
34 # test that auto-fit for arrow places them externally for small geometry
35 vpoint  circle3_p1 0  0 113
36 vpoint  circle3_p2 33 0  80
37 vpoint  circle3_p3 66 0 113
38 vcircle circle3 circle3_p1 circle3_p2 circle3_p3 0
39 vdimension rad3 -radius -shapes circle3 -text 3d -plane zox -label hcenter -flyout 0 -arrow fit
40
41 # test that auto-fit for text places the label externally for small geometry
42 vpoint  circle4_p1 120 0 95
43 vpoint  circle4_p2 135 0 80
44 vpoint  circle4_p3 150 0 95
45 vcircle circle4 circle4_p1 circle4_p2 circle4_p3 0
46 vdimension rad4 -radius -shapes circle4 -text 3d -plane zox -label hfit -flyout 0 -arrow fit
47 vfit
48
49 # ------------------------------------------------
50 # create dimension with different label positions
51 # ------------------------------------------------
52
53 vinit Viewer2/View2
54 vright
55
56 set idx 0
57 for {set r 0} {$r < 3} {incr r} {
58   for {set c 0} {$c < 2} {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     set circle c_[expr "$idx"]
64
65     vpoint $point1 [expr "90.0 * $c +  0"] 0.0 [expr "80.0 * $r + 33"]
66     vpoint $point2 [expr "90.0 * $c + 33"] 0.0 [expr "80.0 * $r +  0"]
67     vpoint $point3 [expr "90.0 * $c + 66"] 0.0 [expr "80.0 * $r + 33"]
68     vcircle $circle $point1 $point2 $point3 0
69
70     set dimension r_$idx
71
72     vdimension $dimension -radius -shapes $circle -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 0.0
73     vdisplay $dimension
74
75     incr idx
76   }
77 }
78 vfit
79
80 set only_screen 1