1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

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
This commit is contained in:
ski 2014-12-11 16:47:12 +03:00 committed by bugmaster
parent a4bb1420ca
commit ccadc126ba
56 changed files with 356 additions and 932 deletions

View File

@ -2026,3 +2026,145 @@ proc _testgrid_process_jobs {worker {nb_ok 0}} {
} }
catch {tpool::suspend $worker} catch {tpool::suspend $worker}
} }
help checkcolor {
Check pixel color.
Use: checkcolor x y red green blue
x y - pixel coordinates
red green blue - expected pixel color (values from 0 to 1)
Function check color with tolerance (5x5 area)
}
# Procedure to check color using command vreadpixel with tolerance
proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
puts "Coordinate x = $coord_x"
puts "Coordinate y = $coord_y"
puts "RED color of RGB is $rd_get"
puts "GREEN color of RGB is $gr_get"
puts "BLUE color of RGB is $bl_get"
if { $coord_x <= 1 || $coord_y <= 1 } {
puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
return -1
}
set color ""
catch { [set color "[vreadpixel ${coord_x} ${coord_y} rgb]"] }
if {"$color" == ""} {
puts "Error : Pixel coordinates (${position_x}; ${position_y}) are out of view"
}
set rd [lindex $color 0]
set gr [lindex $color 1]
set bl [lindex $color 2]
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
set rd_ch [expr int($rd_get * 1.e+05)]
set gr_ch [expr int($gr_get * 1.e+05)]
set bl_ch [expr int($bl_get * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
set status 0
if { $tol_rd > 0.2 } {
puts "Warning : RED light of additive color model RGB is invalid"
set status 1
}
if { $tol_gr > 0.2 } {
puts "Warning : GREEN light of additive color model RGB is invalid"
set status 1
}
if { $tol_bl > 0.2 } {
puts "Warning : BLUE light of additive color model RGB is invalid"
set status 1
}
if { $status != 0 } {
puts "Warning : Colors of default coordinate are not equal"
}
global stat
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
set info [_checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
set stat [lindex $info end]
if { ${stat} != 1 } {
puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
return $stat
} else {
puts "Point with valid color was found"
return $stat
}
} else {
set stat 1
}
}
# Procedure to check color in the point near default coordinate
proc _checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
set x_start [expr ${coord_x} - 2]
set y_start [expr ${coord_y} - 2]
set mistake 0
set i 0
while { $mistake != 1 && $i <= 5 } {
set j 0
while { $mistake != 1 && $j <= 5 } {
set position_x [expr ${x_start} + $j]
set position_y [expr ${y_start} + $i]
puts $position_x
puts $position_y
set color ""
catch { [set color "[vreadpixel ${position_x} ${position_y} rgb]"] }
if {"$color" == ""} {
puts "Warning : Pixel coordinates (${position_x}; ${position_y}) are out of view"
incr j
continue
}
set rd [lindex $color 0]
set gr [lindex $color 1]
set bl [lindex $color 2]
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
puts "Warning : Point with true color was not found near default coordinates"
set mistake 0
} else {
set mistake 1
}
incr j
}
incr i
}
return $mistake
}

View File

@ -16,19 +16,10 @@
#include <QADraw.hxx> #include <QADraw.hxx>
#include <Draw.hxx> #include <Draw.hxx>
#include <Draw_Interpretor.hxx> #include <Draw_Interpretor.hxx>
#include <Draw_Window.hxx>
#include <Draw_Viewer.hxx>
#include <Image_AlienPixMap.hxx>
#include <V3d_View.hxx>
#include <ViewerTest.hxx> #include <ViewerTest.hxx>
#include <ViewerTest_EventManager.hxx> #include <ViewerTest_EventManager.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_HSequenceOfReal.hxx>
#include <TopoDS_Shape.hxx> #include <TopoDS_Shape.hxx>
#include <AIS_InteractiveContext.hxx> #include <AIS_InteractiveContext.hxx>
#include <Aspect_Window.hxx>
#include <Aspect_DisplayConnection.hxx>
#include <DBRep.hxx> #include <DBRep.hxx>
#include <Bnd_Box.hxx> #include <Bnd_Box.hxx>
#include <BRepBndLib.hxx> #include <BRepBndLib.hxx>
@ -48,122 +39,6 @@
#include <Draw_PluginMacro.hxx> #include <Draw_PluginMacro.hxx>
Handle(TColStd_HSequenceOfReal) GetColorOfPixel (const Image_PixMap& theImage,
const Standard_Integer theCoordinateX,
const Standard_Integer theCoordinateY,
const Standard_Integer theRadius)
{
Handle(TColStd_HSequenceOfReal) aSeq = new TColStd_HSequenceOfReal();
if (theImage.IsEmpty()) {
std::cerr << "The image is null.\n";
return aSeq;
}
Standard_Integer aWidth = (Standard_Integer )theImage.SizeX();
Standard_Integer anHeight = (Standard_Integer )theImage.SizeY();
Quantity_Color aColorTmp;
for (Standard_Integer anXIter = theCoordinateX - theRadius;
anXIter <= theCoordinateX + theRadius; ++anXIter)
{
if (anXIter < 0 || anXIter >= aWidth)
{
continue;
}
for (Standard_Integer anYIter = theCoordinateY - theRadius;
anYIter <= theCoordinateY + theRadius; ++anYIter)
{
if (anYIter < 0 || anYIter >= anHeight)
{
continue;
}
// Image_PixMap stores image upside-down in memory!
aColorTmp = theImage.PixelColor (anXIter, anYIter);
aSeq->Append (aColorTmp.Red());
aSeq->Append (aColorTmp.Green());
aSeq->Append (aColorTmp.Blue());
}
}
return aSeq;
}
static Standard_Integer QAAISGetPixelColor (Draw_Interpretor& theDi,
Standard_Integer theArgsNb,
const char** theArgs)
{
if (theArgsNb != 3 && theArgsNb != 6)
{
theDi << "Usage : " << theArgs[0] << " coordinate_X coordinate_Y [color_R color_G color_B]" << "\n";
return 1; // TCL_ERROR
}
Handle(V3d_View) aView3d = ViewerTest::CurrentView();
if (aView3d.IsNull())
{
theDi << "You must initialize AISViewer before this command.\n";
return 1; // TCL_ERROR
}
const Handle(Aspect_Window) anAISWindow = aView3d->Window();
Standard_Integer aWindowSizeX = 0;
Standard_Integer aWindowSizeY = 0;
anAISWindow->Size (aWindowSizeX, aWindowSizeY);
Standard_Integer anArgIter = 1;
const Standard_Integer aPickCoordX = Draw::Atoi (theArgs[anArgIter++]);
const Standard_Integer aPickCoordY = Draw::Atoi (theArgs[anArgIter++]);
const Standard_Integer aRadius = (theArgsNb == 3) ? 0 : 1;
Image_ColorRGBF aColorInput = {{ 0.0f, 0.0f, 0.0f }};
if (theArgsNb == 6)
{
aColorInput.r() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
aColorInput.g() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
aColorInput.b() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
}
Image_PixMap anImage;
aView3d->ToPixMap (anImage, aWindowSizeX, aWindowSizeY);
const Handle(TColStd_HSequenceOfReal) aSeq = GetColorOfPixel (anImage, aPickCoordX, aPickCoordY, aRadius);
cout << "Length = " << aSeq->Length() << endl;
Image_ColorRGBF aColorPicked = {{ 0.0f, 0.0f, 0.0f }};
Standard_Boolean isNotEqual = Standard_True;
for (Standard_Integer i = 1; i <= aSeq->Length(); i += 3)
{
aColorPicked.r() = (Standard_ShortReal )aSeq->Value (i + 0);
aColorPicked.g() = (Standard_ShortReal )aSeq->Value (i + 1);
aColorPicked.b() = (Standard_ShortReal )aSeq->Value (i + 2);
if (theArgsNb == 3 ||
((Abs (aColorPicked.r() - aColorInput.r()) <= Precision::Confusion())
&& (Abs (aColorPicked.g() - aColorInput.g()) <= Precision::Confusion())
&& (Abs (aColorPicked.b() - aColorInput.b()) <= Precision::Confusion())))
{
isNotEqual = Standard_False;
break;
}
}
theDi << "RED : " << aColorPicked.r() << " "
<< "GREEN : " << aColorPicked.g() << " "
<< "BLUE : " << aColorPicked.b() << "\n";
if (theArgsNb == 6)
{
theDi << "User color: \n"
<< "RED : " << aColorInput.r() << " "
<< "GREEN : " << aColorInput.g() << " "
<< "BLUE : " << aColorInput.b() << "\n";
}
if (isNotEqual)
{
theDi << "Faulty : colors are not equal.\n";
return 1; // TCL_ERROR
}
return 0;
}
//======================================================================= //=======================================================================
#if ! defined(WNT) #if ! defined(WNT)
extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS(); extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
@ -365,12 +240,6 @@ void QADraw::CommonCommands (Draw_Interpretor& theCommands)
{ {
const char* group = "QA_Commands"; const char* group = "QA_Commands";
theCommands.Add ("QAGetPixelColor",
"QAGetPixelColor coordinate_X coordinate_Y [color_R color_G color_B]",
__FILE__,
QAAISGetPixelColor,
group);
theCommands.Add ("vtri_orig", theCommands.Add ("vtri_orig",
"vtri_orig : vtri_orig trihedron_name - draws axis origin lines", "vtri_orig : vtri_orig trihedron_name - draws axis origin lines",
__FILE__, __FILE__,

View File

@ -53,141 +53,6 @@ proc checkarea {shape area_expected tol_abs tol_rel} {
checkreal "area of $shape" $area $area_expected $tol_abs $tol_rel checkreal "area of $shape" $area $area_expected $tol_abs $tol_rel
} }
# Procedure to check color in the point near default coordinate
proc checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
set x_start [expr ${coord_x} - 2]
set y_start [expr ${coord_y} - 2]
set mistake 0
set i 0
while { $mistake != 1 && $i <= 5 } {
set j 0
while { $mistake != 1 && $j <= 5 } {
set position_x [expr ${x_start} + $j]
set position_y [expr ${y_start} + $i]
puts $position_x
puts $position_y
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${position_x} ${position_y} ]
} else {
set color [ QAGetPixelColor ${position_x} ${position_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
puts "Warning : Point with true color was not found near default coordinates"
set mistake 0
} else {
set mistake 1
}
incr j
}
incr i
}
return $mistake
}
# Procedure to check color using command QAgetPixelColor with tolerance
proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
puts "Coordinate x = $coord_x"
puts "Coordinate y = $coord_y"
puts "RED color of RGB is $rd_get"
puts "GREEN color of RGB is $gr_get"
puts "BLUE color of RGB is $bl_get"
if { $coord_x <= 1 || $coord_y <= 1 } {
puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
return -1
}
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${coord_x} ${coord_y} ]
} else {
set color [ QAGetPixelColor ${coord_x} ${coord_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
set rd_ch [expr int($rd_get * 1.e+05)]
set gr_ch [expr int($gr_get * 1.e+05)]
set bl_ch [expr int($bl_get * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
set status 0
if { $tol_rd > 0.2 } {
puts "Warning : RED light of additive color model RGB is invalid"
set status 1
}
if { $tol_gr > 0.2 } {
puts "Warning : GREEN light of additive color model RGB is invalid"
set status 1
}
if { $tol_bl > 0.2 } {
puts "Warning : BLUE light of additive color model RGB is invalid"
set status 1
}
if { $status != 0 } {
puts "Warning : Colors of default coordinate are not equal"
}
global stat
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
set info [checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
set stat [lindex $info end]
if { ${stat} != 1 } {
puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
return $stat
} else {
puts "Point with valid color was found"
return $stat
}
} else {
set stat 1
}
}
# Procedure to check if sequence of values in listval follows linear trend # Procedure to check if sequence of values in listval follows linear trend
# adding the same delta on each step. # adding the same delta on each step.
# #

View File

@ -29,10 +29,10 @@ set inf_after [trinfo a_1]
regexp { +([-0-9.+eE]+) +triangles} $inf_after full tri_after regexp { +([-0-9.+eE]+) +triangles} $inf_after full tri_after
regexp { +([-0-9.+eE]+) +nodes} $inf_after full nod_after regexp { +([-0-9.+eE]+) +nodes} $inf_after full nod_after
set color [QAGetPixelColor ${x1} ${y1}] set color [vreadpixel ${x1} ${y1} rgb]
regexp {RED +: +([-0-9.+eE]+)} $color full rd set rd [lindex $color 0]
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr set gr [lindex $color 1]
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl set bl [lindex $color 2]
if { $rd == 0 || $gr == 0 || $bl == 0 } { if { $rd == 0 || $gr == 0 || $bl == 0 } {
puts "Error : Face is not shaded (colors are not equal)" puts "Error : Face is not shaded (colors are not equal)"

View File

@ -45,17 +45,9 @@ vmoveto ${x1} ${y1}
set status 0 set status 0
for {set i ${y1} } {$i <= ${y2} } {incr i} { for {set i ${y1} } {$i <= ${y2} } {incr i} {
set Color1 [QAGetPixelColor ${x1} ${i}] if { "[vreadpixel ${x1} ${i} rgb name]" == "BLACK" } {
incr status
set R1 [lindex ${Color1} 2] puts "Error : rendering x = ${x1} y = ${i}"
set G1 [lindex ${Color1} 5]
set B1 [lindex ${Color1} 8]
puts "x = ${x1} y = ${i} R = ${R1} G = ${G1} B = ${B1}"
if { ${R1} == 0 && ${G1} == 0 && ${B1} == 0 } {
incr status
puts "Error : rendering x = ${x1} y = ${i}"
} }
} }

View File

@ -31,22 +31,10 @@ set nb_compsol_good 0
set nb_compound_good 0 set nb_compound_good 0
set nb_shape_good 96 set nb_shape_good 96
set Color [QAGetPixelColor $x1 $y1] if { "[vreadpixel $x1 $y1 rgb name]" == "BLACK" } {
set R [lindex ${Color} 2] puts "Faulty ${BugNumber}"
set G [lindex ${Color} 5]
set B [lindex ${Color} 8]
set color_status 0
if { $R == 0 && $G == 0 && $B == 0 } {
set color_status 1
} else { } else {
set color_status 0 puts "OK ${BugNumber}"
}
if { ${color_status} == 0} {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
} }
set 3dviewer 0 set 3dviewer 0

View File

@ -20,27 +20,18 @@ vfit
###set x1 101 ###set x1 101
set x1 102 set x1 102
set y1 199 set y1 199
set Color [QAGetPixelColor ${x1} ${y1}] set Color [vreadpixel ${x1} ${y1} rgb]
vmoveto ${x1} ${y1} vmoveto ${x1} ${y1}
set ColorMove [QAGetPixelColor ${x1} ${y1}] set ColorMove [vreadpixel ${x1} ${y1} rgb]
vselect ${x1} ${y1} vselect ${x1} ${y1}
set ColorSelect [QAGetPixelColor ${x1} ${y1}] set ColorSelect [vreadpixel ${x1} ${y1} rgb]
set Color_Status 0
if { ${Color} != ${ColorMove} && ${Color} != ${ColorSelect} && ${ColorMove} != ${ColorSelect} } { if { ${Color} != ${ColorMove} && ${Color} != ${ColorSelect} && ${ColorMove} != ${ColorSelect} } {
set Color_Status 0 puts "OK ${BugNumber}"
} else { } else {
set Color_Status 1 puts "Faulty ${BugNumber}"
}
# Resume
puts ""
if { ${Color_Status} != 0} {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
} }
set square 24859.6 set square 24859.6

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "===========" puts "==========="
puts "BUC60574" puts "BUC60574"
puts "===========" puts "==========="

View File

@ -26,9 +26,8 @@ puts ""
set x_coord 88 set x_coord 88
set y_coord 272 set y_coord 272
checkcolor $x_coord $y_coord 0.8 0.8 0.8 vaspects -setwidth 5
if {"[vreadpixel $x_coord $y_coord rgb name]" != "GRAY80"} {
if {$stat != 1} {
puts "Error : The rectangular is NOT highlighted." puts "Error : The rectangular is NOT highlighted."
} }

View File

@ -16,13 +16,14 @@ vscale 1 1 1
set x1 [list 165 340 70] set x1 [list 165 340 70]
set y1 [list 384 283 79] set y1 [list 384 283 79]
vaspects -setwidth 5
puts "" puts ""
for {set i 0} {$i < 3} {incr i} { for {set i 0} {$i < 3} {incr i} {
set x_coord [lindex ${x1} $i] set x_coord [lindex ${x1} $i]
set y_coord [lindex ${y1} $i] set y_coord [lindex ${y1} $i]
if { "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW" } {
checkcolor $x_coord $y_coord 1 1 0 puts "Error : color is not yellow"
}
} }
vscale 0.5 1.5 0.7 vscale 0.5 1.5 0.7
@ -35,8 +36,9 @@ puts ""
for {set i 0} {$i < 3} {incr i} { for {set i 0} {$i < 3} {incr i} {
set x_coord [lindex ${x2} $i] set x_coord [lindex ${x2} $i]
set y_coord [lindex ${y2} $i] set y_coord [lindex ${y2} $i]
if { "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW" } {
checkcolor $x_coord $y_coord 1 1 0 puts "Error : color is not yellow"
}
} }
set only_screen 1 set only_screen 1

View File

@ -38,15 +38,15 @@ set y_GREEN 180
set x_BLUE 180 set x_BLUE 180
set y_BLUE 250 set y_BLUE 250
set ColorList1 [QAGetPixelColor ${x_GREEN} ${y_GREEN}] set ColorList1 [vreadpixel ${x_GREEN} ${y_GREEN} rgb]
regexp {RED +: +([-0-9.+eE]+)} $ColorList1 full RED_1 set RED_1 [lindex $ColorList1 0]
regexp {GREEN +: +([-0-9.+eE]+)} $ColorList1 full GREEN_1 set GREEN_1 [lindex $ColorList1 1]
regexp {BLUE +: +([-0-9.+eE]+)} $ColorList1 full BLUE_1 set BLUE_1 [lindex $ColorList1 2]
set ColorList2 [QAGetPixelColor ${x_BLUE} ${y_BLUE}] set ColorList2 [vreadpixel ${x_BLUE} ${y_BLUE} rgb]
regexp {RED +: +([-0-9.+eE]+)} $ColorList2 full RED_2 set RED_2 [lindex $ColorList2 0]
regexp {GREEN +: +([-0-9.+eE]+)} $ColorList2 full GREEN_2 set GREEN_2 [lindex $ColorList2 1]
regexp {BLUE +: +([-0-9.+eE]+)} $ColorList2 full BLUE_2 set BLUE_2 [lindex $ColorList2 2]
if {${RED_1} == 0 && ${GREEN_1} > 0 && ${BLUE_1} == 0} { if {${RED_1} == 0 && ${GREEN_1} > 0 && ${BLUE_1} == 0} {
set IsGreen 1 set IsGreen 1

View File

@ -61,12 +61,12 @@ vdisplay obj
vconnect new 50 50 50 obj vconnect new 50 50 50 obj
vfit vfit
vmoveto $x1 $y1 vmoveto $x1 $y1
set ColorObj1 [QAGetPixelColor ${x2} ${y2}] set ColorObj1 [vreadpixel ${x2} ${y2} rgb]
set ColorNew1 [QAGetPixelColor ${x3} ${y3}] set ColorNew1 [vreadpixel ${x3} ${y3} rgb]
vselect $x1 $y1 vselect $x1 $y1
set ColorObj2 [QAGetPixelColor ${x2} ${y2}] set ColorObj2 [vreadpixel ${x2} ${y2} rgb]
set ColorNew2 [QAGetPixelColor ${x3} ${y3}] set ColorNew2 [vreadpixel ${x3} ${y3} rgb]
puts "Check vconnect command" puts "Check vconnect command"
set status_vconnect 0 set status_vconnect 0

View File

@ -17,17 +17,17 @@ vdisplay result
vfit vfit
vsetdispmode result 1 vsetdispmode result 1
set color1 [QAGetPixelColor 175 195] set color1 [vreadpixel 175 195 rgb]
regexp {RED +: +([-0-9.+eE]+)} $color1 full rd1 set rd1 [lindex $color1 0]
regexp {GREEN +: +([-0-9.+eE]+)} $color1 full gr1 set gr1 [lindex $color1 1]
regexp {BLUE +: +([-0-9.+eE]+)} $color1 full bl1 set bl1 [lindex $color1 2]
vsetmaterial result ALUMINIUM vsetmaterial result ALUMINIUM
set color2 [QAGetPixelColor 175 195] set color2 [vreadpixel 175 195 rgb]
regexp {RED +: +([-0-9.+eE]+)} $color2 full rd2 set rd2 [lindex $color2 0]
regexp {GREEN +: +([-0-9.+eE]+)} $color2 full gr2 set gr2 [lindex $color2 1]
regexp {BLUE +: +([-0-9.+eE]+)} $color2 full bl2 set bl2 [lindex $color2 2]
if { ${rd2} == ${rd1} || ${gr2} == ${gr1} || ${bl2} == ${bl1} } { if { ${rd2} == ${rd1} || ${gr2} == ${gr1} || ${bl2} == ${bl1} } {
puts "Error : material of the shape was NOT changed" puts "Error : material of the shape was NOT changed"

View File

@ -18,18 +18,18 @@ vdisplay result
vfit vfit
vsetdispmode result 1 vsetdispmode result 1
set color1 [QAGetPixelColor 175 195] set color1 [vreadpixel 175 195 rgb]
regexp {RED +: +([-0-9.+eE]+)} $color1 full rd1 set rd1 [lindex $color1 0]
regexp {GREEN +: +([-0-9.+eE]+)} $color1 full gr1 set gr1 [lindex $color1 1]
regexp {BLUE +: +([-0-9.+eE]+)} $color1 full bl1 set bl1 [lindex $color1 2]
######################################################## ########################################################
vsettransparency result 0.5 vsettransparency result 0.5
set color2 [QAGetPixelColor 175 195] set color2 [vreadpixel 175 195 rgb]
regexp {RED +: +([-0-9.+eE]+)} $color2 full rd2 set rd2 [lindex $color2 0]
regexp {GREEN +: +([-0-9.+eE]+)} $color2 full gr2 set gr2 [lindex $color2 1]
regexp {BLUE +: +([-0-9.+eE]+)} $color2 full bl2 set bl2 [lindex $color2 2]
if { ${rd2} == ${rd1} || ${gr2} == ${gr1} || ${bl2} == ${bl1} } { if { ${rd2} == ${rd1} || ${gr2} == ${gr1} || ${bl2} == ${bl1} } {
puts "Error : vsettransparency of shape was NOT made" puts "Error : vsettransparency of shape was NOT made"

View File

@ -28,10 +28,10 @@ vsetcolor face GREEN1
vsetdispmode cylinder 1 vsetdispmode cylinder 1
vsetcolor cylinder RED1 vsetcolor cylinder RED1
set ColorList [QAGetPixelColor $Start_X $Start_Y] set ColorList [vreadpixel ${Start_X} ${Start_Y} rgb]
regexp {RED +: +([-0-9.+eE]+)} $ColorList full R_START_POINT set R_START_POINT [lindex $ColorList 0]
regexp {GREEN +: +([-0-9.+eE]+)} $ColorList full G_START_POINT set G_START_POINT [lindex $ColorList 1]
regexp {BLUE +: +([-0-9.+eE]+)} $ColorList full B_START_POINT set B_START_POINT [lindex $ColorList 2]
puts "R_START_POINT=$R_START_POINT ; G_START_POINT=$G_START_POINT ; B_START_POINT=$B_START_POINT" puts "R_START_POINT=$R_START_POINT ; G_START_POINT=$G_START_POINT ; B_START_POINT=$B_START_POINT"

View File

@ -27,6 +27,6 @@ vsetcolor c1 GREEN
vsetdispmode 1 vsetdispmode 1
vsetcolor c1 RED vsetcolor c1 RED
checkcolor ${x1} ${y1}] 1 0 0 checkcolor ${x1} ${y1} 1 0 0
set only_screen 1 set only_screen 1

View File

@ -22,33 +22,25 @@ set y4 232
vinit vinit
vsetgradientbg 255 0 0 0 0 255 4 vsetgradientbg 255 0 0 0 0 255 4
set Color1 [QAGetPixelColor ${x1} ${y1}] set Color1 [vreadpixel ${x1} ${y1} rgb]
set Color2 [QAGetPixelColor ${x2} ${y2}] set Color2 [vreadpixel ${x2} ${y2} rgb]
set Color3 [QAGetPixelColor ${x3} ${y3}] set Color3 [vreadpixel ${x3} ${y3} rgb]
set Color4 [QAGetPixelColor ${x4} ${y4}] set Color4 [vreadpixel ${x4} ${y4} rgb]
vclipplane create pln1 vclipplane create pln1
vclipplane change pln1 equation 1 0 0 -0.1 vclipplane change pln1 equation 1 0 0 -0.1
vclipplane set pln1 view Driver1/Viewer1/View1 vclipplane set pln1 view Driver1/Viewer1/View1
box b 100 100 100 box b 100 100 100
vdisplay b vdisplay b
vsetdispmode 1 vsetdispmode 1
set ColorRes1 [QAGetPixelColor ${x1} ${y1}] set ColorRes1 [vreadpixel ${x1} ${y1} rgb]
set ColorRes2 [QAGetPixelColor ${x2} ${y2}] set ColorRes2 [vreadpixel ${x2} ${y2} rgb]
set ColorRes3 [QAGetPixelColor ${x3} ${y3}] set ColorRes3 [vreadpixel ${x3} ${y3} rgb]
set ColorRes4 [QAGetPixelColor ${x4} ${y4}] set ColorRes4 [vreadpixel ${x4} ${y4} rgb]
set status 0
if { ${Color1} == ${ColorRes1} && ${Color2} == ${ColorRes2} && ${Color3} == ${ColorRes3} && ${Color4} == ${ColorRes4}} { if { ${Color1} == ${ColorRes1} && ${Color2} == ${ColorRes2} && ${Color3} == ${ColorRes3} && ${Color4} == ${ColorRes4}} {
set status 0 puts "OK ${BugNumber}"
} else { } else {
set status 1 puts "Faulty ${BugNumber}"
} }
# Resume
puts ""
if { ${status} != 0} {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}
set only_screen 1 set only_screen 1

View File

@ -24,31 +24,17 @@ vsetdispmode b_1 1
vselprecision vselprecision
vselprecision 1 0.1 vselprecision 1 0.1
set ColorBefore [QAGetPixelColor ${x1} ${y1}] set ColorBefore [vreadpixel ${x1} ${y1} rgb]
set R1 [lindex ${ColorBefore} 2]
set G1 [lindex ${ColorBefore} 5]
set B1 [lindex ${ColorBefore} 8]
vmoveto ${x2} ${y2} vmoveto ${x2} ${y2}
set ColorAfter [QAGetPixelColor ${x1} ${y1}] set ColorAfter [vreadpixel ${x2} ${y2} rgb]
set R2 [lindex ${ColorAfter} 2]
set G2 [lindex ${ColorAfter} 5]
set B2 [lindex ${ColorAfter} 8]
set check_color 0 if { "$ColorBefore" == "$ColorAfter" } {
if { ${R1} == ${R2} && ${G1} == ${G2} && ${B1} == ${B2} } { puts "OK ${BugNumber}"
set check_color 0
} else { } else {
set check_color 1 puts "Faulty ${BugNumber}"
} }
# Resume
puts ""
if { ${check_color} != 0} {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}
vfit vfit
set only_screen 1 set only_screen 1

View File

@ -17,14 +17,13 @@ set R_bg 0.70196002721786499
set G_bg 0.78039199113845825 set G_bg 0.78039199113845825
set B_bg 0.86274499999999998 set B_bg 0.86274499999999998
set Color [QAGetPixelColor ${x1} ${y1}] set WrongColor "$R_bg $G_bg $B_bg"
set R [lindex ${Color} 2]
set G [lindex ${Color} 5] set Color [vreadpixel ${x1} ${y1} rgb]
set B [lindex ${Color} 8]
#Resume #Resume
puts "" puts ""
if { $R != ${R_bg} && $G != ${G_bg} && $B != ${B_bg} } { if { "[vreadpixel ${x1} ${y1} rgb]" != "$WrongColor" } {
puts "OK ${BugNumber}" puts "OK ${BugNumber}"
} else { } else {
puts "Faulty ${BugNumber}" puts "Faulty ${BugNumber}"

View File

@ -33,39 +33,24 @@ vtop
vfit vfit
set status 0 set status 0
set RED 0
set GREEN 0
set BLUE 0
set x1 223 set x1 223
set y1 195 set y1 195
set Color1 [QAGetPixelColor ${x1} ${y1}]
regexp {RED +: +([-0-9.+eE]+)} $Color1 full R1 if { "[vreadpixel $x1 $y1 rgb name]" == "BLACK" } {
regexp {GREEN +: +([-0-9.+eE]+)} $Color1 full G1
regexp {BLUE +: +([-0-9.+eE]+)} $Color1 full B1
if { $R1 == ${RED} && $G1 == ${GREEN} && $B1 == ${BLUE} } {
set status 1 set status 1
puts "Faulty Color1" puts "Faulty Color1"
} }
set x2 224 set x2 224
set y2 240 set y2 240
set Color2 [QAGetPixelColor ${x2} ${y2}] if { "[vreadpixel $x2 $y2 rgb name]" == "BLACK" } {
regexp {RED +: +([-0-9.+eE]+)} $Color2 full R2
regexp {GREEN +: +([-0-9.+eE]+)} $Color2 full G2
regexp {BLUE +: +([-0-9.+eE]+)} $Color2 full B2
if { $R2 == ${RED} && $G2 == ${GREEN} && $B2 == ${BLUE} } {
set status 1 set status 1
puts "Faulty Color2" puts "Faulty Color2"
} }
set x3 223 set x3 223
set y3 266 set y3 266
set Color3 [QAGetPixelColor ${x3} ${y3}] if { "[vreadpixel $x3 $y3 rgb name]" == "BLACK" } {
regexp {RED +: +([-0-9.+eE]+)} $Color3 full R3
regexp {GREEN +: +([-0-9.+eE]+)} $Color3 full G3
regexp {BLUE +: +([-0-9.+eE]+)} $Color3 full B3
if { $R3 == ${RED} && $G3 == ${GREEN} && $B3 == ${BLUE} } {
set status 1 set status 1
puts "Faulty Color3" puts "Faulty Color3"
} }

View File

@ -32,18 +32,22 @@ set Cyan_R 0
set Cyan_G 1 set Cyan_G 1
set Cyan_B 1 set Cyan_B 1
set Cyan "$Cyan_R $Cyan_G $Cyan_B"
set Yellow_R 1 set Yellow_R 1
set Yellow_G 1 set Yellow_G 1
set Yellow_B 0 set Yellow_B 0
set Yellow "$Yellow_R $Yellow_G $Yellow_B"
# There is not selection # There is not selection
puts "There is not selection" puts "There is not selection"
catch {QAGetPixelColor $x1 $y1 $Yellow_R $Yellow_G $Yellow_B} result11 set result11 [regexp "$Yellow" [vreadpixel $x1 $y1 rgb]]
catch {QAGetPixelColor $x2 $y2 $Yellow_R $Yellow_G $Yellow_B} result12 set result12 [regexp "$Yellow" [vreadpixel $x2 $y2 rgb]]
catch {QAGetPixelColor $x3 $y3 $Yellow_R $Yellow_G $Yellow_B} result13 set result13 [regexp "$Yellow" [vreadpixel $x3 $y3 rgb]]
catch {QAGetPixelColor $x4 $y4 $Yellow_R $Yellow_G $Yellow_B} result14 set result14 [regexp "$Yellow" [vreadpixel $x4 $y4 rgb]]
catch {QAGetPixelColor $x5 $y5 $Yellow_R $Yellow_G $Yellow_B} result15 set result15 [regexp "$Yellow" [vreadpixel $x5 $y5 rgb]]
catch {QAGetPixelColor $x6 $y6 $Yellow_R $Yellow_G $Yellow_B} result16 set result16 [regexp "$Yellow" [vreadpixel $x6 $y6 rgb]]
# Move a mouse # Move a mouse
puts "Move a mouse" puts "Move a mouse"
@ -51,59 +55,27 @@ vmoveto $x2 $y2
# Second box of first CompSolid is selected # Second box of first CompSolid is selected
puts "Second box of first CompSolid is selected" puts "Second box of first CompSolid is selected"
catch {QAGetPixelColor $x1 $y1 $Yellow_R $Yellow_G $Yellow_B} result21 set result21 [regexp "$Yellow" [vreadpixel $x1 $y1 rgb]]
catch {QAGetPixelColor $x3 $y3 $Yellow_R $Yellow_G $Yellow_B} result22 set result22 [regexp "$Yellow" [vreadpixel $x3 $y3 rgb]]
catch {QAGetPixelColor $x4 $y4 $Yellow_R $Yellow_G $Yellow_B} result23 set result23 [regexp "$Yellow" [vreadpixel $x4 $y4 rgb]]
catch {QAGetPixelColor $x5 $y5 $Yellow_R $Yellow_G $Yellow_B} result24 set result24 [regexp "$Yellow" [vreadpixel $x5 $y5 rgb]]
catch {QAGetPixelColor $x6 $y6 $Yellow_R $Yellow_G $Yellow_B} result25 set result25 [regexp "$Yellow" [vreadpixel $x6 $y6 rgb]]
if { [array get env os_type] != "" } { if { [array get env os_type] != "" } {
set os $env(os_type) set os $env(os_type)
} }
if { [string compare $os "windows"] != 0 } { if { [string compare $os "windows"] != 0 } {
catch {QAGetPixelColor $x2 $y2 $Cyan_R $Cyan_G $Cyan_B} result31 set result31 [regexp "$Cyan" [vreadpixel $x2 $y2 rgb]]
if { $result31 == 0 } {
set IsFaulty 1
}
} }
set IsFaulty 0 set IsFaulty 0
if { [regexp "Faulty" $result11] == 1 } { if { !($result11 && $result12 && $result13 && $result14 && $result15 && $result16)
|| !($result21 && $result22 && $result23 && $result24 && $result25) } {
set IsFaulty 1 set IsFaulty 1
} }
if { [regexp "Faulty" $result12] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result13] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result14] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result15] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result16] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result21] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result22] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result23] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result24] == 1 } {
set IsFaulty 1
}
if { [regexp "Faulty" $result25] == 1 } {
set IsFaulty 1
}
if { [string compare $os "windows"] != 0 } {
if { [regexp "Faulty" $result31] == 1 } {
set IsFaulty 1
}
}
if {$IsFaulty != 0} { if {$IsFaulty != 0} {
puts "Error : OCC232" puts "Error : OCC232"

View File

@ -84,8 +84,7 @@ proc check_primitive {name1 r g b args} {
set HasPixel 0 set HasPixel 0
for {set i 0} {$i < $limit_x} {incr i} { for {set i 0} {$i < $limit_x} {incr i} {
for {set j 0} {$j < $limit_y} {incr j} { for {set j 0} {$j < $limit_y} {incr j} {
set QATestVar [ catch { QAGetPixelColor $i $j $r $g $b } ] if { "[vreadpixel $i $j rgb]" == "$r $g $b" } {
if { $QATestVar == 0 } {
set HasPixel 1 set HasPixel 1
} }
} }
@ -100,8 +99,8 @@ proc check_primitive {name1 r g b args} {
set HasPixel 1 set HasPixel 1
for {set i 0} {$i < $limit_x} {incr i} { for {set i 0} {$i < $limit_x} {incr i} {
for {set j 0} {$j < $limit_y} {incr j} { for {set j 0} {$j < $limit_y} {incr j} {
set QATestVar [ catch { QAGetPixelColor $i [expr $view_height-$j] $r $g $b } ] set coord_y [expr $view_height-$j]
if { $QATestVar == 0 } { if { "[vreadpixel $i $coord_y rgb]" == "$r $g $b" } {
set HasPixel 1 set HasPixel 1
} }
} }
@ -116,8 +115,9 @@ proc check_primitive {name1 r g b args} {
set HasPixel 1 set HasPixel 1
for {set i 0} {$i < $limit_x} {incr i} { for {set i 0} {$i < $limit_x} {incr i} {
for {set j 0} {$j < $limit_y} {incr j} { for {set j 0} {$j < $limit_y} {incr j} {
set QATestVar [ catch { QAGetPixelColor [expr ($view_width-$limit_y) + $i] [expr ($view_height-$limit_y)/2 + $j] $r $g $b } ] set coord_x [expr ($view_width-$limit_y) + $i]
if { $QATestVar == 0 } { set coord_y [expr ($view_height-$limit_y)/2 + $j]
if { "[vreadpixel $coord_x $coord_y rgb]" == "$r $g $b" } {
set HasPixel 1 set HasPixel 1
} }
} }
@ -132,8 +132,9 @@ proc check_primitive {name1 r g b args} {
set HasPixel 0 set HasPixel 0
for {set i 0} {$i < $limit_x} {incr i} { for {set i 0} {$i < $limit_x} {incr i} {
for {set j 0} {$j < $limit_y} {incr j} { for {set j 0} {$j < $limit_y} {incr j} {
set QATestVar [ catch { QAGetPixelColor [expr $view_width/4 + $i] [expr ($view_height-$limit_y)/2 + $j] $r $g $b } ] set coord_x [expr $view_width/4 + $i]
if { $QATestVar == 0 } { set coord_y [expr ($view_height-$limit_y)/2 + $j]
if { "[vreadpixel $coord_x $coord_y rgb]" == "$r $g $b" } {
set HasPixel 1 set HasPixel 1
} }
} }

View File

@ -15,11 +15,10 @@ vdisplay p
vsetdispmode p 1 vsetdispmode p 1
vsetinteriorstyle p 1 vsetinteriorstyle p 1
set color [QAGetPixelColor 10 0]
regexp {RED +: +([-0-9.+eE]+)} $color full R_check
puts "" puts ""
if { ${R_check} == 0 } { set color1 [vreadpixel 10 0 rgb]
set rd1 [lindex $color1 0]
if { $rd1 == 0 } {
puts "Faulty ${BugNumber}" puts "Faulty ${BugNumber}"
} else { } else {
puts "OK ${BugNumber}" puts "OK ${BugNumber}"

View File

@ -17,22 +17,10 @@ vtexrepeat b_16 3 2
vsetdispmode b_16 1 vsetdispmode b_16 1
vfit vfit
set color [QAGetPixelColor 85 73] if { "[vreadpixel 85 73 rgb name]" != "BLACK" } {
regexp {RED +: +([-0-9.+eE]+)} $color full R_check
regexp {GREEN +: +([-0-9.+eE]+)} $color full G_check
regexp {BLUE +: +([-0-9.+eE]+)} $color full B_check
set color_status 0
if { ${R_check} != 0 || ${G_check} != 0 || ${B_check} != 0 } {
set color_status 0
} else {
set color_status 1
}
puts ""
if { ${color_status} != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}" puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
} }
set only_screen 1 set only_screen 1

View File

@ -12,31 +12,12 @@ vdisplay b
vsetdispmode 1 vsetdispmode 1
vshowfaceboundary b 1 255 0 0 10 1 vshowfaceboundary b 1 255 0 0 10 1
vfit vfit
vaspects -setwidth 5
set x_coord 183 if { "[vreadpixel 183 190 rgb name]" != "RED"
set y_coord 190 || "[vreadpixel 292 358 rgb name]" != "RED"
|| "[vreadpixel 26 265 rgb name]" != "RED"
checkcolor $x_coord $y_coord 1 0 0 } {
if { $stat != 1 } {
puts "Error : Boundary of face is not changed"
}
set x_coord 292
set y_coord 358
checkcolor $x_coord $y_coord 1 0 0
if { $stat != 1 } {
puts "Error : Boundary of face is not changed"
}
set x_coord 26
set y_coord 265
checkcolor $x_coord $y_coord 1 0 0
if { $stat != 1 } {
puts "Error : Boundary of face is not changed" puts "Error : Boundary of face is not changed"
} }

View File

@ -18,7 +18,10 @@ vhlrtype polyalgo b
set x_coord 290 set x_coord 290
set y_coord 170 set y_coord 170
checkcolor $x_coord $y_coord 1 1 0 vaspects -setwidth 5
if { "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW" } {
puts "Error : color is not yellow"
}
set x_coord 86 set x_coord 86
set y_coord 221 set y_coord 221

View File

@ -18,7 +18,10 @@ vhlrtype algo a
set x_coord 290 set x_coord 290
set y_coord 170 set y_coord 170
checkcolor $x_coord $y_coord 1 1 0 vaspects -setwidth 5
if { "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW" } {
puts "Error : color is not yellow"
}
set x_coord 86 set x_coord 86
set y_coord 221 set y_coord 221

View File

@ -17,9 +17,9 @@ vfit
vhlr on vhlr on
vhlrtype algo result vhlrtype algo result
checkcolor $x_coord $y_coord 1 1 0 vaspects -setwidth 5
if { "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW" } {
puts "Error : color is not yellow"
}
set only_screen 1 set only_screen 1

View File

@ -17,10 +17,9 @@ vfit
vhlr on vhlr on
vhlrtype algo result vhlrtype algo result
checkcolor $x_coord $y_coord 1 1 0 vaspects -setwidth 5
if { "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW" } {
puts "Error : color is not yellow"
}
set only_screen 1 set only_screen 1

View File

@ -16,12 +16,9 @@ vremove -context a
vdisplay a vdisplay a
vfit vfit
vaspects -setwidth 5
vmoveto 204 205 vmoveto 204 205
if { "[vreadpixel 204 205 rgb name]" != "CYAN1" } {
set x_coord 204
set y_coord 205
checkcolor $x_coord $y_coord 0 1 1
if { $stat != 1 } {
puts "Error : Erased object is not displayed after its removing." puts "Error : Erased object is not displayed after its removing."
} }

View File

@ -20,14 +20,7 @@ set R 0
set G 0.9843137264251709 set G 0.9843137264251709
set B 0 set B 0
decho off if {"[vreadpixel $x $y rgb]" == "$R $G $B" } {
set catch_status 0
if { [catch {QAGetPixelColor $x $y $R $G $B} catch_result] } {
set catch_status 1
}
decho on
if {${catch_status} == 0} {
puts "Error : color is bad" puts "Error : color is bad"
} else { } else {
puts "OK : color is good" puts "OK : color is good"

View File

@ -23,10 +23,9 @@ vdisplay b
vfit vfit
vtop vtop
vaspects -setwidth 5
vmoveto 199 200 vmoveto 199 200
checkcolor 199 200 0 1 1 if { "[vreadpixel 199 200 rgb name]" != "CYAN1" } {
if { $stat != 1 } {
puts "Error : The box is not selectable!" puts "Error : The box is not selectable!"
} }
@ -35,8 +34,6 @@ vaxo
vfit vfit
vmoveto 199 200 vmoveto 199 200
checkcolor 199 200 0 1 1 if { "[vreadpixel 199 200 rgb name]" != "CYAN1" } {
if { $stat != 1 } {
puts "Error : The box is not selectable!" puts "Error : The box is not selectable!"
} }

View File

@ -19,11 +19,9 @@ vfit
vviewparams -size 22 vviewparams -size 22
vaspects -setwidth 5
vmoveto 200 100 vmoveto 200 100
if { "[vreadpixel 200 9 rgb name]" != "CYAN1" } {
checkcolor 200 9 0 1 1
if { $stat != 1 } {
puts "Error : the view projection size is incorrect!" puts "Error : the view projection size is incorrect!"
} }

View File

@ -20,10 +20,9 @@ vclipplane create pln1
vclipplane set pln1 view Driver1/Viewer1/View1 vclipplane set pln1 view Driver1/Viewer1/View1
vclipplane change pln1 equation 0 1 0 0 vclipplane change pln1 equation 0 1 0 0
vfit vfit
vaspects -setwidth 5
checkcolor $check_x $check_y 0 1 1 if { "[vreadpixel $check_x $check_y rgb name]" != "CYAN1" } {
if {$stat != 1} {
puts "Error : Viewer clipping is broken." puts "Error : Viewer clipping is broken."
} }

View File

@ -11,20 +11,13 @@ vinit View1
vdisplay b vdisplay b
vfit vfit
vsetdispmode 1 vsetdispmode 1
vaspects -setwidth 5
vmoveto 200 200 vmoveto 200 200
if { "[vreadpixel 264 288 rgb name]" != "CYAN1" } {
set x1_coord 264
set y1_coord 288
set x2_coord 251
set y2_coord 271
checkcolor $x1_coord $y1_coord 0 1 1
if { $stat != 1 } {
puts "Error : Highlighting of dimension with flipping in local context failed." puts "Error : Highlighting of dimension with flipping in local context failed."
} }
checkcolor $x2_coord $y2_coord 0 1 1 if { "[vreadpixel 251 271 rgb name]" != "CYAN1" } {
if { $stat != 1 } {
puts "Error : Highlighting of dimension with flipping in local context failed." puts "Error : Highlighting of dimension with flipping in local context failed."
} }

View File

@ -18,10 +18,7 @@ vclipplane change pln1 capping on
vfit vfit
vmoveto 304 146 vmoveto 304 146
set x_coord 304 if { "[vreadpixel 304 146 rgb name]" != "CYAN1" } {
set y_coord 146
checkcolor $x_coord $y_coord 0 1 1
if { $stat != 1 } {
puts "Error : Highlighting is broken." puts "Error : Highlighting is broken."
} }

View File

@ -23,10 +23,7 @@ vselmode e1 1 1
vselect 0 0 2500 2500 vselect 0 0 2500 2500
verase -local verase -local
set x_coord 261 if { "[vreadpixel 261 204 rgb name]" != "BLACK" } {
set y_coord 204
checkcolor $x_coord $y_coord 0 0 0
if { $stat != 1 } {
puts "Error : Selection is not erased." puts "Error : Selection is not erased."
} }

View File

@ -12,41 +12,8 @@ OCC280 1 0
vfit vfit
set x1 135 set yellow_coords {{135 119} {387 33} {172 144} {28 190} {212 272} {60 343} {26 255} {389 113} {60 276}}
set y1 119 set black_coords {{160 257} {365 150} {353 99}}
set x2 387
set y2 33
set x3 172
set y3 144
set x4 28
set y4 190
set x5 160
set y5 257
set x6 365
set y6 150
set x7 212
set y7 272
set x8 60
set y8 343
set x9 26
set y9 255
set x10 353
set y10 99
set x11 389
set y11 113
set x12 60
set y12 276
# #
# ___________2________________ # ___________2________________
@ -86,17 +53,18 @@ set y12 276
# #
# #
checkcolor ${x1} ${y1} 1 1 0 vaspects -setwidth 5
checkcolor ${x2} ${y2} 1 1 0
checkcolor ${x3} ${y3} 1 1 0 foreach i $yellow_coords {
checkcolor ${x4} ${y4} 1 1 0 if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "YELLOW" } {
checkcolor ${x7} ${y7} 1 1 0 puts "Error : ${i} is not yellow"
checkcolor ${x8} ${y8} 1 1 0 }
checkcolor ${x9} ${y9} 1 1 0 }
checkcolor ${x11} ${y11} 1 1 0
checkcolor ${x12} ${y12} 1 1 0 foreach i $black_coords {
checkcolor ${x5} ${y5} 0 0 0 if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "BLACK" } {
checkcolor ${x6} ${y6} 0 0 0 puts "Error : ${i} is not black"
checkcolor ${x10} ${y10} 0 0 0 }
}
set only_screen 1 set only_screen 1

View File

@ -12,49 +12,9 @@ OCC280 1 1
vfit vfit
set x1 135 set yellow_coords {{135 119} {387 33} {172 144} {28 190} {212 272} {60 343} {26 255} {389 113} {60 276}}
set y1 119
set x2 387 set black_coords {{160 257} {365 150} {353 99}}
set y2 33
set x3 172
set y3 144
set x4 28
set y4 190
set x5 160
set y5 257
set x6 365
set y6 150
set x7 212
set y7 272
set x8 60
set y8 343
set x9 26
set y9 255
set x10 353
set y10 99
set x11 389
set y11 113
set x12 60
set y12 276
set Black_R 0
set Black_G 0
set Black_B 0
set Yellow_R 1
set Yellow_G 1
set Yellow_B 0
# #
# ___________2________________ # ___________2________________
@ -94,17 +54,18 @@ set Yellow_B 0
# #
# #
checkcolor ${x1} ${y1} ${Yellow_R} ${Yellow_G} ${Yellow_B} vaspects -setwidth 5
checkcolor ${x2} ${y2} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x3} ${y3} ${Yellow_R} ${Yellow_G} ${Yellow_B} foreach i $yellow_coords {
checkcolor ${x4} ${y4} ${Yellow_R} ${Yellow_G} ${Yellow_B} if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "YELLOW" } {
checkcolor ${x7} ${y7} ${Yellow_R} ${Yellow_G} ${Yellow_B} puts "Error : ${i} is not yellow"
checkcolor ${x8} ${y8} ${Yellow_R} ${Yellow_G} ${Yellow_B} }
checkcolor ${x9} ${y9} ${Yellow_R} ${Yellow_G} ${Yellow_B} }
checkcolor ${x11} ${y11} ${Yellow_R} ${Yellow_G} ${Yellow_B}
checkcolor ${x12} ${y12} ${Yellow_R} ${Yellow_G} ${Yellow_B} foreach i $black_coords {
checkcolor ${x5} ${y5} ${Black_R} ${Black_G} ${Black_B} if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "BLACK" } {
checkcolor ${x6} ${y6} ${Black_R} ${Black_G} ${Black_B} puts "Error : ${i} is not black"
checkcolor ${x10} ${y10} ${Black_R} ${Black_G} ${Black_B} }
}
set only_screen 0 set only_screen 0

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -1,9 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -1,10 +1,3 @@
if { [array get env os_type] != "" } {
set os $env(os_type)
}
if { [string compare $os "windows"] != 0 } {
}
puts "==================================" puts "=================================="
puts "BUC60569" puts "BUC60569"
puts "OCC597" puts "OCC597"

View File

@ -27,15 +27,13 @@ vtexture box [locate_data_file OCC5988_2d_floor.rgb]
set x 200 set x 200
set y 200 set y 200
decho off if { "[vreadpixel $x $y rgb name]" != "BLACK" } {
if [catch { QAGetPixelColor $x $y 0 0 0 } res] {
puts "box is not black - OK" puts "box is not black - OK"
puts "OK ${BugNumber}" puts "OK ${BugNumber}"
} else { } else {
puts "box is black - Faulty" puts "box is black - Faulty"
puts "Faulty ${BugNumber}" puts "Faulty ${BugNumber}"
} }
decho on
set only_screen 1 set only_screen 1

View File

@ -8,11 +8,14 @@ vinit
box b 10 10 10 box b 10 10 10
vdisplay b vdisplay b
vfit vfit
vaspects -setwidth 5
set x_coord 83 set x_coord 83
set y_coord 337 set y_coord 337
checkcolor $x_coord $y_coord 1 1 0 if { [vreadpixel ${x_coord} ${y_coord} rgb name] != "YELLOW" } {
puts "Error : color is not yellow"
}
set xmin 1 set xmin 1
set ymin 1 set ymin 1
@ -27,6 +30,8 @@ set Selection_R 0.8
set Selection_G 0.8 set Selection_G 0.8
set Selection_B 0.8 set Selection_B 0.8
checkcolor $x_coord $y_coord 0.8 0.8 0.8 if { [vreadpixel ${x_coord} ${y_coord} rgb name] != "GRAY80" } {
puts "Error : color is not gray"
}
set only_screen 1 set only_screen 1

View File

@ -37,17 +37,13 @@ if { ${NbSelected2} != 0 } {
set x [list 125 204 283 29 111 298 379 125 204 283 125 283] set x [list 125 204 283 29 111 298 379 125 204 283 125 283]
set y [list 47 100 47 200 150 150 200 250 300 250 361 361] set y [list 47 100 47 200 150 150 200 250 300 250 361 361]
vaspects -setwidth 5
puts "" puts ""
for {set i 0} {$i < 12} {incr i} { for {set i 0} {$i < 12} {incr i} {
set x_coord [lindex ${x} $i] if { [vreadpixel [lindex ${x} $i] [lindex ${y} $i] rgb name] != "YELLOW" } {
set y_coord [lindex ${y} $i]
checkcolor $x_coord $y_coord 1 1 0
if { ${stat} != 1 } {
set mistake 1 set mistake 1
} }
} }
puts "" puts ""
if { ${mistake} == 1 } { if { ${mistake} == 1 } {
puts "${BugNumber}: Faulty" puts "${BugNumber}: Faulty"

View File

@ -32,29 +32,19 @@ vinit
box b 10 10 10 box b 10 10 10
vdisplay b vdisplay b
vfit vfit
vaspects -setwidth 5
### FIRST PART ### FIRST PART
# Check Shape color # Check Shape color
checkcolor ${Shape_X} ${Shape_Y} 1 1 0 if { [vreadpixel ${Shape_X} ${Shape_Y} rgb name] != "YELLOW" } {
puts "Error : shape color is not yellow"
}
# Check Vertex color # Check Vertex color
checkcolor ${Vertex_X} ${Vertex_Y} 1 1 0 if { [vreadpixel ${Vertex_X} ${Vertex_Y} rgb name] != "YELLOW" } {
puts "Error : vertex color is not yellow"
# Check Edge color }
checkcolor ${Edge_X} ${Edge_Y} 1 1 0
# Check Wire color
checkcolor ${Wire_X} ${Wire_Y} 1 1 0
# Check Face color
checkcolor ${Face_X} ${Face_Y} 1 1 0
# Check Shell color
checkcolor ${Shell_X} ${Shell_Y} 1 1 0
# Check Solid color
checkcolor ${Solid_X} ${Solid_Y} 1 1 0
### SECOND PART ### SECOND PART
@ -69,7 +59,9 @@ if { ${GetSelectMode} != ${SetSelectMode} } {
} }
vmoveto ${Shape_X} ${Shape_Y} vmoveto ${Shape_X} ${Shape_Y}
checkcolor ${Shape_X} ${Shape_Y} 0 1 1 if { [vreadpixel ${Shape_X} ${Shape_Y} rgb name] != "CYAN1" } {
puts "Error : shape color is not cyan"
}
# Check Vertex color # Check Vertex color
vmoveto 1 1 vmoveto 1 1
@ -161,44 +153,14 @@ if { ${GetSelectMode} != ${SetSelectMode} } then {
# Check Shape color # Check Shape color
vmoveto 1 1 vmoveto 1 1
vmoveto ${Shape_X} ${Shape_Y} if { [vreadpixel ${Shape_X} ${Shape_Y} rgb name] != "YELLOW" } {
puts "Error : shape color is not yellow"
checkcolor ${Shape_X} ${Shape_Y} 1 1 0 }
# Check Vertex color # Check Vertex color
vmoveto 1 1 vmoveto 1 1
vmoveto ${Vertex_X} ${Vertex_Y} if { [vreadpixel ${Vertex_X} ${Vertex_Y} rgb name] != "YELLOW" } {
puts "Error : vertex color is not yellow"
checkcolor ${Vertex_X} ${Vertex_Y} 1 1 0 }
# Check Edge color
vmoveto 1 1
vmoveto ${Edge_X} ${Edge_Y}
checkcolor ${Edge_X} ${Edge_Y} 1 1 0
# Check Wire color
vmoveto 1 1
vmoveto ${Wire_X} ${Wire_Y}
checkcolor ${Wire_X} ${Wire_Y} 1 1 0
# Check Face color
vmoveto 1 1
vmoveto ${Face_X} ${Face_Y}
checkcolor ${Face_X} ${Face_Y} 1 1 0
# Check Shell color
vmoveto 1 1
vmoveto ${Shell_X} ${Shell_Y}
checkcolor ${Shell_X} ${Shell_Y} 1 1 0
# Check Solid color
vmoveto 1 1
vmoveto ${Solid_X} ${Solid_Y}
checkcolor ${Solid_X} ${Solid_Y} 1 1 0
set only_screen 1 set only_screen 1

View File

@ -10,9 +10,7 @@ GER61351 RED2
set x_coord 200 set x_coord 200
set y_coord 200 set y_coord 200
checkcolor $x_coord $y_coord 0.93 0 0 if {"[vreadpixel $x_coord $y_coord rgb name]" != "RED2"} {
if {$stat != 1} {
puts "Error : Background color is NOT RED2." puts "Error : Background color is NOT RED2."
} }

View File

@ -14,9 +14,8 @@ GER61351 0 255 0
set x_coord 200 set x_coord 200
set y_coord 200 set y_coord 200
checkcolor $x_coord $y_coord 0 1 0 #checkcolor $x_coord $y_coord 0 1 0
if {"[vreadpixel $x_coord $y_coord rgb name]" != "GREEN"} {
if {$stat != 1} {
puts "Error : Background color is NOT 0 1 0." puts "Error : Background color is NOT 0 1 0."
} }

View File

@ -1,9 +1,6 @@
puts "TODO ?OCC11111 ALL: Error on Record" puts "TODO ?OCC11111 ALL: Error on Record"
puts "TODO ?OCC11111 ALL: Error : Colors are not equal" puts "TODO ?OCC11111 ALL: Error : Colors are not equal"
puts "TODO ?OCC11111 ALL: \\*\\* Exception" puts "TODO ?OCC11111 ALL: \\*\\* Exception"
puts "TODO ?OCC11111 ALL: Faulty : colors are not equal."
puts "TODO ?OCC11111 ALL: Tcl Exception"
puts "TODO ?OCC11111 ALL: TEST INCOMPLETE"
pload QAcommands pload QAcommands

View File

@ -22,9 +22,9 @@ vfit
set x_coord 189 set x_coord 189
set y_coord 236 set y_coord 236
checkcolor $x_coord $y_coord 0 0 0.7 #checkcolor $x_coord $y_coord 0 0 0.7
if { ${stat} != 1 } { if { "[vreadpixel $x_coord $y_coord rgb name]" != "MATRABLUE" } {
puts "Error : There is missing triangle" puts "Error : There is missing triangle"
} }

View File

@ -6,15 +6,11 @@ puts ""
# Visualization - XCAFPrs_AISObject ignores visibility flag for sub-shapes # Visualization - XCAFPrs_AISObject ignores visibility flag for sub-shapes
###################################################### ######################################################
pload QAcommands
ReadStep D [locate_data_file bug25381_test_assembly_invisible.step] ReadStep D [locate_data_file bug25381_test_assembly_invisible.step]
XShow D XShow D
vfit vfit
decho off if { "[vreadpixel 198 172 rgb name]" != "WHITE" } {
if { [catch { QAGetPixelColor 198 172 1 1 1 }] != 0 } {
decho on
puts "OK : XCAFPrs_AISObject get visibility flag for sub-shapes" puts "OK : XCAFPrs_AISObject get visibility flag for sub-shapes"
} else { } else {
puts "Error : XCAFPrs_AISObject ignores visibility flag for sub-shapes" puts "Error : XCAFPrs_AISObject ignores visibility flag for sub-shapes"

View File

@ -1,135 +1 @@
# File : begin # File : begin
# Procedure to check color in the point near default coordinate
proc checkpoint {coord_x coord_y rd_ch gr_ch bl_ch} {
set x_start [expr ${coord_x} - 2]
set y_start [expr ${coord_y} - 2]
set mistake 0
set i 0
while { $mistake != 1 && $i <= 5 } {
set j 0
while { $mistake != 1 && $j <= 5 } {
set position_x [expr ${x_start} + $j]
set position_y [expr ${y_start} + $i]
puts $position_x
puts $position_y
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${position_x} ${position_y} ]
} else {
set color [ QAGetPixelColor ${position_x} ${position_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
puts "Warning : Point with true color was not found near default coordinates"
set mistake 0
} else {
set mistake 1
}
incr j
}
incr i
}
return $mistake
}
# Procedure to check color using command QAgetPixelColor with tolerance
proc checkcolor { coord_x coord_y rd_get gr_get bl_get } {
puts "Coordinate x = $coord_x"
puts "Coordinate y = $coord_y"
puts "RED color of RGB is $rd_get"
puts "GREEN color of RGB is $gr_get"
puts "BLUE color of RGB is $bl_get"
if { $coord_x <= 1 || $coord_y <= 1 } {
puts "Error : minimal coordinate is x = 2, y = 2. But we have x = $coord_x y = $coord_y"
return -1
}
global color2d
if { [info exists color2d] } {
set color [ QAAISGetPixelColor2d ${coord_x} ${coord_y} ]
} else {
set color [ QAGetPixelColor ${coord_x} ${coord_y} ]
}
regexp {RED +: +([-0-9.+eE]+)} $color full rd
regexp {GREEN +: +([-0-9.+eE]+)} $color full gr
regexp {BLUE +: +([-0-9.+eE]+)} $color full bl
set rd_int [expr int($rd * 1.e+05)]
set gr_int [expr int($gr * 1.e+05)]
set bl_int [expr int($bl * 1.e+05)]
set rd_ch [expr int($rd_get * 1.e+05)]
set gr_ch [expr int($gr_get * 1.e+05)]
set bl_ch [expr int($bl_get * 1.e+05)]
if { $rd_ch != 0 } {
set tol_rd [expr abs($rd_ch - $rd_int)/$rd_ch]
} else {
set tol_rd $rd_int
}
if { $gr_ch != 0 } {
set tol_gr [expr abs($gr_ch - $gr_int)/$gr_ch]
} else {
set tol_gr $gr_int
}
if { $bl_ch != 0 } {
set tol_bl [expr abs($bl_ch - $bl_int)/$bl_ch]
} else {
set tol_bl $bl_int
}
set status 0
if { $tol_rd > 0.2 } {
puts "Warning : RED light of additive color model RGB is invalid"
set status 1
}
if { $tol_gr > 0.2 } {
puts "Warning : GREEN light of additive color model RGB is invalid"
set status 1
}
if { $tol_bl > 0.2 } {
puts "Warning : BLUE light of additive color model RGB is invalid"
set status 1
}
if { $status != 0 } {
puts "Warning : Colors of default coordinate are not equal"
}
global stat
if { $tol_rd > 0.2 || $tol_gr > 0.2 || $tol_bl > 0.2 } {
set info [checkpoint $coord_x $coord_y $rd_ch $gr_ch $bl_ch]
set stat [lindex $info end]
if { ${stat} != 1 } {
puts "Error : Colors are not equal in default coordinate and in the near coordinates too"
return $stat
} else {
puts "Point with valid color was found"
return $stat
}
} else {
set stat 1
}
}