Convert usage to use const versions of containers

This commit is contained in:
Robert Osfield
2013-06-24 11:03:59 +00:00
parent 864e5cb6f0
commit ca2688b046
5 changed files with 21 additions and 21 deletions

View File

@@ -48,8 +48,8 @@ void LinkVisitor::handle_stateset(osg::StateSet* stateset)
{
if (!stateset)
return;
osg::StateSet::AttributeList& attr = stateset->getAttributeList();
for (osg::StateSet::AttributeList::iterator it = attr.begin(); it != attr.end(); ++it)
const osg::StateSet::AttributeList& attr = stateset->getAttributeList();
for (osg::StateSet::AttributeList::const_iterator it = attr.begin(); it != attr.end(); ++it)
{
osg::StateAttribute* sattr = it->second.first.get();
osgAnimation::AnimationUpdateCallbackBase* cb = dynamic_cast<osgAnimation::AnimationUpdateCallbackBase*>(sattr->getUpdateCallback());

View File

@@ -183,7 +183,7 @@ void SharedStateManager::setStateSet(osg::StateSet* ss, osg::Object* object)
//----------------------------------------------------------------
void SharedStateManager::shareTextures(osg::StateSet* ss)
{
osg::StateSet::TextureAttributeList& texAttributes = ss->getTextureAttributeList();
const osg::StateSet::TextureAttributeList& texAttributes = ss->getTextureAttributeList();
for(unsigned int unit=0;unit<texAttributes.size();++unit)
{
osg::StateAttribute *texture = ss->getTextureAttribute(unit, osg::StateAttribute::TEXTURE);

View File

@@ -128,8 +128,8 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset)
_renderInfo.getState()->setLastAppliedProgramObject(pcp);
osg::StateSet::UniformList& ul = stateset.getUniformList();
for(osg::StateSet::UniformList::iterator itr = ul.begin();
const osg::StateSet::UniformList& ul = stateset.getUniformList();
for(osg::StateSet::UniformList::const_iterator itr = ul.begin();
itr != ul.end();
++itr)
{

View File

@@ -138,7 +138,7 @@ void StateToCompile::apply(osg::StateSet& stateset)
_programs.insert(program);
}
osg::StateSet::TextureAttributeList& tal = stateset.getTextureAttributeList();
const osg::StateSet::TextureAttributeList& tal = stateset.getTextureAttributeList();
#if 0
if (tal.size()>1)
@@ -146,13 +146,13 @@ void StateToCompile::apply(osg::StateSet& stateset)
tal.erase(tal.begin()+1,tal.end());
}
#endif
for(osg::StateSet::TextureAttributeList::iterator itr = tal.begin();
for(osg::StateSet::TextureAttributeList::const_iterator itr = tal.begin();
itr != tal.end();
++itr)
{
osg::StateSet::AttributeList& al = *itr;
const osg::StateSet::AttributeList& al = *itr;
osg::StateAttribute::TypeMemberPair tmp(osg::StateAttribute::TEXTURE,0);
osg::StateSet::AttributeList::iterator texItr = al.find(tmp);
osg::StateSet::AttributeList::const_iterator texItr = al.find(tmp);
if (texItr != al.end())
{
osg::Texture* texture = dynamic_cast<osg::Texture*>(texItr->second.first.get());

View File

@@ -516,8 +516,8 @@ void Optimizer::StateVisitor::optimize()
sitr!=_statesets.end();
++sitr)
{
osg::StateSet::AttributeList& attributes = sitr->first->getAttributeList();
for(osg::StateSet::AttributeList::iterator aitr= attributes.begin();
const osg::StateSet::AttributeList& attributes = sitr->first->getAttributeList();
for(osg::StateSet::AttributeList::const_iterator aitr= attributes.begin();
aitr!=attributes.end();
++aitr)
{
@@ -528,11 +528,11 @@ void Optimizer::StateVisitor::optimize()
}
osg::StateSet::TextureAttributeList& texAttributes = sitr->first->getTextureAttributeList();
const osg::StateSet::TextureAttributeList& texAttributes = sitr->first->getTextureAttributeList();
for(unsigned int unit=0;unit<texAttributes.size();++unit)
{
osg::StateSet::AttributeList& attributes = texAttributes[unit];
for(osg::StateSet::AttributeList::iterator aitr= attributes.begin();
const osg::StateSet::AttributeList& attributes = texAttributes[unit];
for(osg::StateSet::AttributeList::const_iterator aitr= attributes.begin();
aitr!=attributes.end();
++aitr)
{
@@ -544,8 +544,8 @@ void Optimizer::StateVisitor::optimize()
}
osg::StateSet::UniformList& uniforms = sitr->first->getUniformList();
for(osg::StateSet::UniformList::iterator uitr= uniforms.begin();
const osg::StateSet::UniformList& uniforms = sitr->first->getUniformList();
for(osg::StateSet::UniformList::const_iterator uitr= uniforms.begin();
uitr!=uniforms.end();
++uitr)
{
@@ -1808,10 +1808,10 @@ void Optimizer::CheckGeometryVisitor::checkGeode(osg::Geode& geode)
osg::Geometry* geom = geode.getDrawable(i)->asGeometry();
if (geom && isOperationPermissibleForObject(geom))
{
#ifdef GEOMETRYDEPRECATED
#ifdef GEOMETRYDEPRECATED
geom1829
->computeCorrectBindingsAndArraySizes();
#endif
#endif
}
}
}
@@ -4071,7 +4071,7 @@ void Optimizer::TextureAtlasVisitor::reset()
bool Optimizer::TextureAtlasVisitor::pushStateSet(osg::StateSet* stateset)
{
osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList();
const osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList();
// if no textures ignore
if (tal.empty()) return false;
@@ -4209,7 +4209,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
osg::StateSet* stateset = sitr->first;
Drawables& drawables = sitr->second;
osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList();
const osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList();
for(unsigned int unit=0; unit<tal.size(); ++unit)
{
osg::Texture2D* texture = dynamic_cast<osg::Texture2D*>(stateset->getTextureAttribute(unit,osg::StateAttribute::TEXTURE));
@@ -4376,7 +4376,7 @@ void Optimizer::TextureAtlasVisitor::optimize()
++sitr)
{
osg::StateSet* stateset = sitr->first;
osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList();
const osg::StateSet::TextureAttributeList& tal = stateset->getTextureAttributeList();
for(unsigned int unit=0; unit<tal.size(); ++unit)
{
osg::Texture2D* texture = dynamic_cast<osg::Texture2D*>(stateset->getTextureAttribute(unit,osg::StateAttribute::TEXTURE));