]> OCCT Git - occt.git/commitdiff
update occlusion query test CR33607
authorhossamali <Hossam.Ali@opencascade.com>
Fri, 19 Jul 2024 12:35:33 +0000 (15:35 +0300)
committerhossamali <Hossam.Ali@opencascade.com>
Fri, 19 Jul 2024 12:35:33 +0000 (15:35 +0300)
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/v3d/occlusion/boxes

index 85d39b420422987df0c8ccdd37311d9885e2f2e6..854bccafb4ac5e48df21b40c3487019e663cefaa 100644 (file)
@@ -13996,7 +13996,7 @@ static int VChangeMouseGesture (Draw_Interpretor&,
 //function : VOccluded
 //purpose  : Returns number of Occluded objects
 //==============================================================================
-static Standard_Integer VNbOccluded(Draw_Interpretor & /*theDi*/,
+static Standard_Integer VNbOccluded(Draw_Interpretor & theDi,
                                   Standard_Integer theArgNb,
                                   const char **theArgVec) {
   NCollection_List<TCollection_AsciiString> aViewList;
@@ -14045,12 +14045,12 @@ static Standard_Integer VNbOccluded(Draw_Interpretor & /*theDi*/,
     Handle(V3d_View) aView = ViewerTest_myViews.Find1(anIter.Value());
     aView->ChangeRenderingParams().OcculsionQueryState = Graphic3d_RenderingParams::OcculsionQuery_NoUpdate;
     aView->Redraw();
+    aView->Redraw();
     aView->View()->UpdateOcclusion();
     Graphic3d_MapOfStructure aOcculdedStructs;
     aView->View()->OccludedStructures(aOcculdedStructs);
 
-    printf("Occluded objects in view: %d = %d\n",
-           aView->View()->Identification(), aOcculdedStructs.Extent());
+    theDi << aOcculdedStructs.Extent() << "\n";
   }
 
   return 0;
index 36e02c1780ab779e67558b3bdaa0eb7288f17c4e..ee14eaebdd5cb7194fdc390aff3a23ce17997174 100644 (file)
@@ -24,6 +24,11 @@ vdisplay c b
 vfront
 vfit
 
-#run occlusion query for each view 
-vnboccluded View1
-vnboccluded View2
+#run occlusion query test for each view 
+if {[vnboccluded View1] != "1"} {
+    puts "ERROR: occluded objects in view 1 expected to be 1"
+  }
+
+if {[vnboccluded View2] != "0"} {
+    puts "ERROR: occluded objects in view 2 expected to be 0"
+  }