mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
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.
72 lines
1.5 KiB
Plaintext
72 lines
1.5 KiB
Plaintext
puts "========"
|
|
puts "OCC24819: TKOpenGl - extend the ray-tracing core by visualization of lines, text and point sprites"
|
|
puts "========"
|
|
|
|
# setup 3D viewer content
|
|
vinit name=View1 w=512 h=512
|
|
vglinfo
|
|
|
|
vvbo 0
|
|
vsetdispmode 1
|
|
vsetgradientbg 180 200 255 180 180 180 2
|
|
# boxes
|
|
box b1 1 1 1
|
|
vdisplay b1
|
|
vsetlocation b1 0 0 0.001
|
|
vsetmaterial b1 Silver
|
|
vsettransparency b1 0.5
|
|
box b2 3 2 2 1 2 1
|
|
vdisplay b2
|
|
vsetmaterial b2 Pewter
|
|
vsettransparency b2 0.8
|
|
|
|
# brep text
|
|
text2brep t "text" "Arial" 8
|
|
vdisplay t
|
|
|
|
# overlay objects
|
|
voverlaytext "Overlay text!" 200 440 40
|
|
|
|
# markers
|
|
vpoint p 1 1 1
|
|
vdisplay p
|
|
vmarkerstest mTest 7 -3 0 PointsOnSide=5 MarkerType=5
|
|
|
|
# 3d text
|
|
vdrawtext text0 3D_Text -pos 1 2 2 -color 1.0 0.0 0.0 -halign left -valign bottom -angle 0 -zoom 0 -height 20 -aspect regular
|
|
|
|
vlight change 0 pos -1 1 1
|
|
|
|
vfit
|
|
|
|
# trihedron
|
|
vzbufftrihedron
|
|
|
|
# activate ray-tracing
|
|
vrenderparams -raytrace
|
|
|
|
# orthogonal projection
|
|
set aModeNum 0
|
|
foreach aFSAAMode {on off} {
|
|
foreach aReflMode {on off} {
|
|
foreach aShadMode {on off} {
|
|
vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode
|
|
vdump $imagedir/${casename}_${aModeNum}.png
|
|
incr aModeNum
|
|
}
|
|
}
|
|
}
|
|
|
|
# perspective projection
|
|
vcamera -persp
|
|
set aModeNum 0
|
|
foreach aFSAAMode {on off} {
|
|
foreach aReflMode {on off} {
|
|
foreach aShadMode {on off} {
|
|
vrenderparams -shadows $aShadMode -reflections $aReflMode -fsaa $aFSAAMode
|
|
vdump $imagedir/${casename}_${aModeNum}.png
|
|
incr aModeNum
|
|
}
|
|
}
|
|
}
|