Camera zooming to the center of a model

Now camera zoom performs like that: I track mouse pointer coordinates and camera zooms towards these coordinates

const Graphic3d_Vec2d aNewPos2d = myView->Window()->ConvertPointToBacking(Graphic3d_Vec2d(theEvent->x, theEvent->y));
const Aspect_ScrollDelta aScroll(Graphic3d_Vec2i(aNewPos2d + Graphic3d_Vec2d(0.5)), 1);
if (UpdateMouseScroll(aScroll))
{
myGLArea->queue_draw();
}

As a result the model, which is displayed in a viewer slides away, it is not comfortable at all. I want always zoom the model ( zoom the camera to a point that is the center of the model ), so I need to somehow 1) translate global viewer coordinates to 2d window coordinates 2) get the center of the displayed model ( the model is displayed with the help of AIS_ConnectedInteractive, so I have access to each model part, but not to the entire model )

gkv311 n's picture

Current behavior of the AIS_ViewController is to zoom at 3d point on the object under mouse cursor position. I'm have some doubts that zooming at objects origin (that could be outside of viewport) would be more convenient...