diff --git a/src/ifcconvert/ColladaSerializer.cpp b/src/ifcconvert/ColladaSerializer.cpp index 0596829b42..827ee924c4 100644 --- a/src/ifcconvert/ColladaSerializer.cpp +++ b/src/ifcconvert/ColladaSerializer.cpp @@ -225,7 +225,7 @@ void ColladaSerializer::ColladaExporter::ColladaScene::add( node.addMatrix(matrix_array); COLLADASW::InstanceGeometry instanceGeometry(mSW); instanceGeometry.setUrl ("#" + geom_name); - foreach(std::string material_name, material_ids) { + BOOST_FOREACH(std::string material_name, material_ids) { /// @todo This is done 6 times in this file, try to perform this once and be done with the material naming for the export. collada_id(material_name); COLLADASW::InstanceMaterial material (material_name, "#" + material_name); @@ -364,7 +364,7 @@ bool ColladaSerializer::ColladaExporter::ColladaMaterials::contains(const IfcGeo void ColladaSerializer::ColladaExporter::ColladaMaterials::write() { effects.close(); - foreach(const IfcGeom::Material& material, materials) { + BOOST_FOREACH(const IfcGeom::Material& material, materials) { std::string material_name = (serializer->settings().get(SerializerSettings::USE_MATERIAL_NAMES) ? material.original_name() : material.name()); std::string material_name_unescaped = material_name; // workaround double-escaping that would occur in addInstanceEffect() @@ -410,7 +410,7 @@ void ColladaSerializer::ColladaExporter::write(const IfcGeom::TriangulationEleme collada_id(representation_id); std::vector material_references; - foreach(const IfcGeom::Material& material, mesh.materials()) { + BOOST_FOREACH(const IfcGeom::Material& material, mesh.materials()) { if (!materials.contains(material)) { materials.add(material); } diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index 65de7f2a30..9fed6f79f5 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -913,7 +913,7 @@ void validate(boost::any& v, const std::vector& values, exclusion_t std::vector setup_filters(const std::vector& filters, const std::string& output_extension) { std::vector filter_funcs; - foreach(const geom_filter& f, filters) { + BOOST_FOREACH(const geom_filter& f, filters) { if (f.type == geom_filter::ENTITY_TYPE) { entity_filter.include = f.include; entity_filter.traverse = f.traverse; diff --git a/src/ifcconvert/XmlSerializer.cpp b/src/ifcconvert/XmlSerializer.cpp index cf1f97cfe8..eb5105dffc 100644 --- a/src/ifcconvert/XmlSerializer.cpp +++ b/src/ifcconvert/XmlSerializer.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "XmlSerializer.h" @@ -340,16 +341,16 @@ void XmlSerializer::finalize() { ptree root, header, units, decomposition, properties, quantities, types, layers, materials; // Write the SPF header as XML nodes. - foreach(const std::string& s, file->header().file_description().description()) { + BOOST_FOREACH(const std::string& s, file->header().file_description().description()) { header.add_child("file_description.description", ptree(s)); } - foreach(const std::string& s, file->header().file_name().author()) { + BOOST_FOREACH(const std::string& s, file->header().file_name().author()) { header.add_child("file_name.author", ptree(s)); } - foreach(const std::string& s, file->header().file_name().organization()) { + BOOST_FOREACH(const std::string& s, file->header().file_name().organization()) { header.add_child("file_name.organization", ptree(s)); } - foreach(const std::string& s, file->header().file_schema().schema_identifiers()) { + BOOST_FOREACH(const std::string& s, file->header().file_schema().schema_identifiers()) { header.add_child("file_schema.schema_identifiers", ptree(s)); } header.put("file_description.implementation_level", file->header().file_description().implementation_level()); diff --git a/src/ifcgeom/IfcGeomFilter.h b/src/ifcgeom/IfcGeomFilter.h index 043de7639a..d766f2b463 100644 --- a/src/ifcgeom/IfcGeomFilter.h +++ b/src/ifcgeom/IfcGeomFilter.h @@ -25,6 +25,7 @@ #include "IfcGeom.h" +#include #include #include #include @@ -87,7 +88,7 @@ namespace IfcGeom void populate(const std::set& patterns) { values.clear(); - foreach(const std::string &pattern, patterns) { + BOOST_FOREACH(const std::string &pattern, patterns) { values.insert(wildcard_string_to_regex(pattern)); } } @@ -96,7 +97,7 @@ namespace IfcGeom static bool match_values(const std::set& values, const std::string &str) { - foreach(const boost::regex& r, values) { + BOOST_FOREACH(const boost::regex& r, values) { if (boost::regex_match(str, r)) { return true; } @@ -108,7 +109,7 @@ namespace IfcGeom { // Escape all non-"*?" regex special chars static const std::string special_chars = "\\^.$|()[]+/"; - foreach(char c, special_chars) { + BOOST_FOREACH(char c, special_chars) { std::string char_str(1, c); boost::replace_all(str, char_str, "\\" + char_str); } @@ -180,7 +181,7 @@ namespace IfcGeom ss << (traverse ? "traverse " : "") << (include ? "include" : "exclude"); std::vector patterns; - foreach(const boost::regex& r, values) { + BOOST_FOREACH(const boost::regex& r, values) { patterns.push_back("\"" + r.str() + "\""); } @@ -237,7 +238,7 @@ namespace IfcGeom std::stringstream ss; ss << (traverse ? "traverse " : "") << (include ? "include" : "exclude") << " layers"; std::vector str_values; - foreach(const boost::regex& r, values) { + BOOST_FOREACH(const boost::regex& r, values) { str_values.push_back(" \"" + r.str() + "\""); } ss << boost::algorithm::join(str_values, " "); @@ -259,7 +260,7 @@ namespace IfcGeom void populate(const std::set& types) { values.clear(); - foreach(const std::string& type, types) { + BOOST_FOREACH(const std::string& type, types) { IfcSchema::Type::Enum ty; try { ty = IfcSchema::Type::FromString(boost::to_upper_copy(type)); @@ -274,7 +275,7 @@ namespace IfcGeom bool match(IfcSchema::IfcProduct* prod) const { // The set is iterated over to able to filter on subtypes. - foreach(IfcSchema::Type::Enum type, values) { + BOOST_FOREACH(IfcSchema::Type::Enum type, values) { if (prod->is(type)) { return true; } @@ -291,7 +292,7 @@ namespace IfcGeom { std::stringstream ss; ss << (traverse ? "traverse " : "") << (include ? "include" : "exclude") << " entities"; - foreach(IfcSchema::Type::Enum type, values) { + BOOST_FOREACH(IfcSchema::Type::Enum type, values) { ss << " " << IfcSchema::Type::ToString(type); } description = ss.str(); diff --git a/src/ifcparse/Argument.h b/src/ifcparse/Argument.h index 69860f4425..ef7787ac52 100644 --- a/src/ifcparse/Argument.h +++ b/src/ifcparse/Argument.h @@ -38,10 +38,6 @@ #include #include -#include - -#define foreach BOOST_FOREACH -#define rforeach BOOST_REVERSE_FOREACH class Argument; class IfcEntityList;