David Lonie kirjoitti 16.4.2012 kello 20.37:

> On Mon, Apr 16, 2012 at 1:18 PM, Marcus D. Hanwell
> <[email protected]> wrote:
>> It would be nice to contain a lot of these changes in a more
>> specialized plugin, but if they are at least well isolated that  
>> should
>> be OK.
>
> 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.

> 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).

> * 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?

- Tuukka

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Avogadro-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avogadro-devel

Reply via email to