I hope you find these e-mails productive and not frustrating. I just
don’t want to force anything without thinking it through.
…
I want perfection in all directions.
I think these e-mails are great, and I’m glad to hear you say
“perfection in all directions.”
Right now, I think we’re generally agreed on the render engines
themselves – make them simple to program. I think it takes me
something like 10-15 minutes to add a new engine, mostly looking up
the OpenGL calls I need. They might get some refinement, but I feel
safe adding a few.
I think MainWindow is also clear – handle the application logic. It
might have bugs, but it’s clear what belongs there. I’m glad to get
the molecule out.
On the other hand, the “middle layers” probably need more thought, so
all this discussion is really helping. As it stands, it sorta works.
As you say, it’s just a question of getting this “base” close to
perfect. Better to spend a few weeks discussing the design now than
have to rip out chunks of code later.
primitives have a function called .pushGLName() and .popGLName() which
push the “duo” of the type and name. Done.
OK, fair enough. Part of me can see the efficiency in:
glPushName(atomTypeName)
foreach(atoms) {
glPushName(atom->GetIdx();
render(atom);
glPopName();
}
glPopName();
See, there’s fewer push/pop calls. (Similarly, calls to glEnable/
glDisable can be moved outside the loop.)
i think requiring the engines to push their own name data is
unresponsible of avo because that’s important information that avo
needs
internally to function correctly.
Good point. But the View classes don’t actually know what the render
engine is going to throw up on the screen. For example, I can think
of obvious cases where it’d be good to implement a render(Molecule
*m) engine to deal with residues.
Of course thrown into this whole discussion is using multiple render
engines on one molecule (e.g., wireframe for atoms, residue ribbon
view).
I’m still not sure of this but we’ll figure something out. I can’t
image there are all that many times when you’d really want to
render a
few things different. Maybe so, but i don’t know.
Sure. Here are a few typical examples:
- selecting metal atoms in a protein to show them as full van der
Waals spheres.
- selecting all water molecules and showing them as a wireframe.
- a colleague who wants to highlight “electroactive” groups with a
different style.
One of the main reasons I’m at all bothering with writing Avogadro is
that I just hate molecular viewers that don’t let me select atoms
or bonds and change the render style.
Two commercial products Spartan and DS Viewer can showcase some of
this. Both have free (money) demos:
http://wavefun.com/
http://www.accelrys.com/products/downloads/ds_visualizer/
e.g.
http://wavefun.com/images/odysseynosphere.jpg
Oh, there’s also a gallery from a guy who I might try to talk into
Avogadro.
http://www.pirx.com/bio_gallery/
I fixed the code a bit so that selection now works and only picks the
closest Z. _hits is actually sorted by closest to farthest. now the
mouseRelease code actually does the selection and only for atoms.
so if
you click through a bond and hit an atom it works.
Great! What needs to happen for the “rectangle selection” to work?
Cheers,
-Geoff