0023493: Incorrect QAGetPixelColor usage
authorski <ski@opencascade.com>
Thu, 11 Dec 2014 13:47:12 +0000 (16:47 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 11 Dec 2014 13:48:05 +0000 (16:48 +0300)
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

56 files changed:
src/DrawResources/TestCommands.tcl
src/QADraw/QADraw.cxx
tests/bugs/begin
tests/bugs/iges/bug22888
tests/bugs/modalg_2/bug21909
tests/bugs/modalg_2/bug22884
tests/bugs/moddata_1/bug22039
tests/bugs/vis/buc60574
tests/bugs/vis/buc60688
tests/bugs/vis/bug11615
tests/bugs/vis/bug1174
tests/bugs/vis/bug12121
tests/bugs/vis/bug173_2
tests/bugs/vis/bug173_3
tests/bugs/vis/bug223
tests/bugs/vis/bug22900
tests/bugs/vis/bug22906
tests/bugs/vis/bug23012
tests/bugs/vis/bug23102
tests/bugs/vis/bug23153
tests/bugs/vis/bug232
tests/bugs/vis/bug23226
tests/bugs/vis/bug23363
tests/bugs/vis/bug23385
tests/bugs/vis/bug23407_2
tests/bugs/vis/bug23709_1
tests/bugs/vis/bug23709_2
tests/bugs/vis/bug23709_3
tests/bugs/vis/bug23709_4
tests/bugs/vis/bug24391
tests/bugs/vis/bug24555
tests/bugs/vis/bug24564
tests/bugs/vis/bug24714
tests/bugs/vis/bug24717
tests/bugs/vis/bug24867
tests/bugs/vis/bug24901
tests/bugs/vis/bug24966
tests/bugs/vis/bug349
tests/bugs/vis/bug349_1
tests/bugs/vis/bug597_1
tests/bugs/vis/bug597_2
tests/bugs/vis/bug597_3
tests/bugs/vis/bug597_4
tests/bugs/vis/bug597_5
tests/bugs/vis/bug597_6
tests/bugs/vis/bug597_7
tests/bugs/vis/bug5988
tests/bugs/vis/bug60
tests/bugs/vis/bug7186
tests/bugs/vis/bug74
tests/bugs/vis/ger61351_1
tests/bugs/vis/ger61351_2
tests/bugs/xde/bug22982
tests/bugs/xde/bug23193
tests/bugs/xde/bug25381
tests/demo/begin

index 5fe1c0a..1b55491 100644 (file)
@@ -2026,3 +2026,145 @@ proc _testgrid_process_jobs {worker {nb_ok 0}} {
     }
     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
+}
index 9e6c04a..5020a2b 100644 (file)
 #include <QADraw.hxx>
 #include <Draw.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_EventManager.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_HSequenceOfReal.hxx>
 #include <TopoDS_Shape.hxx>
 #include <AIS_InteractiveContext.hxx>
-#include <Aspect_Window.hxx>
-#include <Aspect_DisplayConnection.hxx>
 #include <DBRep.hxx>
 #include <Bnd_Box.hxx>
 #include <BRepBndLib.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)
 extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
@@ -365,12 +240,6 @@ void QADraw::CommonCommands (Draw_Interpretor& theCommands)
 {
   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",
                    "vtri_orig         : vtri_orig trihedron_name  -  draws axis origin lines",
                    __FILE__,
index ae31bbe..4d7a00a 100755 (executable)
@@ -53,141 +53,6 @@ proc checkarea {shape 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
 # adding the same delta on each step.
 #
index a1e5deb..b22a42d 100755 (executable)
@@ -29,10 +29,10 @@ 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 [QAGetPixelColor ${x1} ${y1}]
-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 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)"
index f887287..47fffd3 100755 (executable)
@@ -45,17 +45,9 @@ vmoveto ${x1} ${y1}
 
 set status 0
 for {set i ${y1} } {$i <= ${y2} } {incr i} {
-    set Color1 [QAGetPixelColor ${x1} ${i}]
-
-    set R1 [lindex ${Color1} 2]
-    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}"
+    if { "[vreadpixel ${x1} ${i} rgb name]" == "BLACK" } {
+      incr status
+      puts "Error : rendering  x = ${x1}  y = ${i}"
     }
 }
 
index 03aa90c..6af4f51 100755 (executable)
@@ -31,22 +31,10 @@ set nb_compsol_good 0
 set nb_compound_good 0
 set nb_shape_good 96
 
-set Color [QAGetPixelColor $x1 $y1]
-set R [lindex ${Color} 2]
-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
+if { "[vreadpixel $x1 $y1 rgb name]" == "BLACK" } {
+    puts "Faulty ${BugNumber}"
 } else {
-    set color_status 0
-}
-
-
-if { ${color_status} == 0} {
-   puts "OK ${BugNumber}"
-} else {
-   puts "Faulty ${BugNumber}"
+    puts "OK ${BugNumber}"
 }
 
 set 3dviewer 0
index e350bf3..ec41bf4 100755 (executable)
@@ -20,27 +20,18 @@ vfit
 ###set x1 101
 set x1 102
 set y1 199
-set Color [QAGetPixelColor ${x1} ${y1}]
+set Color [vreadpixel ${x1} ${y1} rgb]
 
 vmoveto ${x1} ${y1}
-set ColorMove [QAGetPixelColor ${x1} ${y1}]
+set ColorMove [vreadpixel ${x1} ${y1} rgb]
 
 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} } {
-  set Color_Status 0
+  puts "OK ${BugNumber}"
 } else {
-  set Color_Status 1
-}
-
-# Resume
-puts ""
-if { ${Color_Status} != 0} {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
+  puts "Faulty ${BugNumber}"
 }
 
 set square 24859.6
index b439537..3155b26 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "==========="
 puts "BUC60574"
 puts "==========="
index 94a216d..0414c27 100755 (executable)
@@ -26,9 +26,8 @@ puts ""
 set x_coord 88
 set y_coord 272
 
-checkcolor $x_coord $y_coord 0.8 0.8 0.8
-
-if {$stat != 1} {
+vaspects -setwidth 5
+if {"[vreadpixel $x_coord $y_coord rgb name]" != "GRAY80"} {
    puts "Error : The rectangular is NOT highlighted."
 }
 
index c13f0d1..4c6b2e9 100755 (executable)
@@ -16,13 +16,14 @@ vscale 1 1 1
 
 set x1 [list 165 340 70]
 set y1 [list 384 283 79]
-
+vaspects -setwidth 5
 puts ""
 for {set i 0} {$i < 3} {incr i} {
    set x_coord [lindex ${x1} $i]
    set y_coord [lindex ${y1} $i]
-
-   checkcolor $x_coord $y_coord 1 1 0
+   if {  "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW"  } {
+     puts "Error : color is not yellow"
+   }
 }
 
 vscale 0.5 1.5 0.7
@@ -35,8 +36,9 @@ puts ""
 for {set i 0} {$i < 3} {incr i} {
    set x_coord [lindex ${x2} $i]
    set y_coord [lindex ${y2} $i]
-
-   checkcolor $x_coord $y_coord 1 1 0
+   if {  "[vreadpixel $x_coord $y_coord rgb name]" != "YELLOW"  } {
+     puts "Error : color is not yellow"
+   }
 }
 
 set only_screen 1
index bf84119..98207fe 100755 (executable)
@@ -38,15 +38,15 @@ set y_GREEN 180
 set x_BLUE 180
 set y_BLUE 250
 
-set ColorList1 [QAGetPixelColor ${x_GREEN} ${y_GREEN}]
-regexp {RED +: +([-0-9.+eE]+)} $ColorList1 full RED_1
-regexp {GREEN +: +([-0-9.+eE]+)} $ColorList1 full GREEN_1
-regexp {BLUE +: +([-0-9.+eE]+)} $ColorList1 full BLUE_1
+set ColorList1 [vreadpixel ${x_GREEN} ${y_GREEN} rgb]
+set RED_1   [lindex $ColorList1 0]
+set GREEN_1 [lindex $ColorList1 1]
+set BLUE_1  [lindex $ColorList1 2]
 
-set ColorList2 [QAGetPixelColor ${x_BLUE} ${y_BLUE}]
-regexp {RED +: +([-0-9.+eE]+)} $ColorList2 full RED_2
-regexp {GREEN +: +([-0-9.+eE]+)} $ColorList2 full GREEN_2
-regexp {BLUE +: +([-0-9.+eE]+)} $ColorList2 full BLUE_2
+set ColorList2 [vreadpixel ${x_BLUE} ${y_BLUE} rgb]
+set RED_2   [lindex $ColorList2 0]
+set GREEN_2 [lindex $ColorList2 1]
+set BLUE_2  [lindex $ColorList2 2]
 
 if {${RED_1} == 0 && ${GREEN_1} > 0 && ${BLUE_1} == 0} {
    set IsGreen 1
index dda4aca..90a211b 100755 (executable)
@@ -61,12 +61,12 @@ vdisplay obj
 vconnect new 50 50 50 obj
 vfit
 vmoveto $x1 $y1
-set ColorObj1 [QAGetPixelColor ${x2} ${y2}]
-set ColorNew1 [QAGetPixelColor ${x3} ${y3}]
+set ColorObj1 [vreadpixel ${x2} ${y2} rgb]
+set ColorNew1 [vreadpixel ${x3} ${y3} rgb]
 
 vselect $x1 $y1
-set ColorObj2 [QAGetPixelColor ${x2} ${y2}]
-set ColorNew2 [QAGetPixelColor ${x3} ${y3}]
+set ColorObj2 [vreadpixel ${x2} ${y2} rgb]
+set ColorNew2 [vreadpixel ${x3} ${y3} rgb]
 
 puts "Check vconnect command"
 set status_vconnect 0
index 2c6a746..341a53f 100755 (executable)
@@ -17,17 +17,17 @@ vdisplay result
 vfit
 vsetdispmode result 1
 
-set color1 [QAGetPixelColor 175 195]
-regexp {RED +: +([-0-9.+eE]+)} $color1 full rd1
-regexp {GREEN +: +([-0-9.+eE]+)} $color1 full gr1
-regexp {BLUE +: +([-0-9.+eE]+)} $color1 full bl1
+set color1 [vreadpixel 175 195 rgb]
+set rd1 [lindex $color1 0]
+set gr1 [lindex $color1 1]
+set bl1 [lindex $color1 2]
 
 vsetmaterial result ALUMINIUM
 
-set color2 [QAGetPixelColor 175 195]
-regexp {RED +: +([-0-9.+eE]+)} $color2 full rd2
-regexp {GREEN +: +([-0-9.+eE]+)} $color2 full gr2
-regexp {BLUE +: +([-0-9.+eE]+)} $color2 full bl2
+set color2 [vreadpixel 175 195 rgb]
+set rd2 [lindex $color2 0]
+set gr2 [lindex $color2 1]
+set bl2 [lindex $color2 2]
 
 if { ${rd2} == ${rd1} || ${gr2} == ${gr1} || ${bl2} == ${bl1} } {
    puts "Error : material of the shape was NOT changed"
index bca8b0e..5cd637b 100755 (executable)
@@ -18,18 +18,18 @@ vdisplay result
 vfit
 vsetdispmode result 1
 
-set color1 [QAGetPixelColor 175 195]
-regexp {RED +: +([-0-9.+eE]+)} $color1 full rd1
-regexp {GREEN +: +([-0-9.+eE]+)} $color1 full gr1
-regexp {BLUE +: +([-0-9.+eE]+)} $color1 full bl1
+set color1 [vreadpixel 175 195 rgb]
+set rd1 [lindex $color1 0]
+set gr1 [lindex $color1 1]
+set bl1 [lindex $color1 2]
 
 ########################################################
 vsettransparency result 0.5
 
-set color2 [QAGetPixelColor 175 195]
-regexp {RED +: +([-0-9.+eE]+)} $color2 full rd2
-regexp {GREEN +: +([-0-9.+eE]+)} $color2 full gr2
-regexp {BLUE +: +([-0-9.+eE]+)} $color2 full bl2
+set color2 [vreadpixel 175 195 rgb]
+set rd2 [lindex $color2 0]
+set gr2 [lindex $color2 1]
+set bl2 [lindex $color2 2]
 
 if { ${rd2} == ${rd1} || ${gr2} == ${gr1} || ${bl2} == ${bl1} } {
     puts "Error : vsettransparency of shape was NOT made"
index 643113f..ad1feba 100755 (executable)
@@ -28,10 +28,10 @@ vsetcolor face GREEN1
 vsetdispmode  cylinder 1
 vsetcolor cylinder RED1
 
-set ColorList [QAGetPixelColor $Start_X $Start_Y]
-regexp {RED +: +([-0-9.+eE]+)} $ColorList full R_START_POINT
-regexp {GREEN +: +([-0-9.+eE]+)} $ColorList full G_START_POINT
-regexp {BLUE +: +([-0-9.+eE]+)} $ColorList full B_START_POINT
+set ColorList [vreadpixel ${Start_X} ${Start_Y} rgb]
+set R_START_POINT [lindex $ColorList 0]
+set G_START_POINT [lindex $ColorList 1]
+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"
 
index 3d3e9fc..ec0a1f5 100755 (executable)
@@ -27,6 +27,6 @@ vsetcolor c1 GREEN
 vsetdispmode 1
 vsetcolor c1 RED
 
-checkcolor ${x1} ${y1}] 1 0 0
+checkcolor ${x1} ${y1} 1 0 0
 
 set only_screen 1
index 47a91e6..a7a17cd 100755 (executable)
@@ -22,33 +22,25 @@ set y4 232
 
 vinit
 vsetgradientbg 255 0 0 0 0 255 4
-set Color1 [QAGetPixelColor ${x1} ${y1}]
-set Color2 [QAGetPixelColor ${x2} ${y2}]
-set Color3 [QAGetPixelColor ${x3} ${y3}]
-set Color4 [QAGetPixelColor ${x4} ${y4}]
+set Color1 [vreadpixel ${x1} ${y1} rgb]
+set Color2 [vreadpixel ${x2} ${y2} rgb]
+set Color3 [vreadpixel ${x3} ${y3} rgb]
+set Color4 [vreadpixel ${x4} ${y4} rgb]
 vclipplane create pln1
 vclipplane change pln1 equation 1 0 0 -0.1
 vclipplane set pln1 view Driver1/Viewer1/View1
 box b 100 100 100
 vdisplay b
 vsetdispmode 1
-set ColorRes1 [QAGetPixelColor ${x1} ${y1}]
-set ColorRes2 [QAGetPixelColor ${x2} ${y2}]
-set ColorRes3 [QAGetPixelColor ${x3} ${y3}]
-set ColorRes4 [QAGetPixelColor ${x4} ${y4}]
+set ColorRes1 [vreadpixel ${x1} ${y1} rgb]
+set ColorRes2 [vreadpixel ${x2} ${y2} rgb]
+set ColorRes3 [vreadpixel ${x3} ${y3} rgb]
+set ColorRes4 [vreadpixel ${x4} ${y4} rgb]
 
-set status 0
 if { ${Color1} == ${ColorRes1} && ${Color2} == ${ColorRes2} && ${Color3} == ${ColorRes3} && ${Color4} == ${ColorRes4}} {
-    set status 0
+    puts "OK ${BugNumber}"
 } else {
-    set status 1
+    puts "Faulty ${BugNumber}"
 }
 
-# Resume
-puts ""
-if { ${status} != 0} {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
 set only_screen 1
index 0dfdeb5..84fbd11 100755 (executable)
@@ -24,31 +24,17 @@ vsetdispmode b_1 1
 vselprecision
 vselprecision 1 0.1
 
-set ColorBefore [QAGetPixelColor ${x1} ${y1}]
-set R1 [lindex ${ColorBefore} 2]
-set G1 [lindex ${ColorBefore} 5]
-set B1 [lindex ${ColorBefore} 8]
+set ColorBefore [vreadpixel ${x1} ${y1} rgb]
 
 vmoveto ${x2} ${y2}
 
-set ColorAfter [QAGetPixelColor ${x1} ${y1}]
-set R2 [lindex ${ColorAfter} 2]
-set G2 [lindex ${ColorAfter} 5]
-set B2 [lindex ${ColorAfter} 8]
+set ColorAfter [vreadpixel ${x2} ${y2} rgb]
 
-set check_color 0
-if { ${R1} == ${R2} && ${G1} == ${G2} && ${B1} == ${B2} } {
-    set check_color 0
+if { "$ColorBefore" == "$ColorAfter" } {
+    puts "OK ${BugNumber}"
 } else {
-    set check_color 1
+    puts "Faulty ${BugNumber}"
 }
 
-# Resume
-puts ""
-if { ${check_color} != 0} {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
 vfit
 set only_screen 1
index a237fb7..6fd8788 100755 (executable)
@@ -17,14 +17,13 @@ set R_bg 0.70196002721786499
 set G_bg 0.78039199113845825
 set B_bg 0.86274499999999998
 
-set Color [QAGetPixelColor ${x1} ${y1}]
-set R [lindex ${Color} 2]
-set G [lindex ${Color} 5]
-set B [lindex ${Color} 8]
+set WrongColor "$R_bg $G_bg $B_bg"
+
+set Color [vreadpixel ${x1} ${y1} rgb]
 
 #Resume
 puts ""
-if { $R != ${R_bg} && $G != ${G_bg} && $B != ${B_bg} } {
+if { "[vreadpixel ${x1} ${y1} rgb]" != "$WrongColor" } {
    puts "OK ${BugNumber}"
 } else {
   puts "Faulty ${BugNumber}"
index e20a3e5..a4cea94 100755 (executable)
@@ -33,39 +33,24 @@ vtop
 vfit
 
 set status 0
-set RED 0
-set GREEN 0
-set BLUE 0
 set x1 223
 set y1 195
-set Color1 [QAGetPixelColor ${x1} ${y1}]
-regexp {RED +: +([-0-9.+eE]+)} $Color1 full R1
-regexp {GREEN +: +([-0-9.+eE]+)} $Color1 full G1
-regexp {BLUE +: +([-0-9.+eE]+)} $Color1 full B1
-if { $R1 == ${RED} && $G1 == ${GREEN} && $B1 == ${BLUE} } {
+
+if { "[vreadpixel $x1 $y1 rgb name]" == "BLACK" } {
     set status 1
     puts "Faulty Color1"
 }
 
 set x2 224
 set y2 240
-set Color2 [QAGetPixelColor ${x2} ${y2}]
-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} } {
+if { "[vreadpixel $x2 $y2 rgb name]" == "BLACK" } {
     set status 1
     puts "Faulty Color2"
 }
 
 set x3 223
 set y3 266
-set Color3 [QAGetPixelColor ${x3} ${y3}]
-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} } {
+if { "[vreadpixel $x3 $y3 rgb name]" == "BLACK" } {
     set status 1
     puts "Faulty Color3"
 }
index 8bb8dee..d93edfd 100755 (executable)
@@ -32,18 +32,22 @@ 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"
-catch {QAGetPixelColor $x1 $y1 $Yellow_R $Yellow_G $Yellow_B} result11
-catch {QAGetPixelColor $x2 $y2 $Yellow_R $Yellow_G $Yellow_B} result12
-catch {QAGetPixelColor $x3 $y3 $Yellow_R $Yellow_G $Yellow_B} result13
-catch {QAGetPixelColor $x4 $y4 $Yellow_R $Yellow_G $Yellow_B} result14
-catch {QAGetPixelColor $x5 $y5 $Yellow_R $Yellow_G $Yellow_B} result15
-catch {QAGetPixelColor $x6 $y6 $Yellow_R $Yellow_G $Yellow_B} result16
+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"
@@ -51,59 +55,27 @@ vmoveto $x2 $y2
 
 # 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
-catch {QAGetPixelColor $x3 $y3 $Yellow_R $Yellow_G $Yellow_B} result22
-catch {QAGetPixelColor $x4 $y4 $Yellow_R $Yellow_G $Yellow_B} result23
-catch {QAGetPixelColor $x5 $y5 $Yellow_R $Yellow_G $Yellow_B} result24
-catch {QAGetPixelColor $x6 $y6 $Yellow_R $Yellow_G $Yellow_B} result25
+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 } {
-   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
-if { [regexp "Faulty" $result11] == 1 } {
-   set IsFaulty 1
-}
-if { [regexp "Faulty" $result12] == 1 } {
+if { !($result11 && $result12 && $result13 && $result14 && $result15 && $result16)
+  || !($result21 && $result22 && $result23 && $result24 && $result25) } {
    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} {
    puts "Error : OCC232"
index de73740..5f81f9f 100755 (executable)
@@ -84,8 +84,7 @@ proc check_primitive {name1 r g b args} {
        set HasPixel 0
        for {set i 0} {$i < $limit_x} {incr i} {
                for {set j 0} {$j < $limit_y} {incr j} {
-                       set QATestVar [ catch { QAGetPixelColor $i $j $r $g $b } ]
-                       if { $QATestVar == 0 } {
+                       if { "[vreadpixel $i $j rgb]" == "$r $g $b" } {
                                set HasPixel 1
                        }
                }
@@ -100,8 +99,8 @@ proc check_primitive {name1 r g b args} {
        set HasPixel 1
        for {set i 0} {$i < $limit_x} {incr i} {
                for {set j 0} {$j < $limit_y} {incr j} {
-                       set QATestVar [ catch { QAGetPixelColor $i [expr $view_height-$j] $r $g $b  } ]
-                       if { $QATestVar == 0 } {
+                       set coord_y [expr $view_height-$j]
+                       if { "[vreadpixel $i $coord_y rgb]" == "$r $g $b" } {
                                set HasPixel 1
                        }
                }
@@ -116,8 +115,9 @@ proc check_primitive {name1 r g b args} {
        set HasPixel 1
        for {set i 0} {$i < $limit_x} {incr i} {
                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  } ]
-                       if { $QATestVar == 0 } {
+                       set coord_x [expr ($view_width-$limit_y) + $i]
+                       set coord_y [expr ($view_height-$limit_y)/2 + $j]
+                       if { "[vreadpixel $coord_x $coord_y rgb]" == "$r $g $b" } {
                                set HasPixel 1
                        }
                }
@@ -132,8 +132,9 @@ proc check_primitive {name1 r g b args} {
        set HasPixel 0
        for {set i 0} {$i < $limit_x} {incr i} {
                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  } ]
-                       if { $QATestVar == 0 } {
+                       set coord_x [expr $view_width/4 + $i]
+                       set coord_y [expr ($view_height-$limit_y)/2 + $j]
+                       if { "[vreadpixel $coord_x $coord_y rgb]" == "$r $g $b" } {
                                set HasPixel 1
                        }
                }
index 8c32306..236b154 100755 (executable)
@@ -15,11 +15,10 @@ vdisplay p
 vsetdispmode p 1
 vsetinteriorstyle p 1
 
-set color [QAGetPixelColor 10 0]
-regexp {RED +: +([-0-9.+eE]+)} $color full R_check
-
 puts ""
-if { ${R_check} == 0 } {
+set color1 [vreadpixel 10 0 rgb]
+set rd1 [lindex $color1 0]
+if { $rd1 == 0 } {
   puts "Faulty ${BugNumber}"
 } else {
   puts "OK ${BugNumber}"
index b8beee8..f0ff8ee 100755 (executable)
@@ -17,22 +17,10 @@ vtexrepeat b_16 3 2
 vsetdispmode b_16 1
 vfit
 
-set color [QAGetPixelColor 85 73]
-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
+if { "[vreadpixel 85 73 rgb name]" != "BLACK" } {
+    puts "OK ${BugNumber}"
 } else {
-    set color_status 1
-}
-
-puts ""
-if { ${color_status} != 0 } {
     puts "Faulty ${BugNumber}"
-} else {
-    puts "OK ${BugNumber}"
 }
 
 set only_screen 1
index 56a7bec..1b9a435 100755 (executable)
@@ -12,31 +12,12 @@ vdisplay b
 vsetdispmode 1
 vshowfaceboundary b 1 255 0 0 10 1
 vfit
+vaspects -setwidth 5
 
-set x_coord 183
-set y_coord 190
-
-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 } {
+if { "[vreadpixel 183 190 rgb name]" != "RED"
+  || "[vreadpixel 292 358 rgb name]" != "RED"
+  || "[vreadpixel 26 265 rgb name]" != "RED"
+} {
     puts "Error : Boundary of face is not changed"
 }
 
index 60a928a..de5814d 100644 (file)
@@ -18,7 +18,10 @@ vhlrtype polyalgo b
 
 set x_coord 290
 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 y_coord 221
index 507df8c..3ddc673 100644 (file)
@@ -18,7 +18,10 @@ vhlrtype algo a
 
 set x_coord 290
 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 y_coord 221
index 4c5f174..225d7c3 100644 (file)
@@ -17,9 +17,9 @@ vfit
 vhlr on
 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
-
-
-
index 5186c2b..350cf50 100644 (file)
@@ -17,10 +17,9 @@ vfit
 vhlr on
 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
-
-
-
-
index 7bc3720..753bd8d 100644 (file)
@@ -16,12 +16,9 @@ vremove -context a
 vdisplay a
 vfit
 
+vaspects -setwidth 5
 vmoveto 204 205
-
-set x_coord 204
-set y_coord 205
-checkcolor $x_coord $y_coord 0 1 1
-if { $stat != 1 } {
+if {  "[vreadpixel 204 205 rgb name]" != "CYAN1"  } {
    puts "Error : Erased object is not displayed after its removing."
 }
 
index 1fd7d04..e1eb6cd 100755 (executable)
@@ -20,14 +20,7 @@ set R 0
 set G 0.9843137264251709
 set B 0
 
-decho off
-set catch_status 0
-if { [catch {QAGetPixelColor $x $y $R $G $B} catch_result] } {
-   set catch_status 1
-}
-decho on
-
-if {${catch_status} == 0} {
+if {"[vreadpixel $x $y rgb]" == "$R $G $B" } {
    puts "Error : color is bad"
 } else {
    puts "OK : color is good"
index b7caab0..7d7f315 100644 (file)
@@ -23,10 +23,9 @@ vdisplay b
 vfit
 vtop
 
+vaspects -setwidth 5
 vmoveto 199 200
-checkcolor 199 200 0 1 1
-
-if { $stat != 1 } {
+if { "[vreadpixel 199 200 rgb name]" != "CYAN1"  } {
   puts "Error : The box is not selectable!"
 }
 
@@ -35,8 +34,6 @@ vaxo
 vfit
 
 vmoveto 199 200
-checkcolor 199 200 0 1 1
-
-if { $stat != 1 } {
+if { "[vreadpixel 199 200 rgb name]" != "CYAN1"  } {
   puts "Error : The box is not selectable!"
 }
index 04f33a3..aade48c 100644 (file)
@@ -19,11 +19,9 @@ vfit
 
 vviewparams -size 22
 
+vaspects -setwidth 5
 vmoveto 200 100
-
-checkcolor 200 9 0 1 1
-
-if { $stat != 1 } {
+if { "[vreadpixel 200 9 rgb name]" != "CYAN1" } {
   puts "Error : the view projection size is incorrect!"
 }
 
index 06ead27..5acd33f 100644 (file)
@@ -20,10 +20,9 @@ vclipplane create pln1
 vclipplane set pln1 view Driver1/Viewer1/View1
 vclipplane change pln1 equation 0 1 0 0
 vfit
+vaspects -setwidth 5
 
-checkcolor $check_x $check_y 0 1 1
-
-if {$stat != 1} {
+if { "[vreadpixel $check_x $check_y rgb name]" != "CYAN1" } {
     puts "Error : Viewer clipping is broken."
 }
 
index 468585c..3d87f0f 100644 (file)
@@ -11,20 +11,13 @@ vinit View1
 vdisplay b
 vfit
 vsetdispmode 1
+vaspects -setwidth 5
 vmoveto 200 200
-
-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 } {
+if { "[vreadpixel 264 288 rgb name]" != "CYAN1" } {
   puts "Error : Highlighting of dimension with flipping in local context failed."
 }
 
-checkcolor $x2_coord $y2_coord 0 1 1
-if { $stat != 1 } {
+if { "[vreadpixel 251 271 rgb name]" != "CYAN1" } {
   puts "Error : Highlighting of dimension with flipping in local context failed."
 }
 
index 215e0b2..01de2e1 100755 (executable)
@@ -18,10 +18,7 @@ vclipplane change pln1 capping on
 vfit
 vmoveto 304 146
 
-set x_coord 304
-set y_coord 146
-checkcolor $x_coord $y_coord 0 1 1
-if { $stat != 1 } {
+if { "[vreadpixel 304 146 rgb name]" != "CYAN1" } {
    puts "Error : Highlighting is broken."
 }
 
index e6841dd..ead507d 100644 (file)
@@ -23,10 +23,7 @@ vselmode e1 1 1
 vselect 0 0 2500 2500
 verase -local
 
-set x_coord 261
-set y_coord 204
-checkcolor $x_coord $y_coord 0 0 0
-if { $stat != 1 } {
+if { "[vreadpixel 261 204 rgb name]" != "BLACK" } {
    puts "Error : Selection is not erased."
 }
 
index 28a4a01..a6f535c 100755 (executable)
@@ -12,41 +12,8 @@ OCC280 1 0
 
 vfit
 
-set x1 135
-set y1 119
-
-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
+set yellow_coords {{135 119} {387 33} {172 144} {28 190} {212 272} {60 343} {26 255} {389 113} {60 276}}
+set black_coords {{160 257} {365 150} {353 99}}
 
 #
 #              ___________2________________
@@ -86,17 +53,18 @@ set y12 276
 #
 #
 
-checkcolor ${x1} ${y1} 1 1 0
-checkcolor ${x2} ${y2} 1 1 0
-checkcolor ${x3} ${y3} 1 1 0
-checkcolor ${x4} ${y4} 1 1 0
-checkcolor ${x7} ${y7} 1 1 0
-checkcolor ${x8} ${y8} 1 1 0
-checkcolor ${x9} ${y9} 1 1 0
-checkcolor ${x11} ${y11} 1 1 0
-checkcolor ${x12} ${y12} 1 1 0
-checkcolor ${x5} ${y5} 0 0 0
-checkcolor ${x6} ${y6} 0 0 0
-checkcolor ${x10} ${y10} 0 0 0
+vaspects -setwidth 5
+
+foreach i $yellow_coords {
+  if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "YELLOW" } {
+    puts "Error : ${i} is not yellow"
+  }
+}
+
+foreach i $black_coords {
+  if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "BLACK" } {
+    puts "Error : ${i} is not black"
+  }
+}
 
 set only_screen 1
index ce1a8b1..4400460 100755 (executable)
@@ -12,49 +12,9 @@ OCC280 1 1
 
 vfit
 
-set x1 135
-set y1 119
+set yellow_coords {{135 119} {387 33} {172 144} {28 190} {212 272} {60 343} {26 255} {389 113} {60 276}}
 
-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
-
-set Black_R 0
-set Black_G 0
-set Black_B 0
-
-set Yellow_R 1
-set Yellow_G 1
-set Yellow_B 0
+set black_coords {{160 257} {365 150} {353 99}}
 
 #
 #              ___________2________________
@@ -94,17 +54,18 @@ set Yellow_B 0
 #
 #
 
-checkcolor ${x1}  ${y1}  ${Yellow_R} ${Yellow_G} ${Yellow_B}
-checkcolor ${x2}  ${y2}  ${Yellow_R} ${Yellow_G} ${Yellow_B}
-checkcolor ${x3}  ${y3}  ${Yellow_R} ${Yellow_G} ${Yellow_B}
-checkcolor ${x4}  ${y4}  ${Yellow_R} ${Yellow_G} ${Yellow_B}
-checkcolor ${x7}  ${y7}  ${Yellow_R} ${Yellow_G} ${Yellow_B}
-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}
-checkcolor ${x5}  ${y5}  ${Black_R} ${Black_G} ${Black_B}
-checkcolor ${x6}  ${y6}  ${Black_R} ${Black_G} ${Black_B}
-checkcolor ${x10} ${y10} ${Black_R} ${Black_G} ${Black_B}
+vaspects -setwidth 5
+
+foreach i $yellow_coords {
+  if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "YELLOW" } {
+    puts "Error : ${i} is not yellow"
+  }
+}
+
+foreach i $black_coords {
+  if {"[vreadpixel [lindex $i 0] [lindex $i 1] rgb name]" != "BLACK" } {
+    puts "Error : ${i} is not black"
+  }
+}
 
 set only_screen 0
index a2539ec..807097c 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "=================================="
 puts "BUC60569" 
 puts "OCC597"
index 2ea54ed..0eae2e6 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "=================================="
 puts "BUC60569"
 puts "OCC597"
index aaa5f40..fabe847 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "=================================="
 puts "BUC60569"
 puts "OCC597"
index 3299f92..354dc9a 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "=================================="
 puts "BUC60569"
 puts "OCC597"
index b93c015..2f4dfeb 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "=================================="
 puts "BUC60569"
 puts "OCC597"
index 66084cf..fd465f3 100755 (executable)
@@ -1,9 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
 puts "=================================="
 puts "BUC60569"
 puts "OCC597"
index 76339a0..0a3e785 100755 (executable)
@@ -1,10 +1,3 @@
-if { [array get env os_type] != "" } {
-    set os $env(os_type)
-}
-if { [string compare $os "windows"] != 0 } {
-}
-
-
 puts "=================================="
 puts "BUC60569"
 puts "OCC597"
index d2deb9e..c67e547 100755 (executable)
@@ -27,15 +27,13 @@ vtexture box [locate_data_file OCC5988_2d_floor.rgb]
 
 set x 200
 set y 200
-decho off
-if [catch { QAGetPixelColor $x $y 0 0 0 } res] {
+if { "[vreadpixel $x $y rgb name]" != "BLACK" } {
     puts "box is not black - OK"
     puts "OK ${BugNumber}"
 } else {
     puts "box is black - Faulty"
     puts "Faulty ${BugNumber}"
 }
-decho on
 
 set only_screen 1
 
index bf3cffd..80f84a0 100755 (executable)
@@ -8,11 +8,14 @@ vinit
 box b 10 10 10
 vdisplay b
 vfit
+vaspects -setwidth 5
 
 set x_coord 83
 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 ymin 1
@@ -27,6 +30,8 @@ set Selection_R 0.8
 set Selection_G 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
index 65cf2b1..a1d94a9 100755 (executable)
@@ -37,17 +37,13 @@ if { ${NbSelected2} != 0 } {
 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]
 
-
+vaspects -setwidth 5
 puts ""
 for {set i 0} {$i < 12} {incr i} {
-   set x_coord [lindex ${x} $i]
-   set y_coord [lindex ${y} $i]
-   checkcolor $x_coord $y_coord 1 1 0
-   if { ${stat} != 1 } {
+   if { [vreadpixel [lindex ${x} $i] [lindex ${y} $i] rgb name] != "YELLOW" } {
        set mistake 1
    }
 }
-
 puts ""
 if { ${mistake} == 1 } {
    puts "${BugNumber}: Faulty"
index a6894fc..6d1a55a 100755 (executable)
@@ -32,29 +32,19 @@ vinit
 box b 10 10 10
 vdisplay b
 vfit
+vaspects -setwidth 5
 
 ### FIRST PART
 
 # 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
-checkcolor ${Vertex_X} ${Vertex_Y} 1 1 0
-
-# 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
+if { [vreadpixel ${Vertex_X} ${Vertex_Y} rgb name] != "YELLOW" } {
+  puts "Error : vertex color is not yellow"
+}
 
 ### SECOND PART
 
@@ -69,7 +59,9 @@ if { ${GetSelectMode} != ${SetSelectMode} } {
 }
 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
 vmoveto 1 1
@@ -161,44 +153,14 @@ if { ${GetSelectMode} != ${SetSelectMode} } then {
 
 # Check Shape color
 vmoveto 1 1
-vmoveto ${Shape_X} ${Shape_Y}
-
-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
 vmoveto 1 1
-vmoveto ${Vertex_X} ${Vertex_Y}
-
-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
+if { [vreadpixel ${Vertex_X} ${Vertex_Y} rgb name] != "YELLOW" } {
+  puts "Error : vertex color is not yellow"
+}
 
 set only_screen 1
index d0f3a47..b58a2f4 100755 (executable)
@@ -10,9 +10,7 @@ GER61351 RED2
 set x_coord 200
 set y_coord 200
 
-checkcolor $x_coord $y_coord 0.93 0 0
-
-if {$stat != 1} {
+if {"[vreadpixel $x_coord $y_coord rgb name]" != "RED2"} {
    puts "Error : Background color is NOT RED2."
 }
 
index e4f4dc8..d547583 100755 (executable)
@@ -14,9 +14,8 @@ GER61351 0 255 0
 set x_coord 200
 set y_coord 200
 
-checkcolor $x_coord $y_coord 0 1 0
-
-if {$stat != 1} {
+#checkcolor $x_coord $y_coord 0 1 0
+if {"[vreadpixel $x_coord $y_coord rgb name]" != "GREEN"} {
    puts "Error : Background color is NOT 0 1 0."
 }
 
index efc373b..cf1824c 100755 (executable)
@@ -1,9 +1,6 @@
 puts "TODO ?OCC11111 ALL: Error on Record"
 puts "TODO ?OCC11111 ALL: Error : Colors are not equal"
 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
 
index 5d4a707..13578a1 100755 (executable)
@@ -22,9 +22,9 @@ vfit
 set x_coord 189
 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"
 }
 
index a21bfb8..a35c6ee 100644 (file)
@@ -6,15 +6,11 @@ puts ""
 # Visualization - XCAFPrs_AISObject ignores visibility flag for sub-shapes
 ######################################################
 
-pload QAcommands
-
 ReadStep D [locate_data_file bug25381_test_assembly_invisible.step]
 XShow D
 vfit
 
-decho off
-if { [catch { QAGetPixelColor 198 172 1 1 1 }] != 0 } {
-   decho on
+if { "[vreadpixel 198 172 rgb name]" != "WHITE" } {
    puts "OK : XCAFPrs_AISObject get visibility flag for sub-shapes"
 } else {
    puts "Error : XCAFPrs_AISObject ignores visibility flag for sub-shapes"
index d5ef63a..d664818 100755 (executable)
@@ -1,135 +1 @@
 # 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
-    }
-}