Third-party extension tutorial

Hi all,

I’ll be starting a tutorial for third party extension development this
week, and want to see if there are any topics I’m leaving out that may
be useful. So far

  1. Hello world
    Simple dialog with a close button
  • Introduce basic structure of an extension
  1. Dynamic display
    Show information about current molecule
  • Show molecular weight, formula or something similar
  • Fill out setMolecule virtual
  1. Camera
    Align view to arbitrary plane determined by selecting three atoms
  • Show how selections work
  • Show how to manipulate camera
  1. Molecule manipulation
    This will probably be something like the existing H -> Methyl

  2. Interactive plotting
    Generate and view conformers by energy

  • Show how Avogadro can be used with OpenBabel, in this case to
    generate conformers
  • Show how to use the plot widget to display a scatter plot
  • Show how to change current conformer and update the molecule

Any suggestions or additions are welcome!

A second issue is where to put the tutorial/sources. There are a
number of options:

Source:

  • Separate github repo
  • Include in Avogadro repo

Tutorial:

  • Write in Doxygen, include with Avogadro sources
  • Write on wiki
  • Plain ol’ HTML on the avogadro site

I’m in favor of including the examples with the Avo sources and
putting the tutorial in Doxygen. This will make it a bit harder for
users to modify, but I really don’t expect end users to be interested
in modifying the tutorial – anyone using it should be able to submit
a patch to gerrit. Doxygen also gives us the ability to generate both
latex pdfs and html, which may come in handy, and we can always link
to it from the wiki. As I see more and more wikis fall into a state of
neglect, I become less fond of the concept.

Including the sources in the avogadro tree will also enable us to
build them as tests and perform checks to ensure that they don’t get
broken/out of date.

Dave

A second issue is where to put the tutorial/sources. There are a
number of options:

Source:

  • Separate github repo
  • Include in Avogadro repo

I vote for sources in libavogadro/examples. It’s better to separate
large complex plugins from libavogadro tree than examples

Tutorial:

  • Write in Doxygen, include with Avogadro sources
  • Write on wiki
  • Plain ol’ HTML on the avogadro site

I vote for Doxygen & wiki. HTML is no-go because it’s hard to maintain

Doxygen: short tutorials, source fragments, and maybe some screenshots
about usage of concrete core classes

Wiki: how to develop different types of extensions step by step.
I’ve written some things here:
http://avogadro.openmolecules.net/wiki/Creating_a_Third_Party_Plugin


Regards,
Konstantin

On Nov 8, 2010, at 9:45 AM, David Lonie wrote:

  1. Molecule manipulation
    This will probably be something like the existing H → Methyl

So some of your other examples are actually useful functionality that we don’t currently have… How about rotating the molecule or selection around a particular axis by a set rotation? Maybe also translate the selection by a specified amount? This is really useful for making dimeric structures or clusters.

I think I’d also suggest that the examples eventually go in the examples directory in our source itself.

Thanks, I think this will be great,
-Geoff

09.11.2010, 04:25, “Geoffrey Hutchison” geoff.hutchison@gmail.com:

How about rotating the molecule or selection around a particular axis by a set rotation?

It would look impressively if axesengine was used to select and visualize rotation


Regards,
Konstantin

On Mon, Nov 8, 2010 at 8:25 PM, Geoffrey Hutchison
geoff.hutchison@gmail.com wrote:

On Nov 8, 2010, at 9:45 AM, David Lonie wrote:

  1. Molecule manipulation
    This will probably be something like the existing H → Methyl

So some of your other examples are actually useful functionality that we don’t currently have… How about rotating the molecule or selection around a particular axis by a set rotation? Maybe also translate the selection by a specified amount? This is really useful for making dimeric structures or clusters.

That is a very good idea – I’m often asked how to change a bond
length to an exact value in Avogadro, and this would be a good way to
do it. I’ll probably do something very simple for the tutorial, but
I’ll look into adding a tool/extension to do this. Bond-centric
manipulation is great, but inexact.

I think I’d also suggest that the examples eventually go in the examples directory in our source itself.

I pushed the first two example extensions to gerrit yesterday before
it went down, so we’ll go with “in the source” since there seem to be
no objections.

Dave

On Tue, Nov 9, 2010 at 2:38 AM, Konstantin Tokarev annulen@yandex.ru wrote:

09.11.2010, 04:25, “Geoffrey Hutchison” geoff.hutchison@gmail.com:

How about rotating the molecule or selection around a particular axis by a set rotation?

It would look impressively if axesengine was used to select and visualize rotation

Good idea – One of the tutorials should interact with an engine.

Dave

ticular axis by a set rotation? Maybe also translate the selection by a specified amount? This is really useful for making dimeric structures or clusters.

That is a very good idea – I’m often asked how to change a bond
length to an exact value in Avogadro

Through bond properties table, of course :slight_smile:


Regards,
Konstantin

On Tue, Nov 9, 2010 at 9:19 AM, Konstantin Tokarev annulen@yandex.ru wrote:

Through bond properties table, of course :slight_smile:

Ah, I hadn’t realized that editing that would update the table. I did
find a reproducible bug while playing around with that, it seems to
crash whenever an atom is deleted while the properties dialog is open.
I’ll file a report on that.

Dave