]> OCCT Git - occt-copy.git/commitdiff
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 5fe1c0acc0ac6bb28e05958f78775ee50d082804..1b55491567a9f873391b1a4e3a9c4d91eedb09af 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 9e6c04ad92a1ac2cf5769c4747273bba393703fc..5020a2be9539e4a2426553b80b13457f2fd4ad93 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 ae31bbe309c914fd3389a184781e0119c9d230f4..4d7a00ad3e87d0b3d84efae0312eb65286e1e448 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 a1e5deb3dec366014f0e9fa6154ea33fe86d8397..b22a42d4ea9d37155e058497517bc1fbf06c1819 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 f8872879f2b6a431087803b73dd72db7567c472e..47fffd377c56867ef9fb7c6d682c1559017db0a8 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 03aa90c26a8440645d5057604c0ee3e299f70d6c..6af4f51902d93ae7bc007d540eee7aeb0db932ae 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 e350bf3014c5d633733abe4c06a094368a0e7290..ec41bf47e2962c8084d9217abb4b9e8520f9a79f 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 b439537457f277975ed8a7847d5aa6ac8c2612b0..3155b26bd3ffa8436079dae1e01bba0f17c3cb69 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 94a216dc81b46ba70ed538063514a532a619f796..0414c278700274a02e01bca5381dbc391a7e7375 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 c13f0d135cc41f879d81f7c36a7e08fd52aafbe3..4c6b2e90d685a1331bd69d740c4ed6e0510646ba 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 bf841193c7a0929c5fc5732e64b221263c328be3..98207fe7c52a66948b77c30e8788ad0c5bc02a99 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 dda4aca3898d059515e36c5537ea663108f68fca..90a211bd558740f02e92a03a6b0da3bda38bb5e2 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 2c6a7469426368a5b8d9098a5a3b98c752b6a02a..341a53f1f6d372dd570d0525628f17a3aa4a203b 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 bca8b0e07c58866b683d220aeac48c023898ae63..5cd637be61b473440faeade68d60ea0ae54335a8 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 643113f55fb3b5033a092bec8a2515dc79678dba..ad1feba3e3e87c8bf467b9a3358c03f438c83c14 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 3d3e9fc6365979996396b65c42f90fcecfcaf363..ec0a1f5aa702e3cb8377db8fd5f81afe5e635fcd 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 47a91e60f57983b215c9d336608fb0a63f61d4cd..a7a17cd9d2869b620e89a1bbd0cf58893cd8646f 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 0dfdeb54780fe8962d367e5d0ab4d0c24235e4ab..84fbd1176c2595ea2e1125c8bd1105681c30f655 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 a237fb77d84984026df23e489f1e3c1f0c7b7b43..6fd8788e2942ea1097dce2b6c5984a3f402dc970 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 e20a3e5569eb58919be91bdd02dc3cd9b8319b37..a4cea94dda1314282ef54ed49954547dd5324a99 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 8bb8dee2705a2559afe4e7c3583a4c3873f2f844..d93edfdef81a941418bb74798359c39f4b08db0c 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 de73740f5452deafe4d4203478d65e00506152a7..5f81f9f76a55ed0e702a8ad2c1f10e33b7a08f21 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 8c32306427c9a785aadb7a7826c57b7ce3a30026..236b154fb8908fd5721a25da4cb192bed244c8c7 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 b8beee8810bf7377fca7d6d2c90784189341ed88..f0ff8eebc3344563ce2050e8afa099518a95eb19 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 56a7becb710cd98ca2ae7c487b68fdc1d49adbae..1b9a43580898fa1e7be0000742c25fe7a5915664 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 60a928ac083d5910d803df2c45f32ba8ebde81fc..de5814d9f271f86aee3417e4bf48394135e32cb8 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 507df8c8328a7127e016166e8afe772ccb716e7d..3ddc6733b849fbc48797d6ad00a52e754e89fa73 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 4c5f174e5e1a37aa53d00e4d8ecddc3ac57ca7e4..225d7c3612ae2db32780008f2a7cf3ab1b4b4412 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 5186c2bf091006086b9a5cdec201a4e920b5d16c..350cf50eb5df3bffd94ce808a461160d2a476221 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 7bc3720e936d4535d0718d7586d14c79ca860748..753bd8d7ab8e61d9baa85a55e200629b2919b2a9 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 1fd7d04c77db47a7a6e86a9d5f36ddffadbdd9f3..e1eb6cd3fec897d561e384299dbeb199adf39a57 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 b7caab020a99c91851cef46ce5c42f4edfd34995..7d7f315e9c84265ffb2a031e9687cac0232866d5 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 04f33a303681352be1ca7f007e0a7545e91b3303..aade48c6a1ae4fa347ca06edbb26534e19d43e88 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 06ead2728e789b2a6fdc0e9a00e7cbf3525aee6c..5acd33fef552d124cd5807419a5111d7e41fc86c 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 468585c925b745ab26b7e5cbaf9de2a015f50c14..3d87f0fb2a159a861cd3890b9d0979ade218d6c1 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 215e0b2f73ac8b4de0d39e4633ca4d1cdf6b4ccd..01de2e1ae383604576bb9d4b878b94bf7a4af1c9 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 e6841ddc94dec8df47e1336a2d7f1147f430c672..ead507db0dc83d893720c21339e99240c95bf3a5 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 28a4a015b7f6d489f53e1453897e48aa3eab1b8a..a6f535c15886ebe89a7e6964f4dd2653b50ac4ee 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 ce1a8b1375fc7344ea39849ed0dd14ecbb9239c2..44004600b7d73a09197aff3ed3cfe0970a2af04d 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 a2539ec6daa3a45600f455c5229ed95b8b08a694..807097ca67ee0959892ed9977b463179ed471964 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 2ea54ede9f0fe32aec773ba6bd98a7cb0984c871..0eae2e6238365a82b990f5e5f512eebcbc2e5728 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 aaa5f40cb4a29fcf98153ef30e385cd01a3905bb..fabe847937fd7e6fb3bd940d81933325f8d25680 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 3299f92111bafb62286c6d1baaae7f3afd8f47c5..354dc9ad16122a3d310f3fea0ee17b6b6830bc61 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 b93c0150ee469101c525c30ebeb8b24bcaadf464..2f4dfeb46f022d3505e960ffecd737fe8f32af4f 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 66084cffeca519bf092f5d50463abaaff3f53ed2..fd465f3f91e101c0061aafdc423abf2b574d6741 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 76339a0c256ebe71179b01b2f157984687493e15..0a3e78599023e216eab298612d544b837bae804a 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 d2deb9eae6411d2d101f63248328ac96be0b1931..c67e547cba1aca24f5be809ed16099d136497d0e 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 bf3cffd71b5a08737dcbca604411bda12337f67b..80f84a0031cfd5af2166b2fc98d31caa3cff3462 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 65cf2b11a2683ae1b7006c8b1c2a9dc0b5f7cd43..a1d94a9a2828e6f1d1183501ee059a5d86a803d7 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 a6894fc0b6e4563387d99ab314b5ecc6e40042b7..6d1a55a2cbb38997e2194ce92d3b8c1af1646b9c 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 d0f3a4765ab8bc1a16b42c937e7441bdd6d6e25e..b58a2f4d482b50e30f97e991cfd48095d0856a57 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 e4f4dc8b7e6fe8d07c310b5aed61286bf796b403..d547583b9788a5a7e4919857e975cd71d50b78d5 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 efc373b79a70c8db23efb6fbb29f27f4c3f1782f..cf1824c5e50bc969d06c55f38546af74cd5f25e5 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 5d4a707438f4aaba8fb5717e11cd230eb9a35892..13578a17c67c5491708e28d26e434e2a1eb00171 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 a21bfb84e15940776fe1dd898181fc8e88fe6356..a35c6ee6700264cca011834f70b6b8648236fed7 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 d5ef63addc489c63911efedc79b319384a6c3612..d664818133c0ce2194b89723999b6c9dcb4f5e98 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
-    }
-}