1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-30 12:14:08 +03:00
occt/tests/bugs/iges/bug22888
ski ccadc126ba 0023493: Incorrect QAGetPixelColor usage
Usage of QAGetPixelColor were checked and corrected.

Using simple comparison instead of regexp.

Improved usage of command vreadpixel for standard colors.

Command QAGetPixelColor was dropped from TKQADraw.

Procedures "checkcolor" and auxiliary "checkpoint" were moved to DrawResources/TestCommands.tcl

Some test cases using "checkcolor" for picking line color were simplified.

Procedures checkcolor and checkpoint were changed to handle situation when pixel is out of view.

Removed unnecessary use of command "vaspects -setwidth" in tests.

Revert -setwidth change in test bugs/vis/bug23525
2014-12-11 16:48:05 +03:00

59 lines
1.1 KiB
Plaintext
Executable File

puts "============"
puts "CR22888"
puts "============"
puts ""
#######################################################################
# Wrong shape result imported from IGES file
#######################################################################
pload QAcommands
set x1 166
set y1 225
igesread [locate_data_file CR22888-data.igs] a *
if { [regexp "This shape seems to be valid" [checkshape a]] != 1 } {
puts "Error : checkshape is faulty"
}
explode a f
vinit
vsetdispmode 0
vdisplay a_1
vfit
vzfit
tclean a_1
set inf_before [trinfo a_1]
vsetdispmode a_1 1
set inf_after [trinfo a_1]
regexp { +([-0-9.+eE]+) +triangles} $inf_after full tri_after
regexp { +([-0-9.+eE]+) +nodes} $inf_after full nod_after
set color [vreadpixel ${x1} ${y1} rgb]
set rd [lindex $color 0]
set gr [lindex $color 1]
set bl [lindex $color 2]
if { $rd == 0 || $gr == 0 || $bl == 0 } {
puts "Error : Face is not shaded (colors are not equal)"
}
if { $tri_after <= 0 || $nod_after <= 0 } {
puts "Error : Face is not shaded (number of nodes or triangles is wrong)"
}
set only_screen 1