Files
OCCT/tests/bugs/xde/bug22982
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

91 lines
2.0 KiB
Plaintext
Executable File

puts "TODO ?OCC11111 ALL: Error on Record"
puts "TODO ?OCC11111 ALL: Error : Colors are not equal"
puts "TODO ?OCC11111 ALL: \\*\\* Exception"
pload QAcommands
puts "============"
puts "OCC22982"
puts "============"
puts ""
##################################################################
# Generic color is overriden in STEPCAFControl_Writer::WriteColors
##################################################################
set BugNumber OCC22982
pload DCAF
NewDocument D11 MDTV-XCAF
UndoLimit D11 100
# Open a transaction
NewCommand D11
set fileNameAir [locate_data_file OCC22982-Air.step]
set status 0
if { [catch { ReadStep D11 $fileNameAir } catch_result] } {
puts "Faulty ${BugNumber} : there is reading problem"
set status 1
}
XSetColor D11 0:1:1:1 0 0 1
XSetColor D11 0:1:1:1:1 1 0 0
XUnsetColor D11 0:1:1:1:2 s
XUnsetColor D11 0:1:1:1:3 s
set XRedCoords {2 148 179 204}
set XRedCoords [split $XRedCoords " "]
set YRedCoords {177 54 166 78}
set YRedCoords [split $YRedCoords " "]
set XBlueCoords {238 315 406 347 369 204 171 62}
set XBlueCoords [split $XBlueCoords " "]
set YBlueCoords {171 87 188 174 290 286 237 303}
set YBlueCoords [split $YBlueCoords " "]
XShow D11
vfit
for {set i 0} {$i < [llength $XRedCoords]} {incr i} {
set XCoord [lindex $XRedCoords $i]
set YCoord [lindex $YRedCoords $i]
checkcolor $XCoord $YCoord 1 0 0
}
# Close/Open a transaction
NewCommand D11
if { [catch { WriteStep D11 ${imagedir}/${test_image}.step } catch_result] } {
puts "Faulty ${BugNumber} : there is writing problem"
set status 1
}
NewDocument D2 MDTV-XCAF
UndoLimit D2 100
# Close/Open a transaction
NewCommand D2
if { [catch { ReadStep D2 ${imagedir}/${test_image}.step } catch_result] } {
puts "Faulty ${BugNumber} : there is reading problem"
set status 1
}
XShow D2
vfit
for {set i 0} {$i < [llength $XBlueCoords]} {incr i} {
set XCoord [lindex $XBlueCoords $i]
set YCoord [lindex $YBlueCoords $i]
checkcolor $XCoord $YCoord 0 0 1
}
if { $status != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}
set 3dviewer 0