0030698: Volume Rendering - Early clipping of volume object's bounding box
[occt.git] / src / OpenGl / OpenGl_Structure.cxx
index e3188fe..927a4a0 100644 (file)
@@ -527,16 +527,16 @@ void OpenGl_Structure::Render (const Handle(OpenGl_Workspace) &theWorkspace) con
         }
 
         const Graphic3d_ClipState aBoxState = aPlane->ProbeBox (aBBox);
-        if (aBoxState == Graphic3d_ClipState_Out)
-        {
-          isClipped = true;
-          break;
-        }
-        else if (aBoxState == Graphic3d_ClipState_In)
+        if (aBoxState == Graphic3d_ClipState_In)
         {
           aCtx->ChangeClipping().SetEnabled (aPlaneIt, false);
           hasDisabled = true;
         }
+        else if (aBoxState == Graphic3d_ClipState_Out && myBndBoxClipCheck)
+        {
+          isClipped = true;
+          break;
+        }
       }
     }