Here is what i came up with as a solution to multiple views on the same
molecule.
We start with basic wrapper classes; Molecule / Atom / Bond. The reason
for this will become more apparent after i explain the rest.
Next we have MoleculeView / AtomView / BondView. This is more like the
current primatives we have (have the “render” functions). Each GLWidget
contains a MoleculeView. MoleculeView has a pointer to the Molecule for
the window. Same goes to AtomView and BondView (pointers to Atom and
Bond respectively).
Now, the benefit of the Molecule class is that we overload any functions
that need to impact the views. And then everytime we start a new view,
we register it with the Molecule. That way when we need to do drawing
and such; we only manipulate the Molecule class AND even better, the
syntax for plugins to manipulate the Molecules is exactly like OB.
It’s a problem of accessing the primatives from both the directions; the
GL interface and the MainWindow.
One suggestion i have is that functions we use from OB should be
virtual. That way we can write an operational library (say FF
calculations) that works on OBMol. If the OBMol functions are virtual
and we pass our Molecule to the operational library it’ll call our
virtual functions. This also means that any operational library we
develop will work with and without avogadro. (like our geometric
optimizaion functions).
On another note; at one point we were talking about a render queue.
It’s possible we could still do this but with the use of Display Lists
it doesn’t make much sense. If you’re still thinking about this i’d be
interested in what you’re thinking or at least how you’re thinking about
the implementation.
-Donald