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

0027793: Visualization - object drifts at zoom within Graphic3d_TMF_TriedronPers applied

Graphic3d_TransformPers now takes Graphic3d_Camera definition as argument
for methods applying transformation.

Graphic3d_TransformPers::Apply() now computes Graphic3d_TMF_TriedronPers
transformation in the following way:
- The object is moved onto Z focus distance.
- The object is expected to be defined in pixels.
- The Z coordinate on anchor point is used as offset from the view corner in pixels.
- It is now possible to define not only corners of the view, but also middle of the side.
- Graphic3d_TMF_TriedronPers now works with perspective projection.

OpenGl_LayerList::ChangeLayer() - fixed removing of the element in old ZLayer.

OpenGl_Layer::BoundingBox() now takes into account bounding box
of Graphic3d_TMF_TriedronPers presentations for Z-fit operation.
This commit is contained in:
kgv
2016-08-23 17:11:49 +03:00
committed by abv
parent 742cc8b01d
commit 3fe9ce0edd
28 changed files with 401 additions and 237 deletions

View File

@@ -333,7 +333,7 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
mySelectingVolumeMgr.WindowSize (aViewportWidth, aViewportHeight);
gp_GTrsf aTPers;
Graphic3d_Mat4d aMat = theObject->TransformPersistence().Compute (aProjection, aWorldView, aViewportWidth, aViewportHeight);
Graphic3d_Mat4d aMat = theObject->TransformPersistence().Compute (mySelectingVolumeMgr.Camera(), aProjection, aWorldView, aViewportWidth, aViewportHeight);
aTPers.SetValue (1, 1, aMat.GetValue (0, 0));
aTPers.SetValue (1, 2, aMat.GetValue (0, 1));
aTPers.SetValue (1, 3, aMat.GetValue (0, 2));
@@ -449,7 +449,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
Standard_Integer aViewportWidth;
Standard_Integer aViewportHeight;
mySelectingVolumeMgr.WindowSize (aViewportWidth, aViewportHeight);
aBVHTree = mySelectableObjectsTrsfPers.BVH (aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
aBVHTree = mySelectableObjectsTrsfPers.BVH (mySelectingVolumeMgr.Camera(), aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
}
else
{
@@ -888,7 +888,7 @@ void SelectMgr_ViewerSelector::RebuildObjectsTree (const Standard_Boolean theIsF
mySelectingVolumeMgr.WindowSize (aViewportWidth, aViewportHeight);
mySelectableObjects.BVH();
mySelectableObjectsTrsfPers.BVH (aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
mySelectableObjectsTrsfPers.BVH (mySelectingVolumeMgr.Camera(), aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
}
}