mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0032208: Tests - refactor visualization tests to cover several graphic drivers
Removed testgrids 'bugs/vis' and '3rdparty'; tests have been redistributed across other grids. Moved testgrid 'v3d/ivtk' into dedicated 'vtk/ivtk'. Added testgrid 'vselect' dedicated to 3D viewer picking/selection functionality and filled with tests from 'v3d/vertex', 'v3d/face' and similar groups. Added testgrid 'opengl' dedicated to OpenGL driver low-level functionality (GLSL programs and similar) and filled with tests from 'v3d/glsl', 'v3d/raytrace', '3rdparty/fonts', 'bugs/vis' (portion) and similar. Added testgrid 'opengles3' dedicated to OpenGL ES 3.0 driver low-level functionality and reusing tests from 'opengl' testgrid. Subgroup 'opengles3/raytrace' is disabled on Windows, as Ray-Tracing currently requires OpenGL ES 3.2. while ANGLE library implements only OpenGL ES 3.0. Added testgrid 'opengles2' dedicated to OpenGL ES 2.0 driver low-level functionality and reusing a limited subset of passing tests from 'opengl' testgrid. Currently testgrid is activated only on Windows platform when using ANGLE library (properietary OpenGL ES drivers do not allow creation of restricted 2.0 context). Test cases have been cleaned out to put bug description into log, to properly load necessary plugins and to explicitly dump viewer.
This commit is contained in:
12
tests/opengl/data/background/bug1188
Normal file
12
tests/opengl/data/background/bug1188
Normal file
@@ -0,0 +1,12 @@
|
||||
puts "================"
|
||||
puts "0001188: Impossible to set background image for V3d_View"
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
|
||||
vbackground -image [locate_data_file OCC1188.gif]
|
||||
if { [vreadpixel 200 200 rgb name] != "WHITE" } { puts "Error: image background is not set" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
75
tests/opengl/data/background/bug21747
Normal file
75
tests/opengl/data/background/bug21747
Normal file
@@ -0,0 +1,75 @@
|
||||
puts "============"
|
||||
puts "OCC21747"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
|
||||
puts "Type=NONE, Color from RED to BLUE"
|
||||
vbackground -gradient RED BLUE -gradientMode NONE
|
||||
vdump $imagedir/${casename}_none.png
|
||||
|
||||
puts "Type=HORIZONTAL, Color from RED to BLUE, Direction from LEFT to RIGHT"
|
||||
vbackground -gradient RED BLUE -gradientMode HORIZONTAL
|
||||
vdump $imagedir/${casename}_hor1.png
|
||||
|
||||
puts "Type=HORIZONTAL, Color from BLUE to RED, Direction from LEFT to RIGHT"
|
||||
vbackground -gradient BLUE RED -gradientMode HORIZONTAL
|
||||
vdump $imagedir/${casename}_hor2.png
|
||||
|
||||
puts "Type=VERTICAL, Color from RED to BLUE, Direction from TOP to BOTTOM"
|
||||
vbackground -gradient RED BLUE -gradientMode VERTICAL
|
||||
vdump $imagedir/${casename}_vert1.png
|
||||
|
||||
puts "Type=VERTICAL, Color from BLUE to RED, Direction from TOP to BOTTOM"
|
||||
vbackground -gradient BLUE RED -gradientMode VERTICAL
|
||||
vdump $imagedir/${casename}_vert2.png
|
||||
|
||||
puts "Type=DIAGONAL1, Color from RED to BLUE, Direction from LEFT TOP CORNER to RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode DIAGONAL1
|
||||
vdump $imagedir/${casename}_diag1.png
|
||||
|
||||
puts "Type=DIAGONAL1, Color from BLUE to RED, Direction from LEFT TOP CORNER to RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode DIAGONAL1
|
||||
vdump $imagedir/${casename}_diag2.png
|
||||
|
||||
puts "Type=DIAGONAL2, Color from RED to BLUE, Direction from RIGHT TOP CORNER to LEFT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode DIAGONAL2
|
||||
vdump $imagedir/${casename}_diag3.png
|
||||
|
||||
puts "Type=DIAGONAL2, Color from BLUE to RED, Direction from RIGHT TOP CORNER to LEFT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode DIAGONAL2
|
||||
vdump $imagedir/${casename}_diag4.png
|
||||
|
||||
puts "Type=CORNER1, Color from RED to BLUE, Direction from LEFT TOP CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER1
|
||||
vdump $imagedir/${casename}_corn1.png
|
||||
|
||||
puts "Type=CORNER2, Color from RED to BLUE, Direction from RIGHT TOP CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER2
|
||||
vdump $imagedir/${casename}_corn2.png
|
||||
|
||||
puts "Type=CORNER3, Color from RED to BLUE, Direction from RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER3
|
||||
vdump $imagedir/${casename}_corn3.png
|
||||
|
||||
puts "Type=CORNER4, Color from RED to BLUE, Direction from LEFT BOTTOM CORNER"
|
||||
vbackground -gradient RED BLUE -gradientMode CORNER4
|
||||
vdump $imagedir/${casename}_corn4.png
|
||||
|
||||
puts "Type=CORNER1, Color from BLUE to RED, Direction from LEFT TOP CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER1
|
||||
vdump $imagedir/${casename}_corn5.png
|
||||
|
||||
puts "Type=CORNER2, Color from BLUE to RED, Direction from RIGHT TOP CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER2
|
||||
vdump $imagedir/${casename}_corn6.png
|
||||
|
||||
puts "Type=CORNER3, Color from BLUE to RED, Direction from RIGHT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER3
|
||||
vdump $imagedir/${casename}_corn7.png
|
||||
|
||||
puts "Type=CORNER4, Color from BLUE to RED, Direction from LEFT BOTTOM CORNER"
|
||||
vbackground -gradient BLUE RED -gradientMode CORNER4
|
||||
vdump $imagedir/${casename}_corn8.png
|
28
tests/opengl/data/background/bug23102
Normal file
28
tests/opengl/data/background/bug23102
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "================"
|
||||
puts "OCC23102: Change the algorithm of rendering the 3d viewer background using tiled texture"
|
||||
puts "================"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
vbackground -image [locate_data_file OCC23102.bmp] -imageMode TILED
|
||||
|
||||
set x1 58
|
||||
set y1 4
|
||||
set R_bg 0.70196002721786499
|
||||
set G_bg 0.78039199113845825
|
||||
set B_bg 0.86274499999999998
|
||||
|
||||
set WrongColor "$R_bg $G_bg $B_bg"
|
||||
|
||||
set Color [vreadpixel ${x1} ${y1} rgb]
|
||||
|
||||
# Resume
|
||||
puts ""
|
||||
if { "[vreadpixel ${x1} ${y1} rgb]" != "$WrongColor" } {
|
||||
puts "OK OCC23102"
|
||||
} else {
|
||||
puts "Faulty OCC23102"
|
||||
}
|
||||
|
||||
vdump $imagedir/${casename}.png
|
19
tests/opengl/data/background/bug23363
Normal file
19
tests/opengl/data/background/bug23363
Normal file
@@ -0,0 +1,19 @@
|
||||
puts "============"
|
||||
puts "0023363: Lost gradient background when switching to the hollow interior style"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vbackground -gradient FA0000 GREEN -gradientMode VERTICAL
|
||||
pcylinder p 100 200
|
||||
vdisplay -dispMode 1 p
|
||||
vaspects p -setInteriorStyle HOLLOW -setDrawEdges 1
|
||||
|
||||
set color1 [vreadpixel 10 0 rgb]
|
||||
set rd1 [lindex $color1 0]
|
||||
if { $rd1 == 0 } { puts "Faulty ${BugNumber}" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
24
tests/opengl/data/background/bug25475
Normal file
24
tests/opengl/data/background/bug25475
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "============"
|
||||
puts "0025475: Visualization, TKOpenGl - draw background using primitive arrays"
|
||||
puts "Tests textured background"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
set aTextureFile [locate_data_file hatch_1.png]
|
||||
|
||||
pload VISUALIZATION
|
||||
vinit View1
|
||||
|
||||
vbackground -image $aTextureFile -imageMode STRETCH
|
||||
vdump $imagedir/${casename}_1.png
|
||||
|
||||
vbackground -image $aTextureFile -imageMode NONE
|
||||
vbackground -image $aTextureFile -imageMode TILED
|
||||
vdump $imagedir/${casename}_2.png
|
||||
|
||||
vbackground -gradient RED BLUE -gradientMode HORIZONTAL
|
||||
vbackground -image $aTextureFile -imageMode CENTERED
|
||||
vdump $imagedir/${casename}_3.png
|
||||
|
||||
vbackground -image $aTextureFile -imageMode NONE
|
||||
vdump $imagedir/${casename}_4.png
|
16
tests/opengl/data/background/bug25775
Normal file
16
tests/opengl/data/background/bug25775
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "0025775: Default Gradient Background in V3d_Viewer has no effect in new created V3d_View"
|
||||
puts "========"
|
||||
puts ""
|
||||
|
||||
pload VISUALIZATION
|
||||
vbackground -default -gradient BLACK GRAY25 -gradientMode HORIZONTAL
|
||||
vinit View1 w=400 h=400
|
||||
if { [vreadpixel 399 100 -rgb -name] != "GRAY25" } { puts "Error: bug with default gradient color is reproduced." }
|
||||
|
||||
vinit View2 w=400 h=400
|
||||
if { [vreadpixel 399 100 -rgb -name] != "GRAY25" } { puts "Error: bug with default gradient color is reproduced." }
|
||||
|
||||
vbackground -default -color GRAY50
|
||||
vinit View3
|
||||
if { [vreadpixel 100 100 -rgb -name] != "GRAY50" } { puts "Error: bug with default background color is reproduced." }
|
22
tests/opengl/data/background/bug26599
Normal file
22
tests/opengl/data/background/bug26599
Normal file
@@ -0,0 +1,22 @@
|
||||
puts "============"
|
||||
puts "CR26599: Visualization, TKOpenGl - gradient background should reset model transformation in Core profile"
|
||||
puts "============"
|
||||
puts ""
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
vinit View1
|
||||
vclear
|
||||
vaxo
|
||||
|
||||
vbackground -gradient RED BLUE -gradientMode VERTICAL
|
||||
box b 1 2 3
|
||||
vdisplay b
|
||||
|
||||
vfit
|
||||
|
||||
vlocation b -rotate 0 0 0 0 0 1 50
|
||||
|
||||
vmoveto 380 50
|
||||
checkcolor 380 50 0.87450981140136719 0 0.12156862765550613
|
||||
|
||||
vdump ${imagedir}/${casename}.png
|
24
tests/opengl/data/background/bug27836
Normal file
24
tests/opengl/data/background/bug27836
Normal file
@@ -0,0 +1,24 @@
|
||||
puts "========"
|
||||
puts "Gradient background is lost at some camera positions"
|
||||
puts "========"
|
||||
|
||||
# Test case setup the camera in such a position,
|
||||
# so that background plane will be clipped by Z-range if not handled by Z-fit.
|
||||
|
||||
pload MODELING VISUALIZATION
|
||||
box b 0 0 -100 100 90 10
|
||||
|
||||
vclear
|
||||
vinit View1
|
||||
vaxo
|
||||
vbackground -gradient B4C8FF B4B4B4 -gradientMode VERTICAL
|
||||
vzbufftrihedron
|
||||
vdisplay -dispMode 1 b
|
||||
vsetlocation b 0 0 1000
|
||||
vfit
|
||||
|
||||
vviewparams -scale 6.66 -eye 48 43 -210 -at 50 45 -95
|
||||
|
||||
if { [vreadpixel 100 300 -rgb -name] != "GRAY75" } { puts "Error: gradient background is not displayed" }
|
||||
|
||||
vdump $imagedir/${casename}.png
|
Reference in New Issue
Block a user