GLWidget::computeClickedAtom() is broken

Cheers,

all is in the title. The navigatetool is currently broken because
computeClickedAtom() is. That is, try navigating a bit around a molecule,
after a while computeClickedAtom() says that an atom is clicked even when
none is, and conversely.

It’s tempting to suppose that must be related to the recent changes with the
rendering, with the quick rendering during camera movements. I hope someone
can fix that; after that, I’ll be able to commit my local changes: I already
have local changes simplifying navigatetool and closing my bug report
https://sourceforge.net/tracker/?func=detail&atid=835077&aid=1849990&group_id=165310

Cheers,

Benoit

Benoît Jacob wrote:

Cheers,

all is in the title. The navigatetool is currently broken because
computeClickedAtom() is. That is, try navigating a bit around a molecule,
after a while computeClickedAtom() says that an atom is clicked even when
none is, and conversely.

I don’t seem to be able to reproduce it - may be it is dependent upon
the engines in use or something??? I have tried for quite a well.

It’s tempting to suppose that must be related to the recent changes with the
rendering, with the quick rendering during camera movements. I hope someone
can fix that; after that, I’ll be able to commit my local changes: I already
have local changes simplifying navigatetool and closing my bug report
https://sourceforge.net/tracker/?func=detail&atid=835077&aid=1849990&group_id=165310

As far as I can see right now with the debug code, once you release the
mouse button the scene is rendered normally just as it always was. So
whenever you click on an atom it is a normally rendered scene just as we
had before. It is only during the movement that things should be
different, i.e. using the display lists.

There is of course a chance we have missed something and it is being
caused by the changes. I just can’t seem to spot anything and am open to
suggestions.

Thanks,

Marcus

OK, this is now fixed in r988.

Indeed, it was not too easy to reproduce. You had to open a large enough
molecule, and zoom very closely to get a point of view from which some atoms
would get frustum-culled.

Here’s the explanation of this bug:
We currently do frustum culling in GLPainter::drawSphere() etc. functions. The
frustum culling was implemented as just returning prematuredly from that
function, without drawing anything and without doing pushName() and
popName(). The problem was that popName() also does a separate, very
important thing: it resets d->id and d->type ! So these values were not reset
when frustum culling occured, which caused the bug.

So I added a GLPainter::resetName() function. Hope you like that approach,
hope I got your design right, otherwise feel free to modify.

Cheers,

Benoit

On Friday 14 December 2007 00:21:30 you wrote:

Benoît Jacob wrote:

Cheers,

all is in the title. The navigatetool is currently broken because
computeClickedAtom() is. That is, try navigating a bit around a molecule,
after a while computeClickedAtom() says that an atom is clicked even when
none is, and conversely.

I don’t seem to be able to reproduce it - may be it is dependent upon
the engines in use or something??? I have tried for quite a well.

It’s tempting to suppose that must be related to the recent changes with
the rendering, with the quick rendering during camera movements. I hope
someone can fix that; after that, I’ll be able to commit my local
changes: I already have local changes simplifying navigatetool and
closing my bug report
https://sourceforge.net/tracker/?func=detail&atid=835077&aid=1849990&grou
p_id=165310

As far as I can see right now with the debug code, once you release the
mouse button the scene is rendered normally just as it always was. So
whenever you click on an atom it is a normally rendered scene just as we
had before. It is only during the movement that things should be
different, i.e. using the display lists.

There is of course a chance we have missed something and it is being
caused by the changes. I just can’t seem to spot anything and am open to
suggestions.

Thanks,

Marcus