Hi Tuukka, On Mon, Apr 16, 2012 at 2:56 PM, Tuukka Verho <[email protected]> wrote: > David Lonie kirjoitti 16.4.2012 kello 20.37: >> I was trying to think of a way to implement this in a maintainable way >> across all of the engines, maybe with a MoleculeRepresentation (or >> similar) layer between Molecule and Engine, but a new engine may be >> the best way to go for now. > > Maybe the clipping code could be simply taken out from the engines? We could > have a more sophisticated drawCylinder() method that would do the clipping > etc. and also draw two-colored cylinders? On the other hand then it would > need to be replicated in each painter backend separately -- unless the > backend independent stuff would be in the Painter superclass for example.
This is similar to the idea of putting clipping plane support directly into the painters, which I think we've agreed would be a good move. This would allow us to clip spheres, lines, etc, too for atoms and wireframe in addition to just the cylinders. >> Or add options to the engine settings so >> that users could select how to handle periodic bonds: >> >> * Expanded: Complete all molecules that exceed the unit cell: >> (see the graphical abstract on >> http://pubs.acs.org/doi/abs/10.1021/ja201786y ) > > This is certainly an interesting option (though you need to be careful with > infinite molecules such as covalent crystals). This requires a completely > different approach -- maybe Molecule could have a method to generate all the > atoms and bonds needed to create one complete instance of itself (in the > sense that all parts in the primary cell are expanded). I've got some code in XtalOpt that does something similar when the time comes. Nothing fancy, it just walks through the bonds, shortening them as it goes. I've haven't tried it on infinite systems, but it shouldn't be too hard to adapt. >> * Clipped: Think of a 3x3x3 supercell clipped so that only fragments >> inside the central cell are shown: >> http://wn.com/ZINK_Crystal_Video It's a video, but the preview frame >> shows what I mean. This is what I'm trying to get implemented at the >> moment. >> * Simple periodic: Like Tuukka's original patch, which just renders >> the bond halves, not clipping them at the boundaries. >> >> I prefer adding options to the existing engines. It's just a shame to >> have to recalculate all of the translated geometry on every render for >> each engine, and it will suck to implement and maintain this across >> all engines :-/ > > Wait a minute... I'm actually new to opengl, but do you really repaint the > scene on each render? I mean can't you store the opengl commands and execute > them just with a different transformation matrix when the view is e.g. > rotated? Yes, the renderOpaque and renderTransparent methods are run *each* render (which is why I was so concerned about efficiency earlier ;-) ). AIUI, this is something that will be improved for Avogadro 2.0. Dave ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ Avogadro-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/avogadro-devel
