mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027536: Visualization - incorrect behavior of zoom persisted objects
1) Zoom persistence mode now fixes object in pixel coordinates and is independent on view size 2) Used gp_GTrsf instead of gp_Trsf SelectMgr_ViewerSelector to store Graphic3d_Mat4d 3) Zoom persisted objects changed behavior (become bigger) therefore test cases were updated according to new state. 4) Corrected scale for rectangular frustum Updated test for manipulator
This commit is contained in:
@@ -158,10 +158,22 @@ void Graphic3d_TransformPers::Apply (NCollection_Mat4<T>& theProjection,
|
||||
}
|
||||
|
||||
// Prevent zooming.
|
||||
if ((Flags & Graphic3d_TMF_ZoomPers) || (Flags == Graphic3d_TMF_TriedronPers))
|
||||
if (Flags & Graphic3d_TMF_ZoomPers)
|
||||
{
|
||||
const T aDet00 = (2.0f / theViewportWidth) / theProjection.GetValue(0, 0);
|
||||
const T aDet11 = (2.0f / theViewportHeight) / theProjection.GetValue(1, 1);
|
||||
const T aDet2 = Max (aDet00, aDet11);
|
||||
|
||||
theProjection.ChangeValue(0, 0) *= aDet00;
|
||||
theProjection.ChangeValue(1, 1) *= aDet11;
|
||||
theProjection.ChangeValue(2, 2) *= aDet2;
|
||||
}
|
||||
|
||||
if (Flags == Graphic3d_TMF_TriedronPers)
|
||||
{
|
||||
// Compute fixed-zoom multiplier. Actually function works ugly with TelPerspective!
|
||||
const T aDet2 = static_cast<T> (0.002) / Max (theProjection.GetValue (1, 1), theProjection.GetValue (0, 0));
|
||||
|
||||
theProjection.ChangeValue (0, 0) *= aDet2;
|
||||
theProjection.ChangeValue (1, 1) *= aDet2;
|
||||
theProjection.ChangeValue (2, 2) *= aDet2;
|
||||
|
Reference in New Issue
Block a user