const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
for (OpenGl_Structure::GroupIterator aGroupIter (myGroups); aGroupIter.More(); aGroupIter.Next())
{
- Handle(Graphic3d_TransformPers) aTrsfPersistence = aGroupIter.Value()->TransformPersistence();
+ const Handle(Graphic3d_TransformPers)& aTrsfPersistence = aGroupIter.Value()->TransformPersistence();
+ gp_Pnt aStartPnt;
+
if (!aTrsfPersistence.IsNull())
{
+ if (aTrsfPersistence->IsZoomOrRotate())
+ {
+ aCtx->ModelWorldState.Push();
+ OpenGl_Mat4& aModelWorld = aCtx->ModelWorldState.ChangeCurrent();
+ aStartPnt = aTrsfPersistence->AnchorPoint();
+ Graphic3d_Vec4 anAnchorPoint = aModelWorld * Graphic3d_Vec4 (aStartPnt.X(), aStartPnt.Y(), aStartPnt.Z(), 1.0);
+ aModelWorld.InitIdentity();
+ aTrsfPersistence->SetAnchorPoint (gp_Pnt (anAnchorPoint.x(), anAnchorPoint.y(), anAnchorPoint.z()));
+ }
applyPersistence (aCtx, aTrsfPersistence, Standard_True);
+ aCtx->ApplyModelViewMatrix();
}
theHasClosed = theHasClosed || aGroupIter.Value()->IsClosed();
if (!aTrsfPersistence.IsNull())
{
+ if (aTrsfPersistence->IsZoomOrRotate())
+ {
+ aTrsfPersistence->SetAnchorPoint (aStartPnt);
+ aCtx->ModelWorldState.Pop();
+ }
applyPersistence (aCtx, aTrsfPersistence, Standard_False);
+ aCtx->ApplyModelViewMatrix();
}
}
}
else
{
theContext->WorldViewState.Pop();
+ theContext->ApplyModelViewMatrix();
}
}