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

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.
This commit is contained in:
kgv
2021-07-09 23:22:29 +03:00
parent cb7f92396f
commit 06d40093b7
44 changed files with 916 additions and 925 deletions

View File

@@ -62,9 +62,9 @@ vrenderparams -rayTrace -fsaa on -reflections off -shadows off
vcamera -persp -fovy 25
vviewparams -eye 14 -14 6.8 -up 0 0 1 -at 4 -4 0 -scale 70
vsetdispmode 1
vlight def
vlight add directional direction 1 -2 -10 head 1 color white
vlight add directional direction 0 -10 0 head 1 color white
vlight -defaults
vlight dirlight1 -type DIRECTIONAL -direction 1 -2 -10 -head 1 -color WHITE
vlight dirlight2 -type DIRECTIONAL -direction 0 -10 0 -head 1 -color WHITE
# display boxes
vdisplay b1 b2 b3 b4 b5 b6 b7 b8 b9 b10

View File

@@ -243,17 +243,15 @@ ttranslate crpk_47 18.0 27.6 0
eval compound $lrpk brpk
# show result in plain 3d viewer
# show result in 3d viewer
vinit View1
vclear
vsetdispmode 1
vrenderparams -msaa 8
vlight -clear
vlight amblight -type AMBIENT
vlight dirlight -type DIRECTIONAL -direction 1 -1 -2 -head 1
if [info exists i7_show_3dview] {
vinit Driver1/Viewer1/View1
vclear
vsetdispmode 1
vrenderparams -msaa 8
vlight clear
vlight add amb
vlight add directional direction 1 -1 -2 head 1
vdisplay case
vsetcolor case GRAY70
@@ -318,12 +316,8 @@ XSetColor D rpk1 GRAY70
XSetColor D rpk2 80664D
XSetColor D rpk3 GRAY70
XShow D
vlight clear
vlight add amb
vlight add directional direction 1 -1 -2 head 1
vsetdispmode 1
vrenderparams -msaa 8
# display in 3D Viewer
XDisplay -dispMode 1 D -explore
vfit
# save to STEP if variable i7_save_xde is defined (specifies file name)

View File

@@ -59,10 +59,10 @@ for {set i 0} {$i < 12} {incr i} {
}
# Configure light sources
vlight -change 0 -head 0
vlight -change 0 -headLight 0
vlight -change 0 -direction -0.25 -1 -1
vlight -change 0 -sm 0.3
vlight -change 0 -int 10.0
vlight -change 0 -smoothAngle 17
vlight -change 0 -intensity 10.0
# Load environment map
vtextureenv on 1

View File

@@ -15,7 +15,7 @@ vglinfo
# setup light sources
vlight -clear
vlight -add positional -head 0 -pos 0.5 0.5 0.85 -sm 0.06 -int 30.0
vlight -add POSITIONAL -headLight 0 -pos 0.5 0.5 0.85 -smoothRadius 0.06 -intensity 30.0 -name pntlight
vvbo 0
vsetdispmode 1

View File

@@ -211,8 +211,8 @@ vviewparams -size 170.508
# Restore light source parameters
vlight -clear
vlight -add ambient
vlight -add directional -direction -0.303949 -0.434084 -0.848048 -smoothness 0.3 -intensity 12
vlight -add AMBIENT -name amblight
vlight -add DIRECTIONAL -direction -0.303949 -0.434084 -0.848048 -smoothAngle 17 -intensity 12 -name dirlight
# Load environment map
vtextureenv on 1

View File

@@ -31,7 +31,7 @@ vsetcolor glass brown
vsettransparency glass 0.6
# add light source for shadows
vlight new spot pos -100 -100 300
vlight spot -type SPOT -pos -100 -100 300
# set white background and fit view
vbackground -color WHITE