After-merge clean-ups

This commit is contained in:
Thomas Krijnen
2026-07-09 13:30:48 +02:00
parent 7fc2d9a998
commit 561a23cfbc
164 changed files with 1373 additions and 1406 deletions
+56 -56
View File
@@ -219,7 +219,7 @@ bool file_exists(const std::string& filename) {
static std::basic_stringstream<path_t::value_type> log_stream;
void write_log(bool);
void fix_quantities(ifcopenshell::file&, bool, bool, bool, Logger& logger = Logger::Root());
void fix_quantities(ifcopenshell::file&, bool, bool, bool, logger& logger = ::logger::root());
std::string format_duration(time_t start, time_t end);
/// @todo make the filters non-global
@@ -249,7 +249,7 @@ size_t read_filters_from_file(const std::string&, inclusion_filter&, inclusion_t
void parse_filter(geom_filter &, const std::vector<std::string>&);
std::vector<ifcopenshell::geometry::filter_t> setup_filters(const std::vector<geom_filter>&, const std::string&);
bool init_input_file(const std::string& filename, ifcopenshell::file*& ifc_file, bool no_progress, bool mmap, bool bypass_properties=false, Logger& logger = Logger::Root());
bool init_input_file(const std::string& filename, ifcopenshell::file*& ifc_file, bool no_progress, bool mmap, bool bypass_properties=false, logger& logger = ::logger::root());
// from https://stackoverflow.com/questions/31696328/boost-program-options-using-zero-parameter-options-multiple-times
struct verbosity_counter {
@@ -271,7 +271,7 @@ int main(int argc, char** argv) {
typedef po::command_line_parser command_line_parser;
typedef char char_t;
#endif
Logger logger;
logger logger;
inclusion_filter include_filter;
inclusion_traverse_filter include_traverse_filter;
@@ -464,15 +464,15 @@ int main(int argc, char** argv) {
if (num_threads <= 0) {
num_threads = std::thread::hardware_concurrency();
logger.Notice("SYS", 7, "Using " + std::to_string(num_threads) + " threads");
logger.notice("SYS", 7, "Using " + std::to_string(num_threads) + " threads");
}
if (vmap.count("log-format") == 1) {
boost::to_lower(log_format);
if (log_format == "plain") {
logger.OutputFormat(Logger::FMT_PLAIN);
logger.output_format(::logger::FMT_PLAIN);
} else if (log_format == "json") {
logger.OutputFormat(Logger::FMT_JSON);
logger.output_format(::logger::FMT_JSON);
} else {
cerr_ << "[error] --log-format should be either plain or json" << std::endl;
print_usage();
@@ -483,7 +483,7 @@ int main(int argc, char** argv) {
if (!filter_filename.empty()) {
size_t num_filters = read_filters_from_file(ifcopenshell::path::to_utf8(filter_filename), include_filter, include_traverse_filter, exclude_filter, exclude_traverse_filter);
if (num_filters) {
logger.Notice("SYS", 8, boost::lexical_cast<std::string>(num_filters) + " filters read from specifified file.");
logger.notice("SYS", 8, boost::lexical_cast<std::string>(num_filters) + " filters read from specifified file.");
} else {
cerr_ << "[error] No filters read from specifified file.\n";
return EXIT_FAILURE;
@@ -547,27 +547,27 @@ int main(int argc, char** argv) {
if (vmap.count("log-file")) {
log_fs.open(log_file.c_str(), std::ios::app);
logger.SetOutput(quiet ? nullptr : &cout_, &log_fs);
logger.set_output(quiet ? nullptr : &cout_, &log_fs);
} else {
logger.SetOutput(quiet ? nullptr : &cout_, vcounter.count > 1 ? &cout_ : &log_stream);
logger.set_output(quiet ? nullptr : &cout_, vcounter.count > 1 ? &cout_ : &log_stream);
}
switch (vcounter.count) {
case 0:
logger.Verbosity(Logger::LOG_ERROR);
logger.verbosity(::logger::LOG_ERROR);
break;
case 1:
logger.Verbosity(Logger::LOG_NOTICE);
logger.verbosity(::logger::LOG_NOTICE);
break;
case 2:
logger.Verbosity(Logger::LOG_DEBUG);
logger.verbosity(::logger::LOG_DEBUG);
break;
case 3:
logger.Verbosity(Logger::LOG_PERF);
logger.verbosity(::logger::LOG_PERF);
break;
case 4:
logger.Verbosity(Logger::LOG_PERF);
logger.PrintPerformanceStatsOnElement(true);
logger.verbosity(::logger::LOG_PERF);
logger.print_performance_stats_on_element(true);
break;
}
@@ -637,7 +637,7 @@ int main(int argc, char** argv) {
exit_code = EXIT_SUCCESS;
}
} catch (const std::exception& e) {
logger.Error("SYS", 9, e);
logger.error("SYS", 9, e);
}
write_log(!quiet);
return exit_code;
@@ -660,13 +660,13 @@ int main(int argc, char** argv) {
fs << *ifc_file;
exit_code = EXIT_SUCCESS;
} else {
logger.Error("SYS", 10, "Unable to open output file for writing");
logger.error("SYS", 10, "Unable to open output file for writing");
}
time(&end);
logger.Status("Done! Writing IFC took " + format_duration(start, end));
logger.status("Done! Writing IFC took " + format_duration(start, end));
}
} catch (const std::exception& e) {
logger.Error("SYS", 11, e);
logger.error("SYS", 11, e);
}
write_log(!quiet);
return exit_code;
@@ -699,9 +699,9 @@ int main(int argc, char** argv) {
return EXIT_FAILURE;
}
if (!entity_filter.entity_names.empty()) { entity_filter.update_description(); logger.Notice("SYS", 13, entity_filter.description); }
if (!layer_filter.values.empty()) { layer_filter.update_description(); logger.Notice("SYS", 14, layer_filter.description); }
if (!attribute_filter.attribute_name.empty()) { attribute_filter.update_description(); logger.Notice("SYS", 15, attribute_filter.description); }
if (!entity_filter.entity_names.empty()) { entity_filter.update_description(); logger.notice("SYS", 13, entity_filter.description); }
if (!layer_filter.values.empty()) { layer_filter.update_description(); logger.notice("SYS", 14, layer_filter.description); }
if (!attribute_filter.attribute_name.empty()) { attribute_filter.update_description(); logger.notice("SYS", 15, attribute_filter.description); }
if (geometry_serializer_info && geometry_serializer_info->requires_ascii_temp_file) {
// These serializers do not support opening unicode paths. Therefore
@@ -767,13 +767,13 @@ int main(int argc, char** argv) {
const bool is_tesselated = serializer->isTesselated(); // isTesselated() doesn't change at run-time
if (!is_tesselated) {
if (geometry_settings.get<ifcopenshell::geometry::settings::WeldVertices>().get()) {
logger.Notice("SYS", 16, "Weld vertices setting ignored when writing non-tesselated output");
logger.notice("SYS", 16, "Weld vertices setting ignored when writing non-tesselated output");
}
if (geometry_settings.get<ifcopenshell::geometry::settings::GenerateUvs>().get()) {
logger.Notice("SYS", 17, "Generate UVs setting ignored when writing non-tesselated output");
logger.notice("SYS", 17, "Generate UVs setting ignored when writing non-tesselated output");
}
if (center_model || center_model_geometry) {
logger.Notice("SYS", 18, "Centering/offsetting model setting ignored when writing non-tesselated output");
logger.notice("SYS", 18, "Centering/offsetting model setting ignored when writing non-tesselated output");
}
geometry_settings.get<ifcopenshell::geometry::settings::IteratorOutput>().value = ifcopenshell::geometry::settings::NATIVE;
@@ -799,9 +799,9 @@ int main(int argc, char** argv) {
}
if (vmap.count("log-file")) {
logger.SetOutput(quiet ? nullptr : &cout_, &log_fs);
logger.set_output(quiet ? nullptr : &cout_, &log_fs);
} else {
logger.SetOutput(quiet ? nullptr : &cout_, vcounter.count > 1 ? &cout_ : &log_stream);
logger.set_output(quiet ? nullptr : &cout_, vcounter.count > 1 ? &cout_ : &log_stream);
}
if (model_rotation) {
@@ -816,13 +816,13 @@ int main(int argc, char** argv) {
std::stringstream msg;
msg << "Using model rotation (" << rotation[0] << "," << rotation[1] << "," << rotation[2] << "," << rotation[3] << ")";
logger.Notice("SYS", 19, msg.str());
logger.notice("SYS", 19, msg.str());
geometry_settings.get<ifcopenshell::geometry::settings::ModelRotation>().value = rotation;
}
if (model_offset && (center_model || center_model_geometry)) {
logger.Notice("GEO", 22, "--model-offset ignored with --center-model or --center-model-geometry");
logger.notice("GEO", 22, "--model-offset ignored with --center-model or --center-model-geometry");
}
if (model_offset && !(center_model || center_model_geometry)) {
@@ -837,7 +837,7 @@ int main(int argc, char** argv) {
std::stringstream msg;
msg << std::setprecision(std::numeric_limits<double>::max_digits10) << "Using model offset (" << offset[0] << "," << offset[1] << "," << offset[2] << ")";
logger.Notice("SYS", 20, msg.str());
logger.notice("SYS", 20, msg.str());
geometry_settings.get<ifcopenshell::geometry::settings::ModelOffset>().value = offset;
}
@@ -845,17 +845,17 @@ int main(int argc, char** argv) {
if (is_tesselated && (center_model || center_model_geometry)) {
std::vector<double> offset(3);
IfcGeom::Iterator tmp_context_iterator(ifcopenshell::geometry::kernels::construct(ifc_file, geometry_kernel, geometry_settings, logger), geometry_settings, ifc_file, filter_funcs, num_threads, logger);
IfcGeom::Iterator tmp_context_iterator(ifcopenshell::geometry::kernels::construct(ifc_file, geometry_kernel, geometry_settings), geometry_settings, ifc_file, filter_funcs, num_threads, logger);
time_t start, end;
time(&start);
if (!quiet) logger.Status("Computing bounds...");
if (!quiet) logger.status("Computing bounds...");
if (center_model_geometry) {
if (!tmp_context_iterator.initialize()) {
/// @todo It would be nice to know and print separate error prints for a case where we found no entities
/// and for a case we found no entities that satisfy our filtering criteria.
logger.Notice("GEO", 23, "No geometrical elements found or none successfully converted");
logger.notice("GEO", 23, "No geometrical elements found or none successfully converted");
serializer.reset();
ifcopenshell::path::delete_file(ifcopenshell::path::to_utf8(output_temp_filename));
write_log(!quiet);
@@ -866,7 +866,7 @@ int main(int argc, char** argv) {
tmp_context_iterator.compute_bounds(center_model_geometry);
time(&end);
if (!quiet) logger.Status("Done ! Bounds computed in " + format_duration(start, end));
if (!quiet) logger.status("Done ! Bounds computed in " + format_duration(start, end));
auto center = (tmp_context_iterator.bounds_min().ccomponents() + tmp_context_iterator.bounds_max().ccomponents()) * 0.5;
offset[0] = -center(0);
@@ -875,7 +875,7 @@ int main(int argc, char** argv) {
std::stringstream msg;
msg << std::setprecision (std::numeric_limits<double>::max_digits10) << "Using model offset (" << offset[0] << "," << offset[1] << "," << offset[2] << ")";
logger.Notice("SYS", 21, msg.str());
logger.notice("SYS", 21, msg.str());
geometry_settings.get<ifcopenshell::geometry::settings::ModelOffset>().value = offset;
}
@@ -891,15 +891,15 @@ int main(int argc, char** argv) {
std::unique_ptr<IfcGeom::Iterator> context_iterator;
if (!elems_from_adaptor) {
context_iterator.reset(new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(ifc_file, geometry_kernel, geometry_settings, logger), geometry_settings, ifc_file, filter_funcs, num_threads, logger));
context_iterator.reset(new IfcGeom::Iterator(ifcopenshell::geometry::kernels::construct(ifc_file, geometry_kernel, geometry_settings), geometry_settings, ifc_file, filter_funcs, num_threads, logger));
}
logger.message(logger::LOG_PERF, "file geometry conversion");
logger.message(::logger::LOG_PERF, "file geometry conversion");
if (context_iterator && !context_iterator->initialize()) {
/// @todo It would be nice to know and print separate error prints for a case where we found no entities
/// and for a case we found no entities that satisfy our filtering criteria.
logger.Notice("GEO", 25, "No geometrical elements found or none successfully converted");
logger.notice("GEO", 25, "No geometrical elements found or none successfully converted");
serializer.reset();
ifcopenshell::path::delete_file(ifcopenshell::path::to_utf8(output_temp_filename));
write_log(!quiet);
@@ -919,7 +919,7 @@ int main(int argc, char** argv) {
int old_progress = quiet ? 0 : -1;
if (!quiet) {
logger.Status("Creating geometry...");
logger.status("Creating geometry...");
}
// The functions IfcGeom::Iterator::get() and IfcGeom::Iterator::next()
@@ -964,10 +964,10 @@ int main(int argc, char** argv) {
if (stderr_progress)
cerr_ << std::flush;
} else if (vcounter.count == 2) {
logger.Message(Logger::LOG_DEBUG, "SYS", 23, "Progress " + boost::lexical_cast<std::string>(progress));
logger.message(::logger::LOG_DEBUG, "SYS", 23, "Progress " + boost::lexical_cast<std::string>(progress));
} else {
progress = progress / 2;
if (old_progress != progress) logger.ProgressBar(progress);
if (old_progress != progress) logger.progress_bar(progress);
old_progress = progress;
}
}
@@ -996,7 +996,7 @@ int main(int argc, char** argv) {
}
} else {
const std::string task = ((num_threads == 1) ? "creating" : "writing");
logger.Status("\rDone " + task + " geometry (" + boost::lexical_cast<std::string>(num_created) +
logger.status("\rDone " + task + " geometry (" + boost::lexical_cast<std::string>(num_created) +
" objects) ");
}
@@ -1004,7 +1004,7 @@ int main(int argc, char** argv) {
// Make sure the dtor is explicitly run here (e.g. output files are closed before renaming them).
serializer.reset();
logger.Message(Logger::LOG_PERF, "GEO", 26, "done file geometry conversion");
logger.message(::logger::LOG_PERF, "GEO", 26, "done file geometry conversion");
bool successful;
if (geometry_serializer_info->writes_final_output) {
@@ -1022,13 +1022,13 @@ int main(int argc, char** argv) {
output_temp_filename << "' for the conversion result.";
}
if (geometry_settings.get<ifcopenshell::geometry::settings::ValidateQuantities>().get() && logger.MaxSeverity() >= Logger::LOG_ERROR) {
logger.Error("SYS", 24, "Errors encountered during processing.");
if (geometry_settings.get<ifcopenshell::geometry::settings::ValidateQuantities>().get() && logger.max_severity() >= ::logger::LOG_ERROR) {
logger.error("SYS", 24, "Errors encountered during processing.");
successful = false;
}
if (logger.Verbosity() == Logger::LOG_PERF) {
logger.PrintPerformanceStats();
if (logger.verbosity() == ::logger::LOG_PERF) {
logger.print_performance_stats();
}
write_log(!quiet);
@@ -1036,7 +1036,7 @@ int main(int argc, char** argv) {
time(&end);
if (!quiet) {
logger.Status("\nConversion took " + format_duration(start, end));
logger.status("\nConversion took " + format_duration(start, end));
}
return successful ? EXIT_SUCCESS : EXIT_FAILURE;
@@ -1074,7 +1074,7 @@ void write_log(bool header) {
#include <boost/algorithm/string/predicate.hpp>
bool init_input_file(const std::string& filename, ifcopenshell::file*& ifc_file, bool no_progress, bool mmap, bool bypass_properties, Logger& logger) {
bool init_input_file(const std::string& filename, ifcopenshell::file*& ifc_file, bool no_progress, bool mmap, bool bypass_properties, logger& logger) {
time_t start, end;
// Prevent file::Init() prints by setting output to null temporarily
@@ -1111,13 +1111,13 @@ bool init_input_file(const std::string& filename, ifcopenshell::file*& ifc_file,
}
if (!ifc_file || !ifc_file->good()) {
logger.Error("SYN", 1, "Unable to parse input file '" + filename + "'");
logger.error("SYN", 1, "Unable to parse input file '" + filename + "'");
return false;
}
time(&end);
if (no_progress) { logger.SetOutput(&cout_, &log_stream); }
else { logger.Status("Parsing input file took " + format_duration(start, end)); }
if (no_progress) { logger.set_output(&cout_, &log_stream); }
else { logger.status("Parsing input file took " + format_duration(start, end)); }
return true;
@@ -1330,7 +1330,7 @@ namespace latebound_access {
}
}
void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, Logger& logger) {
void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, logger& logger) {
{
auto delete_reversed = [&f](const std::vector<express::Base>& insts) {
// Lists are traversed back to front as the list may be mutated when
@@ -1381,7 +1381,7 @@ void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool st
settings.get<ifcopenshell::geometry::settings::ConvertBackUnits>().value = true;
settings.get<ifcopenshell::geometry::settings::IteratorOutput>().value = ifcopenshell::geometry::settings::NATIVE;
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "opencascade", settings, logger), settings, &f, {}, 1, logger);
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "opencascade", settings), settings, &f, {}, 1, logger);
if (!context_iterator.initialize()) {
return;
@@ -1508,7 +1508,7 @@ void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool st
cerr_ << std::flush;
} else {
const int progress = context_iterator.progress() / 2;
if (old_progress != progress) logger.ProgressBar(progress);
if (old_progress != progress) logger.progress_bar(progress);
old_progress = progress;
}
}
@@ -1524,7 +1524,7 @@ void fix_quantities(ifcopenshell::file& f, bool no_progress, bool quiet, bool st
if (stderr_progress)
cerr_ << std::flush;
} else {
logger.Status("\rDone writing quantities for " + boost::lexical_cast<std::string>(num_created) +
logger.status("\rDone writing quantities for " + boost::lexical_cast<std::string>(num_created) +
" objects ");
}
+5 -5
View File
@@ -18,7 +18,7 @@ typedef CGAL::AABB_traits<Kernel_, Primitive> Traits;
typedef CGAL::AABB_tree<Traits> Tree;
typedef Tree::Point_and_primitive_id Point_and_primitive_id;
void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, Logger& logger = Logger::Root()) {
void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, logger& logger = ::logger::root()) {
intersection_validator v(f, { "IfcWall", "IfcSpace", "IfcSlab", "IfcCovering" }, 1.e-5, no_progress, quiet, stderr_progress, logger);
auto rels = f.instances_by_type("IfcRelSpaceBoundary");
@@ -54,7 +54,7 @@ void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bo
settings.get<ifcopenshell::geometry::settings::IteratorOutput>().value = ifcopenshell::geometry::settings::NATIVE;
settings.get<ifcopenshell::geometry::settings::DisableOpeningSubtractions>().value = true;
ifcopenshell::geometry::Converter c(ifcopenshell::geometry::kernels::construct(&f2, "cgal", settings, logger), &f2, settings, logger);
ifcopenshell::geometry::Converter c(ifcopenshell::geometry::kernels::construct(&f2, "cgal", settings), &f2, settings, logger);
std::map<std::set<std::string>, std::vector<Kernel_::Point_3>> elem_to_space_boundary_coords;
@@ -128,7 +128,7 @@ void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bo
auto itelem = elem_to_space_boundary_coords.find({ Aguid, Bguid });
if (itelem == elem_to_space_boundary_coords.end()) {
logger.Error("VAL", 1, "Missing space boundary relationship " + Aguid + " " + Bguid);
logger.error("VAL", 1, "Missing space boundary relationship " + Aguid + " " + Bguid);
return;
}
@@ -141,7 +141,7 @@ void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bo
bool valid = *std::max_element(distances.begin(), distances.end()) < 0.4;
if (!valid) {
logger.Error("VAL", 2, "Wrong connection geometry " + Aguid + " " + Bguid);
logger.error("VAL", 2, "Wrong connection geometry " + Aguid + " " + Bguid);
}
/*{
@@ -178,7 +178,7 @@ void fix_spaceboundaries(ifcopenshell::file& f, bool no_progress, bool quiet, bo
auto g1 = n.substr(0, 22);
auto g2 = n.substr(23);
if (is_wall_space_or_slab(g1) && is_wall_space_or_slab(g2) && guid_pairs_visited.find({ g1, g2 }) == guid_pairs_visited.end()) {
logger.Error("VAL", 3, "Space boundary for non-bounding geometry " + g1 + " " + g2);
logger.error("VAL", 3, "Space boundary for non-bounding geometry " + g1 + " " + g2);
}
}
}
@@ -9,7 +9,7 @@
#include <algorithm>
void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, Logger& logger = Logger::Root()) {
void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, logger& logger = ::logger::root()) {
ifcopenshell::geometry::Settings settings;
settings.get<ifcopenshell::geometry::settings::UseWorldCoords>().value = false;
@@ -23,7 +23,7 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
IfcGeom::entity_filter(false, false, {"IfcOpeningElement", "IfcSpace"})
};
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings, logger), settings, &f, no_openings_and_spaces, 1, logger);
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings), settings, &f, no_openings_and_spaces, 1, logger);
auto get_elevation = [](const ifcopenshell::IfcBaseClass* a) {
return ((const ifcopenshell::IfcBaseEntity*)a)->get_value<double>("Elevation", 0.);
@@ -198,7 +198,7 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
auto s = geom_object->product()->get_value<std::string>("GlobalId");
auto s1 = ((IfcUtil::IfcBaseEntity*)storeys_sorted[calc_idx])->get_value<std::string>("GlobalId");
auto s2 = ((IfcUtil::IfcBaseEntity*)elem_to_storey[geom_object->product()])->get_value<std::string>("GlobalId");
logger.Error("VAL", 4, "Element " + s + " contained in " + s2 + " located on " + s1);
logger.error("VAL", 4, "Element " + s + " contained in " + s2 + " located on " + s1);
}
if (!no_progress) {
@@ -214,7 +214,7 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
std::cerr << std::flush;
} else {
const int progress = context_iterator.progress() / 2;
if (old_progress != progress) logger.ProgressBar(progress);
if (old_progress != progress) logger.progress_bar(progress);
old_progress = progress;
}
}
@@ -230,7 +230,7 @@ void fix_storeycontainment(ifcopenshell::file& f, bool no_progress, bool quiet,
if (stderr_progress)
std::cerr << std::flush;
} else {
logger.Status("\rDone fixing space boundaries for " + boost::lexical_cast<std::string>(num_created) +
logger.status("\rDone fixing space boundaries for " + boost::lexical_cast<std::string>(num_created) +
" objects ");
}
}
@@ -9,7 +9,7 @@
using namespace ifcopenshell::geometry;
void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, Logger& logger = Logger::Root()) {
void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, bool stderr_progress, logger& logger = ::logger::root()) {
intersection_validator v(f, { "IfcWall" }, 1.e-3, no_progress, quiet, stderr_progress, logger);
ifcopenshell::geometry::Settings settings;
@@ -24,7 +24,7 @@ void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, b
settings.get<ifcopenshell::geometry::settings::IncludeCurves>().value = true;
settings.get<ifcopenshell::geometry::settings::IncludeSurfaces>().value = false;
ifcopenshell::geometry::Converter c(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings, logger), &f, settings, logger);
ifcopenshell::geometry::Converter c(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings), &f, settings, logger);
auto rels = f.instances_by_type("IfcRelConnectsPathElements");
std::map<std::set<const ifcopenshell::IfcBaseClass*>, const ifcopenshell::IfcBaseClass*> rel_by_elem;
@@ -169,11 +169,11 @@ void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, b
if (a_type != atype_computed || b_type != btype_computed) {
if (rel) {
logger.Error("VAL", 5, std::string("Connection type ") + atype_computed + " " + btype_computed + " for:", rel);
logger.error("VAL", 5, std::string("Connection type ") + atype_computed + " " + btype_computed + " for:", rel);
} else {
auto A_str = A->get_value<std::string>("GlobalId");
auto B_str = B->get_value<std::string>("GlobalId");
logger.Error("VAL", 6, "No connection for adjacent " + A_str + " " + B_str);
logger.error("VAL", 6, "No connection for adjacent " + A_str + " " + B_str);
}
}
});
@@ -183,7 +183,7 @@ void fix_wallconnectivity(ifcopenshell::file& f, bool no_progress, bool quiet, b
auto x = (ifcopenshell::IfcBaseEntity*)((ifcopenshell::IfcBaseEntity*)rel)->get_value<ifcopenshell::IfcBaseClass*>("RelatingElement");
auto y = (ifcopenshell::IfcBaseEntity*)((ifcopenshell::IfcBaseEntity*)rel)->get_value<ifcopenshell::IfcBaseClass*>("RelatedElement");
if (v.successfully_processed.find(x) != v.successfully_processed.end() && v.successfully_processed.find(y) != v.successfully_processed.end()) {
logger.Error("VAL", 7, "Connection for non-adjacent walls", rel);
logger.error("VAL", 7, "Connection for non-adjacent walls", rel);
}
}
});
+4 -4
View File
@@ -446,7 +446,7 @@ struct intersection_validator {
std::set<const ifcopenshell::IfcBaseEntity*> successfully_processed;
intersection_validator(ifcopenshell::file& f, std::initializer_list<std::string> entities, double eps, bool no_progress, bool quiet, bool stderr_progress, Logger& logger = Logger::Root()) {
intersection_validator(ifcopenshell::file& f, std::initializer_list<std::string> entities, double eps, bool no_progress, bool quiet, bool stderr_progress, logger& logger = ::logger::root()) {
ifcopenshell::geometry::Settings settings;
settings.get<ifcopenshell::geometry::settings::UseWorldCoords>().value = false;
@@ -460,7 +460,7 @@ struct intersection_validator {
IfcGeom::entity_filter(true, false, entities)
};
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings, logger), settings, &f, spaces_and_walls, 1, logger);
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings), settings, &f, spaces_and_walls, 1, logger);
if (!context_iterator.initialize()) {
return;
@@ -563,7 +563,7 @@ struct intersection_validator {
std::cerr << std::flush;
} else {
const int progress = context_iterator.progress() / 2;
if (old_progress != progress) logger.ProgressBar(progress);
if (old_progress != progress) logger.progress_bar(progress);
old_progress = progress;
}
}
@@ -579,7 +579,7 @@ struct intersection_validator {
if (stderr_progress)
std::cerr << std::flush;
} else {
logger.Status("\rDone fixing space boundaries for " + boost::lexical_cast<std::string>(num_created) +
logger.status("\rDone fixing space boundaries for " + boost::lexical_cast<std::string>(num_created) +
" objects ");
}