qobject_cast and dynamic_cast on Mac OS X

I’m thrilled.

I think I mentioned that I’ve been having problems with the label
render engine (and now the dynamic engine). I still don’t know why,
but it seems like qobject_cast is flaky on Mac OS X. OTOH, regular
dynamic_cast works.

I’ve filed a bug report with Trolltech, and they’ve asked me to
modify one of their example applications to reproduce the problem.
I’m not sure I have the time or interest at the moment.

OTOH, I can provide some OpenGL profiling results. I opened a big PDB
file (1HVC) and checked out dynamic vs. regular.

  • Dynamic: Peak 4.0 fps
  • Regular: Peak 4.0 fps
  • Wireframe: Peak 1.2 fps (!)

Don’t despair, both are doing much better than the wireframe view. :slight_smile:

If it’s OK, I’ll submit a patch changing the qobject_cast calls in
engines to dynamic_cast for now. This way I have the same
functionality as everyone else and can hack on some user interface
pieces.

Cheers,
-Geoff

That’s great. Oh, are you using qt4.3? I wonder if that’s maybe the
real problem and not 4.2. I have yet to try 4.3 :confused:

I’m curious about how much dynamic_cast<> vs static_cast<> vs
qobject_cast<> changes performance. That would be my only concern. I
have also been doing some profiling etc but mainly trying to figure out
where we spend most of our time during rendering.

I would guess the MAJOR difference between the dynamic and wireframe
engines is that you’re not using display lists. I am pretty sure DL’s
actually push a lot of the operations to video memory.

But everything sounds good. We need to get a release soon, i’ve been
working on the measuring tool which i think should be done before we
release. Plus we need to move libavogadro over to kde and also update
the draw tool. There is a small “operational” bug when you move to an
atom, it snaps to it, then if you move directly to another atom it
doesn’t move you. easily fixed.

Yeah go ahead submit that patch. We should make a note somewhere we
eventually need to change that back when we resolve the mac issue.
maybe in the code mark it with //XXX: or //FIXME: or something.

Anyways, i’ve been really busy with getting this paper out recently so
haven’t had a ton of time. Hopefully that changes in the near future.
I’m missing working on avogadro.

(Thu, Apr 19, 2007 at 11:52:25AM -0400) Geoffrey Hutchison geoff.hutchison@gmail.com:

I’m thrilled.

I think I mentioned that I’ve been having problems with the label
render engine (and now the dynamic engine). I still don’t know why,
but it seems like qobject_cast is flaky on Mac OS X. OTOH, regular
dynamic_cast works.

I’ve filed a bug report with Trolltech, and they’ve asked me to
modify one of their example applications to reproduce the problem.
I’m not sure I have the time or interest at the moment.

OTOH, I can provide some OpenGL profiling results. I opened a big PDB
file (1HVC) and checked out dynamic vs. regular.

  • Dynamic: Peak 4.0 fps
  • Regular: Peak 4.0 fps
  • Wireframe: Peak 1.2 fps (!)

Don’t despair, both are doing much better than the wireframe view. :slight_smile:

If it’s OK, I’ll submit a patch changing the qobject_cast calls in
engines to dynamic_cast for now. This way I have the same
functionality as everyone else and can hack on some user interface
pieces.

Cheers,
-Geoff


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options

That’s great. Oh, are you using qt4.3? I wonder if that’s maybe the
real problem and not 4.2. I have yet to try 4.3 :confused:

No, I switched back to 4.2 in case the beta was flaky. I really don’t
know what the problem is, although I’ve considered trying qmake
instead of cmake. The other possibility I’ve thought about is that
we’re using a program which opens a library, which opens plugins.
Maybe the levels of loading are causing the bug.

the draw tool. There is a small “operational” bug when you move to an
atom, it snaps to it, then if you move directly to another atom it
doesn’t move you. easily fixed.

It would be nice if the draw tool did “morphing” – you change the
element to nitrogen, click on an atom and it changes. Change the bond
type to double, draw over a bond, and it changes. (Hmm, maybe I’ll
try that now.)

Probably the best thing to get out a release is to pick a group of
tasks to be finished before release and throw them on the wiki. Then
we can mark them off one-by-one.

Cheers,
-Geoff