David Lonie kirjoitti 16.4.2012 kello 18.39:
The original code was more efficient. Pretty much all of the Eigen
code (MatrixBase::col(), operator*/+, etc) end up getting inlined by
the compiler, so there is no extra overhead from traversing the stack.
I haven't checked the assembly, but I believe it ends up being
equivalent to just working with straight arrays. By default, Eigen
also stores matrices as column-major, so operations on
MatrixBase.col() should be able to be vectorized, as well.
Ok. But please change the variable names, the original ones were
confusing. And there's no need to calculate endPos-startPos again each
time.
Drawing the bonds in several pieces may lead to funny effects in
some cases,
there's an example in the attachments. I don't know how big a
problem that is
but some such cases might end up being reported as bugs...
Those are nasty looking indeed! We should try to think of a way to
clean those up before anything gets submitted. The main problem here
is that the clippedCylinder only clips along one plane, so if a bond
segment is near two planes part of the cylinder will jut out. A
potential solution would be to have the clippedCylinder take a set of
planes as arguments, but this would be a pain to code.
With up to 3 clipping planes there are so many possibilities and
corner cases that it is virtually impossible to avoid all artifacts.
We just have to settle how many cases we want to cover (we don't want
to end up in a situation where 90% of drawing code in Avogadro is
related to this). I was actually a bit unsure whether drawing those
"isolated" bond segments is a good idea because they often end up
being clipped in complicated ways.
Maybe Avogadro 2.0 painters could have a set of clipping planes so
that we could more easily draw these structures? Then we could just
use native GL clipping and emulate it somehow for the other
paintdevices...
I would vote for this option...
- 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