1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0022785: Draw Harness - add possibility to remove a text drawn by the command vdrawtext

AIS_TextLabel - new public class to display simple text labels (based on MyTextClass private class from Draw Harness).
ViewerTest::Display() - add more reliable replacement for VDisplayAISObject() with no viewer update flag.

vdrawtext command redesign:
- Use new AIS_TextLabel class instead of private MyTextClass.
- Take object name and allow to clear labels from the Viewer.
- Use parameter name + parameter value syntax instead of strict list of mandatory arguments.
- Use [0; 1] range for colors and accept names.
- Drop redundant argument "isMultiByte".
- Support argument -noupdate to skip Viewer update.

Update test cases to new syntax of vdrawtext.
This commit is contained in:
isk
2015-05-05 11:06:29 +03:00
committed by bugmaster
parent 2b5097c676
commit 29e2c6d247
42 changed files with 837 additions and 447 deletions

View File

@@ -82,4 +82,4 @@ vsetcolor b10 0 0.48046875 0.73828125
# set material to plastic for better look
for {set i 1} {$i <= 10} {incr i} {vsetmaterial b$i plastic}
vdrawtext "Which\nbox\nis\ncloser\nto\nyou?" 0 -6 -2 0 0 0 left top 0 0 40 Bold
vdrawtext label "Which\nbox\nis\ncloser\nto\nyou?" -pos 0 -6 -2 -color 0 0 0 -halign left -valign bottom -angle 0 -zoom 0 -height 40

View File

@@ -10,30 +10,30 @@ set THE_ROW_DIST 35
proc drawLabels {} {
set x 20
set y 15
set r 25
set g 25
set b 25
set r 0.098
set g 0.098
set b 0.098
foreach aMatIter $::THE_MATERIALS {
vdrawtext "$aMatIter" $x $y 0 $r $g $b 2 1 000 0 14 1 Arial
vdrawtext "$aMatIter" "$aMatIter" -pos $x $y 0 -color $r $g $b -halign right -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
incr y 10
}
set x 40
set y 5
foreach aColIter $::THE_COLORS {
if { $aColIter == "red" } {
set r 255
set g 0
set r 1.0
set g 0.0
set b 0
} elseif { $aColIter == "green" } {
set r 0
set g 255
set b 0
set r 0.0
set g 1.0
set b 0.0
} elseif { $aColIter == "blue1" } {
set r 0
set g 0
set b 255
set r 0.0
set g 0.0
set b 1.0
}
vdrawtext "$aColIter" $x $y 0 $r $g $b 1 1 000 0 14 1 Arial
vdrawtext "$aColIter" "$aColIter" -pos $x $y 0 -color $r $g $b -halign center -valign center -angle 000 -zoom 0 -height 14 -aspect regular -font Arial
incr x $::THE_ROW_DIST
}
}