1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030756: Visualization, TKOpenGl - capping plane does not work for ZLayer with non-zero origin

OpenGl_CappingPlaneResource::updateTransform() now takes into account ZLayer origin.

Fixed VT_ProcessKeyPress() passing arbitrary input to Draw::Atoi() leading
to messages in console like "unclosed braces".
This commit is contained in:
kgv
2019-05-29 15:22:10 +03:00
committed by bugmaster
parent 9aceb23df6
commit edc4ba21c4
5 changed files with 74 additions and 57 deletions

View File

@@ -60,6 +60,18 @@ public:
myHasLocalOrigin = !theOrigin.IsEqual (gp_XYZ(0.0, 0.0, 0.0), gp::Resolution());
}
//! Return clipping plane W equation value moved considering local camera transformation.
Standard_Real LocalClippingPlaneW (const Graphic3d_ClipPlane& thePlane) const
{
const Graphic3d_Vec4d& anEq = thePlane.GetEquation();
if (myHasLocalOrigin)
{
const gp_XYZ aPos = thePlane.ToPlane().Position().Location().XYZ() - myLocalOrigin;
return -(anEq.x() * aPos.X() + anEq.y() * aPos.Y() + anEq.z() * aPos.Z());
}
return anEq.w();
}
//! Creates new shader program or re-use shared instance.
//! @param theProxy [IN] program definition
//! @param theShareKey [OUT] sharing key
@@ -733,9 +745,7 @@ protected:
aPlaneEq.w() = float(theEq.w());
if (myHasLocalOrigin)
{
const gp_XYZ aPos = thePlane.ToPlane().Position().Location().XYZ() - myLocalOrigin;
const Standard_Real aD = -(theEq.x() * aPos.X() + theEq.y() * aPos.Y() + theEq.z() * aPos.Z());
aPlaneEq.w() = float(aD);
aPlaneEq.w() = float(LocalClippingPlaneW (thePlane));
}
++thePlaneId;
}