New primitive branch - moving to a simpler API


I have been working these last few weeks on an experiment to see if
Avogadro can use a simpler Primitive class (and derived classes) that do
not inherit the OpenBabel classes. The motivation is to,

  • Stabilize our API before OpenBabel does (with 3.0 etc)
  • Allow us to implement optimized functions for Avogadro
  • Ensure full thread safety in our core data model
  • Simplify the API - only one function name for adding and removing
    atoms etc
  • Consistent API throughout the Avogadro library, e.g. function naming
  • Hopefully improve overall stability of Avogadro

As you can see in the branch Avogadro is basically working again, but
quite a few tools and engines need porting along with all of the
extensions. Some of the functions needed have not been added to the
relevant classes yet. Molecule will allow you to get a copy of the
molecule in the form of an OBMol, work on that and then set that OBMol
as the current molecule if required.

My plan is to implement all functionality we need/use and then add more
as required. The simple stuff I have implemented, and the more complex
stuff I have handed off to OpenBabel (such as addHydrogens). I would
like to get orbitals/volumetric data working again next along with
moving Iso to the painters so that we can have POV-Ray rendered orbitals.

I think these changes are important for Python scripting (thread safety
in scripting even with multithreaded UI), application stability, having
a clean and consistent API and in order to move forward independent of
the OpenBabel 3.0 development. We can port our functions to use
OpenBabel 3.0 when it happens and keep our API stable through the move.

I would love to hear what you think about the changes. I think we should
try our best to keep the function names self descriptive and consistent

  • Donald really convinced me of this when we met in March. The new
    Molecule class uses zero based indexes and zero based IDs which simplify
    many things too.

I was thinking of adding a Volumetric class for cubes etc, fragments for
molecule fragments and rings. I have tried to ensure I committed
something early so that everyone gets a chance to comment. I am doing
this in a branch to avoid disrupting development as many features
currently need porting over.

Things have been a little hectic so this has taken longer than I would
have liked.