[osg-users] Change to Optimizer OptimizationOptions

Wojciech Lewandowski lewandowski at ai.com.pl
Tue Nov 3 09:34:25 PST 2009


IMHO This is the best option so far ;-). I like it.

Wojtek

----- Original Message ----- 
From: "Peter Hrenka" <p.hrenka at science-computing.de>
To: "OpenSceneGraph Users" <osg-users at lists.openscenegraph.org>
Sent: Tuesday, November 03, 2009 6:31 PM
Subject: Re: [osg-users] Change to Optimizer OptimizationOptions


> 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 the idea, it should be rather trivial
>>> to reimplement this from scratch and tailor it OSG's requirements.
>>
>>   I'm not familiar with it, but I agree that perhaps a flags 
>> class/template would be a
>> smart way to clean up the situation. If it would solve the issues.
>>
>>   I know I'm always happier using a provided set/test API than manually 
>> masking stuff. As
>> long as it doesn't bloat the data size beyond the simple storage of the 
>> flag word. as long
>> as we don't make any of it virtual, I think it would be ok. Though I 
>> don't know how RTTI
>> adds to the class per-instance weight of a real class (as opposed to a 
>> built-in type like
>> unsigned long int). Any C++ guru care to comment on that?
>
> 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).
>
>
> Cheers,
>
> Peter
>
>
>
> -- 
> Vorstand/Board of Management:
> Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid 
> Zech
> Vorsitzender des Aufsichtsrats/
> Chairman of the Supervisory Board:
> Michel Lepert
> Sitz/Registered Office: Tuebingen
> Registergericht/Registration Court: Stuttgart
> Registernummer/Commercial Register No.: HRB 382196
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 



More information about the osg-users mailing list