Hi all,

Just a heads-up, no real bug-report per se.

I was mucking about with the function objects and graph traversal, and found that encapsulation boost function objects in the traversefunctors sometimes do not work at all. (The stored object didn't cast back properly when it was invocation time, i.e. some copy/conversion did not work as expected). I merely did some refactoring that should have no effect on this (it worked ok for quite some time) and it stopped working.

I can't really say exactly what I did (too many changes) but obviously there was something that caused the conversion to fail.

I didn't have time to track this down, as it was faster to copy-paste the osg::traverse-code, make it templated and have that use generic function objects. That solved my problem. (I could probably write one that uses boost::function this making the traverse code non-template to minimize code-bloat, but so far this hasn't been a problem).

I suspect the way objects are stored (memcpy to char & stuff) in OpenSG's functors are the cause for this, and there was some undocumented restriction that I fell upon (using a pointer pointing back to the function object itself perhaps, that would defeat this scheme).

A fix would be to not copy data with memcpy but to leave it in memory via a ptr to a base class instead (defining a virtual operator()(...)) with the template-invocation implementing it.

Anyway, just wanted to let you know.. it could happen to you! ;)
(unless it's been fixed?)

Best regards
/Marcus

FYI: This is still vanilla OpenSG 1.4.


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to