1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-30 12:14:08 +03:00
occt/tests/bugs/vis/bug232
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

85 lines
1.8 KiB
Plaintext
Executable File

puts "========"
puts "OCC232"
puts "Pick filter does NOT work for TopAbs_COMPSOLID topology"
puts "========"
vinit
OCC232
vfit
# selected point of first CompSolid
set x1 69
set y1 204
set x2 116
set y2 231
#set x3 160; set y3 257 - it's bad for lin,aki.
set x3 159
set y3 256
# selected point of second CompSolid
set x4 298
set y4 76
set x5 339
set y5 100
set x6 381
set y6 124
set Cyan_R 0
set Cyan_G 1
set Cyan_B 1
set Cyan "$Cyan_R $Cyan_G $Cyan_B"
set Yellow_R 1
set Yellow_G 1
set Yellow_B 0
set Yellow "$Yellow_R $Yellow_G $Yellow_B"
# There is not selection
puts "There is not selection"
set result11 [regexp "$Yellow" [vreadpixel $x1 $y1 rgb]]
set result12 [regexp "$Yellow" [vreadpixel $x2 $y2 rgb]]
set result13 [regexp "$Yellow" [vreadpixel $x3 $y3 rgb]]
set result14 [regexp "$Yellow" [vreadpixel $x4 $y4 rgb]]
set result15 [regexp "$Yellow" [vreadpixel $x5 $y5 rgb]]
set result16 [regexp "$Yellow" [vreadpixel $x6 $y6 rgb]]
# Move a mouse
puts "Move a mouse"
vmoveto $x2 $y2
# Second box of first CompSolid is selected
puts "Second box of first CompSolid is selected"
set result21 [regexp "$Yellow" [vreadpixel $x1 $y1 rgb]]
set result22 [regexp "$Yellow" [vreadpixel $x3 $y3 rgb]]
set result23 [regexp "$Yellow" [vreadpixel $x4 $y4 rgb]]
set result24 [regexp "$Yellow" [vreadpixel $x5 $y5 rgb]]
set result25 [regexp "$Yellow" [vreadpixel $x6 $y6 rgb]]
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
set result31 [regexp "$Cyan" [vreadpixel $x2 $y2 rgb]]
if { $result31 == 0 } {
set IsFaulty 1
}
}
set IsFaulty 0
if { !($result11 && $result12 && $result13 && $result14 && $result15 && $result16)
|| !($result21 && $result22 && $result23 && $result24 && $result25) } {
set IsFaulty 1
}
if {$IsFaulty != 0} {
puts "Error : OCC232"
}
set only_screen 1