]> OCCT Git - occt-copy.git/commitdiff
0025959: Draw Harness - do not turn on Z-clipping implicitly by mouse ring
authorisz <isz@opencascade.com>
Thu, 16 Apr 2015 09:39:37 +0000 (12:39 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Apr 2015 12:28:42 +0000 (15:28 +0300)
Clipping planes now can not be switched on by mouse ring or both right and left mouse buttons. To do this, user has to press certain button or call certain command.

src/ViewerTest/ViewerTest_ViewerCommands.cxx

index 607da14f1fad878d8b8b97e048238e7a07733322..ed992699717562b5e2c51ce40c75cb5fde7bf10d 100644 (file)
@@ -1656,29 +1656,24 @@ void ProcessZClipMotion()
 {
   Handle(V3d_View)  a3DView = ViewerTest::CurrentView();
   if ( Abs(X_Motion - X_ButtonPress) > 2 ) {
-    static Standard_Real CurZPos = 0.;
 
     //Quantity_Length VDX, VDY;
     //a3DView->Size(VDX,VDY);
     //Standard_Real VDZ = a3DView->ZSize();
     //printf("View size (%lf,%lf,%lf)\n", VDX, VDY, VDZ);
 
-    Quantity_Length dx = a3DView->Convert(X_Motion - X_ButtonPress);
+    Quantity_Length aDx = a3DView->Convert(X_Motion - X_ButtonPress);
 
     // Front = Depth + width/2.
-    Standard_Real D = 0.5;
-    Standard_Real W = 0.1;
+    Standard_Real aDepth = 0.5;
+    Standard_Real aWidth = 0.1;
+    a3DView->ZClipping(aDepth,aWidth);
 
-    CurZPos += (dx);
-
-    D += CurZPos;
+    aDepth += aDx;
 
     //printf("dx %lf Depth %lf Width %lf\n", dx, D, W);
 
-    a3DView->SetZClippingType(V3d_OFF);
-    a3DView->SetZClippingDepth(D);
-    a3DView->SetZClippingWidth(W);
-    a3DView->SetZClippingType(V3d_FRONT);
+    a3DView->SetZClippingDepth(aDepth);
 
     a3DView->Redraw();