Files
OCCT/tests/bugs/vis/bug24351_1
isk 6fb1a930e2 0024387: Tests - use system-independent fonts in test cases
Add a new parameter "-font FontName" to the command "vdimension".
Tuning of test-cases
2015-08-27 15:30:18 +03:00

76 lines
2.3 KiB
Plaintext

puts "============"
puts "CR24351"
puts "============"
puts ""
#######################################################################
# Test AIS Length dimensions: label position and arrow orientation
#######################################################################
pload VISUALIZATION
vfont add [locate_data_file DejaVuSans.ttf] SansFont
vinit
vright
set hpos "left hcenter right"
set vpos "above vcenter below"
# ---------------------------------------------------------------------
# create dimensions with different arrow orientation and fit algorithm
# ---------------------------------------------------------------------
vpoint arrow_p1 0 0 0
vpoint arrow_p2 50 0 0
vpoint arrow_p3 100 0 0
vpoint arrow_p4 150 0 0
vpoint arrow_p5 100 0 50
vpoint arrow_p6 127 0 50
vpoint arrow_p7 0 0 50
vpoint arrow_p8 10 0 50
# test forced internal arrow orientation
vdimension arrow_d1 -length -shapes arrow_p1 arrow_p2 -text 3d -plane zox -label hfit -flyout 10.0 -arrow internal -font SansFont
# test forced external arrow orientation
vdimension arrow_d2 -length -shapes arrow_p3 arrow_p4 -text 3d -plane zox -label hfit -flyout 10.0 -arrow external -font SansFont
# test that auto-fit for arrow places them externally for small geometry
vdimension arrow_d3 -length -shapes arrow_p5 arrow_p6 -text 3d -plane zox -label hcenter -flyout 10.0 -arrow fit -font SansFont
# test that auto-fit for text places the label externally for small geometry
vdimension arrow_d4 -length -shapes arrow_p7 arrow_p8 -text 3d -plane zox -label hfit -flyout 10.0 -arrow fit -font SansFont
vfit
# ------------------------------------------------
# create dimension with different label positions
# ------------------------------------------------
vinit Viewer2/View2
vright
set idx 0
for {set r 0} {$r < 3} {incr r} {
for {set c 0} {$c < 3} {incr c} {
set point1 p_[expr "$idx * 2 + 0"]
set point2 p_[expr "$idx * 2 + 1"]
vpoint $point1 [expr "50.0 * ($c*2 + 0)"] 0.0 [expr "50.0 * $r"]
vpoint $point2 [expr "50.0 * ($c*2 + 1)"] 0.0 [expr "50.0 * $r"]
set dimension d_$idx
vdimension $dimension -length -shapes $point1 $point2 -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 10.0 -font SansFont
vdisplay $dimension
incr idx
}
}
vfit
set only_screen 1