1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/tests/v3d/light_source/manipulator
kgv 06d40093b7 0032121: Draw Harness, ViewerTest - implement -reset option for vlight command
vlight command has been revised to provide more friendly syntax.
Command now accepts light index or name as first argument.
Added arguments -enable/-disable for managing enabled state.
Added argument -reset to reset light parameters to default values.

V3d_Viewer::SetDefaultLights() now sets names "headlight" and "ambient" to created lights.
Graphic3d_TypeOfLightSource enumeration values have been renamed to avoid shortcuts.
Draw::Atof(), applied corrections to avoid explicit new/delete calls.
2021-07-12 20:50:25 +03:00

51 lines
1.5 KiB
Plaintext

puts "==================================================="
puts "0031704: Visualization - add an interactive object AIS_LightSource representing a light source"
puts "==================================================="
pload MODELING VISUALIZATION
vclear
vinit View1
vlight -clear
vbackground -color GRAY
vrenderparams -shadingModel PHONG
vlight amblight -type AMBIENT -color WHITE -intensity 0.1
box b 0 0 0 30 30 30
vdisplay b -dispMode 1
vsetmaterial b Brass
vfit
vlight aSpotLight -type SPOTLIGHT -pos 15 -10 15 -dir 0 1 0 -color RED -display
puts "=== Attach manipulator ==="
vmanipulator m -attach aSpotLight -adjustPosition location
vdump $imagedir/${casename}_manip.png
puts "=== Test manipulator - rotation ==="
vmanipulator m -followRotation 1
set mouse_pick_rotate {128 231}
set mouse_drag_rotate {98 200}
vmoveto {*}$mouse_pick_rotate
vselect {*}$mouse_pick_rotate
vmanipulator m -startTransform {*}$mouse_pick_rotate
vmanipulator m -transform {*}$mouse_drag_rotate
vmanipulator m -stopTransform
vselect 0 0
vmoveto {*}$mouse_drag_rotate
vdump $imagedir/${casename}_rot.png
puts "=== Test manipulator - translation ==="
set mouse_pick_translate {87 315}
set mouse_drag_translate {167 358}
vmoveto {*}$mouse_pick_translate
vselect {*}$mouse_pick_translate
vmanipulator m -startTransform {*}$mouse_pick_translate
vmanipulator m -transform {*}$mouse_drag_translate
vmanipulator m -stopTransform
vselect 0 0
vmoveto {*}$mouse_drag_translate
vmanipulator m -detach
vremove aSpotLight
vdump $imagedir/${casename}_trans.png