Access MainWindow::centerView() from extension

I need to access MainWindow::centerView() from cartesian editor to get proper orientation of molecule if coordinates were completely replaced in editor (or inserted into empty)
Is it needed to move method into GLWidget to prevent code duplication?

Regards,
Konstantin

Is it needed to move method into GLWidget to prevent code duplication?

It’s not a bad idea. I think we haven’t done that, because the camera was available, and many people may not want their view to change. But I can imagine from pasting coordinates into the cartesian editor…

Cheers,
-Geoff

On Monday 01 March 2010 12:26:03 Geoffrey Hutchison wrote:

Is it needed to move method into GLWidget to prevent code duplication?

It’s not a bad idea. I think we haven’t done that, because the camera was
available, and many people may not want their view to change. But I can
imagine from pasting coordinates into the cartesian editor…

You can also augment the Navigate class, which was intended to centralize
scene camera movements without adding yet more API to an already very large
GLWidget class. The intent of this class was to provide convenience API when
the developer didn’t want to deal directly with the camera matrix.

Marcus

07.03.10, 11:40, “Marcus D. Hanwell” marcus@cryos.org:

On Monday 01 March 2010 12:26:03 Geoffrey Hutchison wrote:

Is it needed to move method into GLWidget to prevent code duplication?

It’s not a bad idea. I think we haven’t done that, because the camera was
available, and many people may not want their view to change. But I can
imagine from pasting coordinates into the cartesian editor…

You can also augment the Navigate class, which was intended to centralize
scene camera movements without adding yet more API to an already very large
GLWidget class. The intent of this class was to provide convenience API when
the developer didn’t want to deal directly with the camera matrix.

Thanks, adding this function to Navigate seems to be more logical. But centerStep also needs moving, and probably it may be moved only to GLWidget. Some object is needed for connection, and Navigate has no instance (or Qt can connect to static methods?)


Regards,
Konstantin

Здесь спама нет http://mail.yandex.ru/nospam/sign