Replace BOOST_FOREACH by C++ 11 for range loop.
This commit is contained in:
parent
825d93423d
commit
c9a4c0dac1
@ -22,12 +22,11 @@
|
|||||||
#include <simgear_config.h>
|
#include <simgear_config.h>
|
||||||
#include <simgear/debug/BufferedLogCallback.hxx>
|
#include <simgear/debug/BufferedLogCallback.hxx>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <simgear/sg_inlines.h>
|
#include <simgear/sg_inlines.h>
|
||||||
#include <simgear/threads/SGThread.hxx>
|
#include <simgear/threads/SGThread.hxx>
|
||||||
|
|
||||||
#include <cstdlib> // for malloc
|
#include <cstdlib> // for malloc
|
||||||
|
#include <cstring>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
namespace simgear
|
namespace simgear
|
||||||
@ -52,7 +51,7 @@ BufferedLogCallback::BufferedLogCallback(sgDebugClass c, sgDebugPriority p) :
|
|||||||
|
|
||||||
BufferedLogCallback::~BufferedLogCallback()
|
BufferedLogCallback::~BufferedLogCallback()
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(unsigned char* msg, d->m_buffer) {
|
for (auto msg : d->m_buffer) {
|
||||||
free(msg);
|
free(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,14 +24,13 @@
|
|||||||
|
|
||||||
#include "logstream.hxx"
|
#include "logstream.hxx"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <simgear/sg_inlines.h>
|
#include <simgear/sg_inlines.h>
|
||||||
#include <simgear/threads/SGThread.hxx>
|
#include <simgear/threads/SGThread.hxx>
|
||||||
#include <simgear/threads/SGQueue.hxx>
|
#include <simgear/threads/SGQueue.hxx>
|
||||||
@ -532,7 +531,7 @@ public:
|
|||||||
PauseThread pause(this);
|
PauseThread pause(this);
|
||||||
m_logPriority = p;
|
m_logPriority = p;
|
||||||
m_logClass = c;
|
m_logClass = c;
|
||||||
BOOST_FOREACH(simgear::LogCallback* cb, m_consoleCallbacks) {
|
for (auto cb : m_consoleCallbacks) {
|
||||||
cb->setLogLevels(c, p);
|
cb->setLogLevels(c, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/algorithm/string/case_conv.hpp>
|
#include <boost/algorithm/string/case_conv.hpp>
|
||||||
|
|
||||||
#include <simgear/simgear_config.h>
|
#include <simgear/simgear_config.h>
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
#include <simgear/io/sg_file.hxx>
|
#include <simgear/io/sg_file.hxx>
|
||||||
#include <simgear/io/HTTPClient.hxx>
|
#include <simgear/io/HTTPClient.hxx>
|
||||||
@ -123,7 +121,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
ARequest* req = new ARequest(url);
|
ARequest* req = new ARequest(url);
|
||||||
BOOST_FOREACH(string h, headers) {
|
for (const auto& h : headers) {
|
||||||
req->addHeader(h);
|
req->addHeader(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
#include <simgear/misc/strutils.hxx>
|
#include <simgear/misc/strutils.hxx>
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -359,7 +358,7 @@ bool Dir::removeChildren() const
|
|||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
PathList cs = children(NO_DOT_OR_DOTDOT | INCLUDE_HIDDEN | TYPE_FILE | TYPE_DIR);
|
PathList cs = children(NO_DOT_OR_DOTDOT | INCLUDE_HIDDEN | TYPE_FILE | TYPE_DIR);
|
||||||
BOOST_FOREACH(SGPath path, cs) {
|
for (auto path : cs) {
|
||||||
if (path.isDir()) {
|
if (path.isDir()) {
|
||||||
Dir childDir(path);
|
Dir childDir(path);
|
||||||
ok = childDir.remove(true);
|
ok = childDir.remove(true);
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <simgear_config.h>
|
#include <simgear_config.h>
|
||||||
#include <simgear/package/Catalog.hxx>
|
#include <simgear/package/Catalog.hxx>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -299,7 +298,7 @@ PackageList
|
|||||||
Catalog::packagesMatching(const SGPropertyNode* aFilter) const
|
Catalog::packagesMatching(const SGPropertyNode* aFilter) const
|
||||||
{
|
{
|
||||||
PackageList r;
|
PackageList r;
|
||||||
BOOST_FOREACH(PackageRef p, m_packages) {
|
for (auto p : m_packages) {
|
||||||
if (p->matches(aFilter)) {
|
if (p->matches(aFilter)) {
|
||||||
r.push_back(p);
|
r.push_back(p);
|
||||||
}
|
}
|
||||||
@ -311,7 +310,7 @@ PackageList
|
|||||||
Catalog::packagesNeedingUpdate() const
|
Catalog::packagesNeedingUpdate() const
|
||||||
{
|
{
|
||||||
PackageList r;
|
PackageList r;
|
||||||
BOOST_FOREACH(PackageRef p, m_packages) {
|
for (auto p : m_packages) {
|
||||||
if (!p->isInstalled()) {
|
if (!p->isInstalled()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -327,7 +326,7 @@ PackageList
|
|||||||
Catalog::installedPackages() const
|
Catalog::installedPackages() const
|
||||||
{
|
{
|
||||||
PackageList r;
|
PackageList r;
|
||||||
BOOST_FOREACH(PackageRef p, m_packages) {
|
for (auto p : m_packages) {
|
||||||
if (p->isInstalled()) {
|
if (p->isInstalled()) {
|
||||||
r.push_back(p);
|
r.push_back(p);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include <simgear/package/Package.hxx>
|
#include <simgear/package/Package.hxx>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/algorithm/string/case_conv.hpp>
|
#include <boost/algorithm/string/case_conv.hpp>
|
||||||
|
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
@ -369,7 +368,7 @@ PackageList Package::dependencies() const
|
|||||||
{
|
{
|
||||||
PackageList result;
|
PackageList result;
|
||||||
|
|
||||||
BOOST_FOREACH(SGPropertyNode* dep, m_props->getChildren("depends")) {
|
for (auto dep : m_props->getChildren("depends")) {
|
||||||
std::string depName = dep->getStringValue("id");
|
std::string depName = dep->getStringValue("id");
|
||||||
unsigned int rev = dep->getIntValue("revision", 0);
|
unsigned int rev = dep->getIntValue("revision", 0);
|
||||||
|
|
||||||
@ -410,7 +409,7 @@ std::string Package::nameForVariant(const std::string& vid) const
|
|||||||
return name();
|
return name();
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(SGPropertyNode* var, m_props->getChildren("variant")) {
|
for (auto var : m_props->getChildren("variant")) {
|
||||||
if (vid == var->getStringValue("id")) {
|
if (vid == var->getStringValue("id")) {
|
||||||
return var->getStringValue("name");
|
return var->getStringValue("name");
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <simgear/package/Root.hxx>
|
#include <simgear/package/Root.hxx>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
@ -349,7 +348,7 @@ unsigned int Root::maxAgeSeconds() const
|
|||||||
void Root::setHTTPClient(HTTP::Client* aHTTP)
|
void Root::setHTTPClient(HTTP::Client* aHTTP)
|
||||||
{
|
{
|
||||||
d->http = aHTTP;
|
d->http = aHTTP;
|
||||||
BOOST_FOREACH(HTTP::Request_ptr req, d->httpPendingRequests) {
|
for (auto req : d->httpPendingRequests) {
|
||||||
d->http->makeRequest(req);
|
d->http->makeRequest(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include <simgear/package/Root.hxx>
|
#include <simgear/package/Root.hxx>
|
||||||
#include <simgear/misc/sg_dir.hxx>
|
#include <simgear/misc/sg_dir.hxx>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ void printPackageInfo(pkg::Package* pkg)
|
|||||||
|
|
||||||
if (pkg->properties()->hasChild("author")) {
|
if (pkg->properties()->hasChild("author")) {
|
||||||
cout << "Authors:" << endl;
|
cout << "Authors:" << endl;
|
||||||
BOOST_FOREACH(SGPropertyNode* author, pkg->properties()->getChildren("author")) {
|
for (auto author : pkg->properties()->getChildren("author")) {
|
||||||
if (author->hasChild("name")) {
|
if (author->hasChild("name")) {
|
||||||
cout << "\t" << author->getStringValue("name") << endl;
|
cout << "\t" << author->getStringValue("name") << endl;
|
||||||
|
|
||||||
@ -174,7 +173,7 @@ int main(int argc, char** argv)
|
|||||||
pkg->install()->uninstall();
|
pkg->install()->uninstall();
|
||||||
} else if (!strcmp(argv[1], "update-all")) {
|
} else if (!strcmp(argv[1], "update-all")) {
|
||||||
pkg::PackageList updates = root->packagesNeedingUpdate();
|
pkg::PackageList updates = root->packagesNeedingUpdate();
|
||||||
BOOST_FOREACH(pkg::Package* p, updates) {
|
for (auto p : updates) {
|
||||||
root->scheduleToUpdate(p->install());
|
root->scheduleToUpdate(p->install());
|
||||||
}
|
}
|
||||||
} else if (!strcmp(argv[1], "list-updated")) {
|
} else if (!strcmp(argv[1], "list-updated")) {
|
||||||
@ -185,7 +184,7 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
cout << updates.size() << " packages have updates" << endl;
|
cout << updates.size() << " packages have updates" << endl;
|
||||||
BOOST_FOREACH(pkg::Package* p, updates) {
|
for (auto p : updates) {
|
||||||
cout << "\t" << p->id() << " " << p->getLocalisedProp("name") << endl;
|
cout << "\t" << p->id() << " " << p->getLocalisedProp("name") << endl;
|
||||||
}
|
}
|
||||||
} else if (!strcmp(argv[1], "info")) {
|
} else if (!strcmp(argv[1], "info")) {
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
#include "PropertyBasedMgr.hxx"
|
#include "PropertyBasedMgr.hxx"
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -78,7 +76,7 @@ namespace simgear
|
|||||||
if( name.empty() )
|
if( name.empty() )
|
||||||
return PropertyBasedElementPtr();
|
return PropertyBasedElementPtr();
|
||||||
|
|
||||||
BOOST_FOREACH(PropertyBasedElementPtr el, _elements)
|
for (auto el : _elements)
|
||||||
if( el && el->getProps()->getStringValue("name") == name )
|
if( el && el->getProps()->getStringValue("name") == name )
|
||||||
return el;
|
return el;
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <cpl_conv.h> // for CPLMalloc()
|
#include <cpl_conv.h> // for CPLMalloc()
|
||||||
#include "ogr_spatialref.h"
|
#include "ogr_spatialref.h"
|
||||||
|
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <cpl_conv.h> // for CPLMalloc()
|
#include <cpl_conv.h> // for CPLMalloc()
|
||||||
#include "ogr_spatialref.h"
|
#include "ogr_spatialref.h"
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/tuple/tuple_comparison.hpp>
|
#include <boost/tuple/tuple_comparison.hpp>
|
||||||
@ -261,8 +260,7 @@ int Effect::getGenerator(Effect::Generator what) const
|
|||||||
|
|
||||||
Technique* Effect::chooseTechnique(RenderInfo* info, const std::string &scheme)
|
Technique* Effect::chooseTechnique(RenderInfo* info, const std::string &scheme)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(ref_ptr<Technique>& technique, techniques)
|
for (auto& technique : techniques) {
|
||||||
{
|
|
||||||
if (technique->valid(info) == Technique::VALID &&
|
if (technique->valid(info) == Technique::VALID &&
|
||||||
technique->getScheme() == scheme)
|
technique->getScheme() == scheme)
|
||||||
return technique.get();
|
return technique.get();
|
||||||
@ -272,16 +270,14 @@ Technique* Effect::chooseTechnique(RenderInfo* info, const std::string &scheme)
|
|||||||
|
|
||||||
void Effect::resizeGLObjectBuffers(unsigned int maxSize)
|
void Effect::resizeGLObjectBuffers(unsigned int maxSize)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(const ref_ptr<Technique>& technique, techniques)
|
for (const auto& technique : techniques) {
|
||||||
{
|
|
||||||
technique->resizeGLObjectBuffers(maxSize);
|
technique->resizeGLObjectBuffers(maxSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Effect::releaseGLObjects(osg::State* state) const
|
void Effect::releaseGLObjects(osg::State* state) const
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(const ref_ptr<Technique>& technique, techniques)
|
for (const auto& technique : techniques) {
|
||||||
{
|
|
||||||
technique->releaseGLObjects(state);
|
technique->releaseGLObjects(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -929,8 +925,7 @@ void ShaderProgramBuilder::buildAttribute(Effect* effect, Pass* pass,
|
|||||||
// resolvedProgramMap for a program using those shaders.
|
// resolvedProgramMap for a program using those shaders.
|
||||||
ProgramKey resolvedKey;
|
ProgramKey resolvedKey;
|
||||||
resolvedKey.attributes = prgKey.attributes;
|
resolvedKey.attributes = prgKey.attributes;
|
||||||
BOOST_FOREACH(const ShaderKey& shaderKey, prgKey.shaders)
|
for (const auto& shaderKey : prgKey.shaders) {
|
||||||
{
|
|
||||||
// FIXME orig: const string& shaderName = shaderKey.first;
|
// FIXME orig: const string& shaderName = shaderKey.first;
|
||||||
string shaderName = shaderKey.first;
|
string shaderName = shaderKey.first;
|
||||||
Shader::Type stype = (Shader::Type)shaderKey.second;
|
Shader::Type stype = (Shader::Type)shaderKey.second;
|
||||||
@ -957,8 +952,7 @@ void ShaderProgramBuilder::buildAttribute(Effect* effect, Pass* pass,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
program = new Program;
|
program = new Program;
|
||||||
BOOST_FOREACH(const ShaderKey& skey, resolvedKey.shaders)
|
for (const auto& skey : resolvedKey.shaders) {
|
||||||
{
|
|
||||||
const string& fileName = skey.first;
|
const string& fileName = skey.first;
|
||||||
Shader::Type stype = (Shader::Type)skey.second;
|
Shader::Type stype = (Shader::Type)skey.second;
|
||||||
ShaderMap::iterator sitr = shaderMap.find(skey);
|
ShaderMap::iterator sitr = shaderMap.find(skey);
|
||||||
@ -973,7 +967,7 @@ void ShaderProgramBuilder::buildAttribute(Effect* effect, Pass* pass,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOST_FOREACH(const ProgramKey::AttribKey& key, prgKey.attributes) {
|
for (const auto& key : prgKey.attributes) {
|
||||||
program->addBindAttribLocation(key.first, key.second);
|
program->addBindAttribLocation(key.first, key.second);
|
||||||
}
|
}
|
||||||
const SGPropertyNode* pGeometryVerticesOut
|
const SGPropertyNode* pGeometryVerticesOut
|
||||||
@ -1551,7 +1545,7 @@ bool Effect_writeLocalData(const Object& obj, osgDB::Output& fw)
|
|||||||
const Effect& effect = static_cast<const Effect&>(obj);
|
const Effect& effect = static_cast<const Effect&>(obj);
|
||||||
|
|
||||||
fw.indent() << "techniques " << effect.techniques.size() << "\n";
|
fw.indent() << "techniques " << effect.techniques.size() << "\n";
|
||||||
BOOST_FOREACH(const ref_ptr<Technique>& technique, effect.techniques) {
|
for (const auto& technique : effect.techniques) {
|
||||||
fw.writeObject(*technique);
|
fw.writeObject(*technique);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
#include "Pass.hxx"
|
#include "Pass.hxx"
|
||||||
#include "EffectCullVisitor.hxx"
|
#include "EffectCullVisitor.hxx"
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -177,8 +175,7 @@ Technique::processDrawables(const EffectGeode::DrawablesIterator& begin,
|
|||||||
}
|
}
|
||||||
EffectCullVisitor* ecv = dynamic_cast<EffectCullVisitor*>( cv );
|
EffectCullVisitor* ecv = dynamic_cast<EffectCullVisitor*>( cv );
|
||||||
EffectGeode::DrawablesIterator drawablesEnd = itr;
|
EffectGeode::DrawablesIterator drawablesEnd = itr;
|
||||||
BOOST_FOREACH(ref_ptr<Pass>& pass, passes)
|
for (auto& pass : passes) {
|
||||||
{
|
|
||||||
osg::ref_ptr<osg::StateSet> ss = pass;
|
osg::ref_ptr<osg::StateSet> ss = pass;
|
||||||
if (ecv && ( ! pass->getBufferUnitList().empty() || ! pass->getPositionedUniformMap().empty() ) ) {
|
if (ecv && ( ! pass->getBufferUnitList().empty() || ! pass->getPositionedUniformMap().empty() ) ) {
|
||||||
ss = static_cast<osg::StateSet*>(
|
ss = static_cast<osg::StateSet*>(
|
||||||
@ -220,7 +217,7 @@ void Technique::resizeGLObjectBuffers(unsigned int maxSize)
|
|||||||
{
|
{
|
||||||
if (_shadowingStateSet.valid())
|
if (_shadowingStateSet.valid())
|
||||||
_shadowingStateSet->resizeGLObjectBuffers(maxSize);
|
_shadowingStateSet->resizeGLObjectBuffers(maxSize);
|
||||||
BOOST_FOREACH(ref_ptr<Pass>& pass, passes) {
|
for (auto& pass : passes) {
|
||||||
pass->resizeGLObjectBuffers(maxSize);
|
pass->resizeGLObjectBuffers(maxSize);
|
||||||
}
|
}
|
||||||
_contextMap.resize(maxSize);
|
_contextMap.resize(maxSize);
|
||||||
@ -230,8 +227,7 @@ void Technique::releaseGLObjects(osg::State* state) const
|
|||||||
{
|
{
|
||||||
if (_shadowingStateSet.valid())
|
if (_shadowingStateSet.valid())
|
||||||
_shadowingStateSet->releaseGLObjects(state);
|
_shadowingStateSet->releaseGLObjects(state);
|
||||||
BOOST_FOREACH(const ref_ptr<Pass>& pass, passes)
|
for (const auto& pass : passes) {
|
||||||
{
|
|
||||||
pass->releaseGLObjects(state);
|
pass->releaseGLObjects(state);
|
||||||
}
|
}
|
||||||
if (state == 0) {
|
if (state == 0) {
|
||||||
@ -444,7 +440,7 @@ bool Technique_writeLocalData(const Object& obj, osgDB::Output& fw)
|
|||||||
fw.writeObject(*tniq.getShadowingStateSet());
|
fw.writeObject(*tniq.getShadowingStateSet());
|
||||||
}
|
}
|
||||||
fw.indent() << "num_passes " << tniq.passes.size() << "\n";
|
fw.indent() << "num_passes " << tniq.passes.size() << "\n";
|
||||||
BOOST_FOREACH(const ref_ptr<Pass>& pass, tniq.passes) {
|
for (const auto& pass : tniq.passes) {
|
||||||
fw.writeObject(*pass);
|
fw.writeObject(*pass);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include "mat.hxx"
|
#include "mat.hxx"
|
||||||
|
|
||||||
#include <osg/CullFace>
|
#include <osg/CullFace>
|
||||||
@ -520,8 +519,7 @@ void SGMaterial::buildEffectProperties(const SGReaderWriterOptions* options)
|
|||||||
makeChild(binProp, "bin-number")->setIntValue(TRANSPARENT_BIN);
|
makeChild(binProp, "bin-number")->setIntValue(TRANSPARENT_BIN);
|
||||||
makeChild(binProp, "bin-name")->setStringValue("DepthSortedBin");
|
makeChild(binProp, "bin-name")->setStringValue("DepthSortedBin");
|
||||||
}
|
}
|
||||||
BOOST_FOREACH(_internal_state& matState, _status)
|
for (auto& matState : _status) {
|
||||||
{
|
|
||||||
SGPropertyNode_ptr effectProp = new SGPropertyNode();
|
SGPropertyNode_ptr effectProp = new SGPropertyNode();
|
||||||
copyProperties(propRoot, effectProp);
|
copyProperties(propRoot, effectProp);
|
||||||
SGPropertyNode* effectParamProp = effectProp->getChild("parameters", 0);
|
SGPropertyNode* effectParamProp = effectProp->getChild("parameters", 0);
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include <simgear/scene/util/OsgMath.hxx>
|
#include <simgear/scene/util/OsgMath.hxx>
|
||||||
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
|
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
|
||||||
#include <boost/scoped_array.hpp>
|
#include <boost/scoped_array.hpp>
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
typedef std::map<std::string, osg::observer_ptr<simgear::Effect> > EffectMap;
|
typedef std::map<std::string, osg::observer_ptr<simgear::Effect> > EffectMap;
|
||||||
static EffectMap lightEffectMap;
|
static EffectMap lightEffectMap;
|
||||||
@ -68,8 +67,8 @@ public:
|
|||||||
params->getNode("ambient")->setValue(_ambient * dim);
|
params->getNode("ambient")->setValue(_ambient * dim);
|
||||||
params->getNode("diffuse")->setValue(_diffuse * dim);
|
params->getNode("diffuse")->setValue(_diffuse * dim);
|
||||||
params->getNode("specular")->setValue(_specular * dim);
|
params->getNode("specular")->setValue(_specular * dim);
|
||||||
BOOST_FOREACH(osg::ref_ptr<simgear::Technique> & technique, effect->techniques) {
|
for (auto& technique : effect->techniques) {
|
||||||
BOOST_FOREACH(osg::ref_ptr<simgear::Pass> & pass, technique->passes) {
|
for (auto& pass : technique->passes) {
|
||||||
osg::Uniform* amb = pass->getUniform("Ambient");
|
osg::Uniform* amb = pass->getUniform("Ambient");
|
||||||
if (amb)
|
if (amb)
|
||||||
amb->set(osg::Vec4f(_ambient.x() * dim, _ambient.y() * dim, _ambient.z() * dim, _ambient.w() * dim));
|
amb->set(osg::Vec4f(_ambient.x() * dim, _ambient.y() * dim, _ambient.z() * dim, _ambient.w() * dim));
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
#include <osgDB/FileNameUtils>
|
#include <osgDB/FileNameUtils>
|
||||||
#include <osgDB/FileUtils>
|
#include <osgDB/FileUtils>
|
||||||
@ -349,7 +347,7 @@ ref_ptr<Node> instantiateEffects(osg::Node* modelGroup,
|
|||||||
SGPropertyNode* defaultNode = configNode->getChild("default");
|
SGPropertyNode* defaultNode = configNode->getChild("default");
|
||||||
if (defaultNode && defaultNode->getValue<bool>())
|
if (defaultNode && defaultNode->getValue<bool>())
|
||||||
defaultEffectPropRoot = configNode;
|
defaultEffectPropRoot = configNode;
|
||||||
BOOST_FOREACH(SGPropertyNode_ptr objNameNode, objectNames) {
|
for (auto objNameNode : objectNames) {
|
||||||
emap.insert(make_pair(objNameNode->getStringValue(), configNode));
|
emap.insert(make_pair(objNameNode->getStringValue(), configNode));
|
||||||
}
|
}
|
||||||
configNode->removeChild("default");
|
configNode->removeChild("default");
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <boost/tuple/tuple_comparison.hpp>
|
#include <boost/tuple/tuple_comparison.hpp>
|
||||||
|
|
||||||
#include <osg/Geode>
|
#include <osg/Geode>
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
|
|
||||||
#include <osg/Geode>
|
#include <osg/Geode>
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
@ -242,7 +241,7 @@ public:
|
|||||||
|
|
||||||
void makeFace(const ElementVec& elements, double hpos, const osg::Matrix& xform)
|
void makeFace(const ElementVec& elements, double hpos, const osg::Matrix& xform)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(element_info* element, elements) {
|
for (auto element : elements) {
|
||||||
GlyphGeometry* gg = getGeometry(element->material->get_effect());
|
GlyphGeometry* gg = getGeometry(element->material->get_effect());
|
||||||
gg->addGlyph(element->glyph, hpos, grounddist, element->abswidth, element->height, xform);
|
gg->addGlyph(element->glyph, hpos, grounddist, element->abswidth, element->height, xform);
|
||||||
hpos += element->abswidth;
|
hpos += element->abswidth;
|
||||||
@ -541,4 +540,3 @@ void AirportSignBuilder::addSign(const SGGeod& pos, double heading, const std::s
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // of namespace simgear
|
} // of namespace simgear
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
# include <simgear_config.h>
|
# include <simgear_config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/foreach.hpp>
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include "SGBinding.hxx"
|
#include "SGBinding.hxx"
|
||||||
|
|
||||||
@ -132,14 +131,14 @@ SGBinding::fire (double setting) const
|
|||||||
|
|
||||||
void fireBindingList(const SGBindingList& aBindings, SGPropertyNode* params)
|
void fireBindingList(const SGBindingList& aBindings, SGPropertyNode* params)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(SGBinding_ptr b, aBindings) {
|
for (auto b : aBindings) {
|
||||||
b->fire(params);
|
b->fire(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fireBindingListWithOffset(const SGBindingList& aBindings, double offset, double max)
|
void fireBindingListWithOffset(const SGBindingList& aBindings, double offset, double max)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(SGBinding_ptr b, aBindings) {
|
for (auto b : aBindings) {
|
||||||
b->fire(offset, max);
|
b->fire(offset, max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,7 +146,7 @@ void fireBindingListWithOffset(const SGBindingList& aBindings, double offset, do
|
|||||||
SGBindingList readBindingList(const simgear::PropertyList& aNodes, SGPropertyNode* aRoot)
|
SGBindingList readBindingList(const simgear::PropertyList& aNodes, SGPropertyNode* aRoot)
|
||||||
{
|
{
|
||||||
SGBindingList result;
|
SGBindingList result;
|
||||||
BOOST_FOREACH(SGPropertyNode* node, aNodes) {
|
for (auto node : aNodes) {
|
||||||
result.push_back(new SGBinding(node, aRoot));
|
result.push_back(new SGBinding(node, aRoot));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +155,7 @@ SGBindingList readBindingList(const simgear::PropertyList& aNodes, SGPropertyNod
|
|||||||
|
|
||||||
void clearBindingList(const SGBindingList& aBindings)
|
void clearBindingList(const SGBindingList& aBindings)
|
||||||
{
|
{
|
||||||
BOOST_FOREACH(SGBinding_ptr b, aBindings) {
|
for (auto b : aBindings) {
|
||||||
b->clear();
|
b->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,7 +166,7 @@ bool anyBindingEnabled(const SGBindingList& aBindings)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_FOREACH(SGBinding_ptr b, aBindings) {
|
for (auto b : aBindings) {
|
||||||
if (b->test()) {
|
if (b->test()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -175,4 +174,3 @@ bool anyBindingEnabled(const SGBindingList& aBindings)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user