Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-04 Thread Paul Martz
Peter Hrenka wrote: Has anybody had a look at Qt's QFlags? http://doc.trolltech.com/4.5/qflags.html They provide a type-safe way of dealing with bit-mask-style enums. The implementation is mostly a template class with overloaded operators. Once you have the idea, it should be rather trivial to

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-04 Thread Chris 'Xenon' Hanson
Paul Martz wrote: Personally, I already feel that using an enum to store bitflags is overkill. Defining an entire class to implement the bitflag/mask pattern along with set/get methods strikes me as the epitome of C++ abuse. I don't think I can back this, not even if measurements indicate no

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-04 Thread Paul Martz
Chris 'Xenon' Hanson wrote: Oh, I love getting to wrangle theory with friends. ;) You can call me an idiot if you want, and I'll still buy you coffee. :-) In the situation where they are unrelated state bits, being able to say stateBits.test(MY_STATE) it actually is perhaps more obvious

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-04 Thread Robert Osfield
On Wed, Nov 4, 2009 at 4:51 PM, Paul Martz pma...@skew-matrix.com wrote: Like I said, it's Robert's call, and we'll all go with what he says. From this day forth everyone should wear kilts and toss the caber, and work towards world peace and harmony ;-) Robert.

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-04 Thread Jean-Sébastien Guay
From this day forth everyone should wear kilts and toss the caber, and work towards world peace and harmony ;-) Absolutely! I agree with you on all points! Robert has spoken! ... but don't hate me if I had to Google to find out what toss the caber meant ... :-) J-S --

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-04 Thread Chris 'Xenon' Hanson
Robert Osfield wrote: From this day forth everyone should wear kilts and toss the caber, and work towards world peace and harmony ;-) As long as I don't have to shave my legs. Robert. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-03 Thread Peter Hrenka
Hi, Paul Martz schrieb: Hi Robert -- The code submission by Wojciech and I for MSFBO has opened a small can of worms on declaring bits and bitmasks. I hope you can weigh in and put an end to the debate. Has anybody had a look at Qt's QFlags? http://doc.trolltech.com/4.5/qflags.html They

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-03 Thread Chris 'Xenon' Hanson
Peter Hrenka wrote: Has anybody had a look at Qt's QFlags? http://doc.trolltech.com/4.5/qflags.html They provide a type-safe way of dealing with bit-mask-style enums. The implementation is mostly a template class with overloaded operators. Once you have the idea, it should be rather trivial

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-03 Thread Peter Hrenka
Hi Chris, Chris 'Xenon' Hanson schrieb: Peter Hrenka wrote: Has anybody had a look at Qt's QFlags? http://doc.trolltech.com/4.5/qflags.html They provide a type-safe way of dealing with bit-mask-style enums. The implementation is mostly a template class with overloaded operators. Once you have

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-03 Thread Chris 'Xenon' Hanson
Peter Hrenka wrote: Nothing needs to be virtual here. It's just a template class with overloaded operators which means everything is effectively inlined. We could also use an unsigned int as internal storage type (Qt seems to use a signed int). But doesn't RTTI embed a hidden pointer

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-03 Thread Wojciech Lewandowski
IMHO This is the best option so far ;-). I like it. Wojtek - Original Message - From: Peter Hrenka p.hre...@science-computing.de To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Sent: Tuesday, November 03, 2009 6:31 PM Subject: Re: [osg-users] Change to Optimizer

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-03 Thread Peter Hrenka
Hi Chris, Chris 'Xenon' Hanson schrieb: Peter Hrenka wrote: Nothing needs to be virtual here. It's just a template class with overloaded operators which means everything is effectively inlined. We could also use an unsigned int as internal storage type (Qt seems to use a signed int). But

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-02 Thread Chris 'Xenon' Hanson
Paul Martz wrote: In Wojciech's modified submission, he changed the bitmask variable to a signed int, with the reasoning that enum values are also signed ints, and this eliminates the need for a typecast to get rid of compiler warnings. This caused me to weigh in with the workaround of

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-11-02 Thread J.P. Delport
Hi, If you could post with do it this way or do it that way, I (for one) could get back to work and stop prodding everyone with my code style opinions. :-) Ooh, we could start a whole new OSG list just for code style fights and then unearth the old extensionless headers arguments on

Re: [osg-users] Change to Optimizer OptimizationOptions

2009-10-30 Thread Ulrich Hertlein
On 29/10/09 10:55 PM, Paul Martz wrote: Hi Robert -- The code submission by Wojciech and I for MSFBO has opened a small can of worms on declaring bits and bitmasks. I hope you can weigh in and put an end to the debate. Originally, my submission followed the Optimizer's OptimizationOptions

[osg-users] Change to Optimizer OptimizationOptions

2009-10-29 Thread Paul Martz
Hi Robert -- The code submission by Wojciech and I for MSFBO has opened a small can of worms on declaring bits and bitmasks. I hope you can weigh in and put an end to the debate. Originally, my submission followed the Optimizer's OptimizationOptions pattern of declaring bit values in an enum,