Navigation duplication in different tools

Hi,

I think this is something we have discussed before, but I thought it was worth
bringing up again. We now have three tools that do some kind of navigation
about the scene - the selectrotate tool, the navigate tool and the bond
centric manipulation tool. At several points in the past I have toyed with
the idea of adding it to the manipulation tool too but resisted adding yet
more code duplication.

Is there a better answer to this? There are a few functions I have spotted in
some of the tools that should be moved out of the tools and made available to
all tools in one way or another - such as computing the clicked atom which is
used in quite a few of the tools, but also the rotation and translation
visual cues which I think could be used in at least three tools.

Should we be passing the clicks and mousemoves to the navigation tool from
other tools? Is it OK to depend on this tool and thus reduce duplication and
increase consistency throughout Avogadro? It would be good to hear what you
think before I do anything to change any of this.

I would also like to make the modifier stuff available on all platforms, not
just Macs. I think that others could certainly use it although the Alt key
here is caught by KDE I think to move the whole Window. They should be
configurable anyway, but this may force some preference for default modifiers
on different platforms.

Thanks,

Marcus

I think that you have hit a good point. There are two different things that
we should probably address:

For now, i think it’d be good to take all the navigation stuff out of the
tools and put it in another “shared” source file in the tools directory.
However, it’s possible that at some point we’ll want to put this in a shared
location.

Things like getting the clicked primitive is probably something we could put
into the GLWidget. However, in the future because of the way we’re doing our
paint system, we’ll need to make a “base” class for all our “canvas” things
(like GLWIdget POVWidget) so that we can have different types of widgets
instead of just OpenGL. That’s getting ahead of ourselves though.

I again would like to hear from Benoit cause he had an idea for a GLPicker
class and i think that would take care of some of the clicked primitive
stuff.


Donald

On Saturday 18 August 2007 01:15:43 pm Marcus D. Hanwell wrote:

Hi,

I think this is something we have discussed before, but I thought it was
worth bringing up again. We now have three tools that do some kind of
navigation about the scene - the selectrotate tool, the navigate tool and
the bond centric manipulation tool. At several points in the past I have
toyed with the idea of adding it to the manipulation tool too but resisted
adding yet more code duplication.

Is there a better answer to this? There are a few functions I have spotted
in some of the tools that should be moved out of the tools and made
available to all tools in one way or another - such as computing the
clicked atom which is used in quite a few of the tools, but also the
rotation and translation visual cues which I think could be used in at
least three tools.

Should we be passing the clicks and mousemoves to the navigation tool from
other tools? Is it OK to depend on this tool and thus reduce duplication
and increase consistency throughout Avogadro? It would be good to hear what
you think before I do anything to change any of this.

I would also like to make the modifier stuff available on all platforms,
not just Macs. I think that others could certainly use it although the Alt
key here is caught by KDE I think to move the whole Window. They should be
configurable anyway, but this may force some preference for default
modifiers on different platforms.

Thanks,

Marcus


This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

On Saturday 18 August 2007 20:00:31 Donald Ephraim Curtis wrote:

I think that you have hit a good point. There are two different things
that we should probably address:

For now, i think it’d be good to take all the navigation stuff out of the
tools and put it in another “shared” source file in the tools directory.
However, it’s possible that at some point we’ll want to put this in a
shared location.

I have done that now - the functions have been moved to navigate.* in the
tools directory and are accessible as static functions using
Navigate::zoom(…) etc. This seemed like the best way of moving them out of
the individual tools.

Things like getting the clicked primitive is probably something we could
put into the GLWidget. However, in the future because of the way we’re
doing our paint system, we’ll need to make a “base” class for all our
"canvas" things (like GLWIdget POVWidget) so that we can have different
types of widgets instead of just OpenGL. That’s getting ahead of ourselves
though.

I created PainterDevice for that, and the engines already accept PainterDevice
which they then get the painter, camera etc from. I have added three new
functions to GLWidget for now that can pick the nearest Primitive (just atoms
and bonds right now), Atom or Bond.

I have ported the tools I know are using copies of these functions and removed
the local implementations of the functions. I have tested each tool after the
changes and don’t think I have introduced any new bugs. If I have please let
me know and I will do what I can to fix them.

I again would like to hear from Benoit cause he had an idea for a GLPicker
class and i think that would take care of some of the clicked primitive
stuff.

We could certainly move the functions in the future but I believe that
currently Benoit is away and won’t be answering for a week or more on this.

Hopefully the changes I have made are useful. They have certainly reduced code
duplication.

Thanks,

Marcus