1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00
Files
occt/tests/bugs/vis/bug27573
kgv 61f73653ba 0030915: Visualization - AIS_ColorScale::FindColor() returns Wrong color for maximal value
Map the very upper value (theValue==theMax) to the largest color interval.
2019-08-26 15:16:14 +03:00

31 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

puts "============"
puts "0027573: AIS_ColorScale::FindColor does not take into account custom colors."
puts "============"
puts ""
vclose all
vinit View1
vclear
vaxo
vcolorscale cs -demo
vcolorscale cs -range 0 20 5
# Set user-defined colors and labels for color scale
vcolorscale cs -colors white red green blue1 gray
vdump ${imagedir}/${casename}_pos.png
if {[vcolorscale cs -findcolor 0] != "WHITE"} { puts "ERROR: wrong 1st segment сolor" }
if {[vcolorscale cs -findcolor 4] != "RED"} { puts "ERROR: wrong color on border between 1st and 2nd segments" }
if {[vcolorscale cs -findcolor 5] != "RED"} { puts "ERROR: wrong 2nd segment color" }
if {[vcolorscale cs -findcolor 9] != "GREEN"} { puts "ERROR: wrong 3rd segment color" }
if {[vcolorscale cs -findcolor 20] != "GRAY"} { puts "ERROR: wrong last segment color at border" }
# Check negative value limits
vcolorscale cs -range -5 5 5
vdump ${imagedir}/${casename}_neg.png
if {[vcolorscale cs -findcolor -5] != "WHITE"} { puts "ERROR: wrong first segment color" }
if {[vcolorscale cs -findcolor 0] != "GREEN"} { puts "ERROR: wrong middle segment color" }
if {[vcolorscale cs -findcolor 5] != "GRAY"} { puts "ERROR: wrong last segment color" }