[osg-users] [Questio nabout StateSet.cpp] truncated attribute override value?

Voerman, L. l.voerman at rug.nl
Thu Sep 10 00:21:36 PDT 2015


Hi Julien,
it's OFF, the enum for StateAttribute::OFF is 0x0, so anything not ON has
value OFF.
Regards, Laurens.


On Wed, Sep 9, 2015 at 7:45 PM, Julien Valentin <julienvalentin51 at gmail.com>
wrote:

> Hi,
> Iwould like to introspect StateSet in order to know which override value
> is activated for a particular stateset.
> I parse AttributeList for this
>
> Code:
> for( osg::StateSet::AttributeList::const_iterator
> it=ss->getAttributeList().begin();it!=ss->getAttributeList().end() ; it++)
> {
>             if((*it).second.first ==stateattribute)
>             {
>                 if( (*it).second.second & osg::StateAttribute::ON)
>                 return(1);
>                 else return(0);
> }
>
>
>
> but according to StateSet.cpp l.1662
>
> Code:
> attributeList[attribute->getTypeMemberPair()] =
> RefAttributePair(attribute,value&(StateAttribute::OVERRIDE|StateAttribute::PROTECTED));
>
>
>
> the ON OFF bit is removed from the given user value. So I can't determine
> if an osg::Attribute is ON or OFF but only if it's OVERRIDE or PROTECTED
> I would like to know if there's a known reason behind this logic & and
> further if you know a mean to retrieve the ON/OFF bit.
>
> Thank you!
>
> Cheers,
> Julien
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65081#65081
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150910/1f0bc2ce/attachment-0003.htm>


More information about the osg-users mailing list