1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00
isk 29e2c6d247 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.
2015-05-06 15:06:47 +03:00

31 lines
814 B
Plaintext

puts "============"
puts "OCC24181 Render text as BRep (composite curve)"
puts "============"
puts ""
pload MODELING
pload VISUALIZATION
set THE_TEXT "The quick brown fox\njumps over the lazy dog!"
set THE_FONT_NAME Times-Roman
set THE_FONT_SIZES {12 18 24}
vsetdispmode 1
vtop
set aLine 0
set aLineId 0
foreach aSize $THE_FONT_SIZES {
set aText "\[$aSize\] $THE_TEXT"
vpoint aPnt_$aSize 0.0 $aLine 0.0
vdrawtext "Line_$aLineId" $aText -pos 0.0 $aLine 0.0 -color 0.0 1.0 1.0 -halign left -valign top -angle 000 -zoom 1 -height $aSize -aspect bolditalic -font $THE_FONT_NAME
text2brep aBText_$aSize $aText $THE_FONT_NAME $aSize bolditalic composite=1
ttranslate aBText_$aSize 0.0 $aLine 0.0
vdisplay aBText_$aSize
set aLine [expr $aLine - 4.0 * $aSize]
set aLineId [expr $aLineId + 1]
}
vfit