Merged the primitive branch


As there has been very little activity in trunk and I was worried my changes
were making people hold off committing I have merged the primitive branch. I
was hoping to have more of the extensions ported before merging but also feel
like it is important to get feedback and testing of the changes I have been

The main changes are to the Primitive and Primitive derived classes. They no
longer inherit from OpenBabel classes, but do interact with them. Not all of
the logic is implemented yet but I think it is working quite well on the
whole. I have also added several new primitives (as has Tim) to deal with
extra things such as cubes and meshes.

I would appreciate help and feedback. Did I introduce bugs in any of the
changes made to the already ported plugins? Can you help me to port a plugin?
Major things that need doing are:

  • Port the bondcentric tool.
  • Port the ribbon engine (requires me to finish the Residue primitive).
  • Port the surface engine (requires adding of vertex colouring into Mesh).
  • Port the polygon engine.
  • Improve the caching/efficiency when doing geometry optimisation.
  • GAMESS extension.
  • Molecular mechanics - should be quite easy as AutoOpt is already done.
  • Selections, unit cells, super cell builder, animation, lin morph animation
    all need porting - haven’t had chance to look at them yet.

Bigger things I still need to do include implementing locking so that our core
model is thread safe. Track down any new bugs I introduced and fix them!
Possibly use smart pointers instead of standard pointers as provided by Qt.
The Python support will need adding back in with possible convenience
functions etc required too.

I think these changes are very worthwhile as they allow Avogadro to stabilise
its API before OpenBabel. If we do not expose any of the OpenBabel API in our
library we can also maintain ABI stability for users of the Avogadro library.
We will still need to recompile Avogadro whenever OpenBabel breaks ABI though.
It will also allow us to port Avogadro to OpenBabel 3 without changing our

Thoughts, feedback and help would be much appreciated.