mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 19:54:07 +00:00
Pass around non-static logger instances and programmatic access to messages in-memory
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "../ifcgeom/kernels/cgal/CgalKernel.h"
|
||||
#include "../ifcgeom/IfcGeomFilter.h"
|
||||
#include "../ifcgeom/Iterator.h"
|
||||
#include "../ifcgeom/hybrid_kernel.h"
|
||||
|
||||
#include <CGAL/box_intersection_d.h>
|
||||
#include <CGAL/minkowski_sum_3.h>
|
||||
@@ -445,7 +446,7 @@ struct intersection_validator {
|
||||
|
||||
std::set<const IfcUtil::IfcBaseEntity*> successfully_processed;
|
||||
|
||||
intersection_validator(IfcParse::IfcFile& f, std::initializer_list<std::string> entities, double eps, bool no_progress, bool quiet, bool stderr_progress) {
|
||||
intersection_validator(IfcParse::IfcFile& 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;
|
||||
@@ -459,7 +460,7 @@ struct intersection_validator {
|
||||
IfcGeom::entity_filter(true, false, entities)
|
||||
};
|
||||
|
||||
IfcGeom::Iterator context_iterator("cgal", settings, &f, spaces_and_walls, 1);
|
||||
IfcGeom::Iterator context_iterator(ifcopenshell::geometry::kernels::construct(&f, "cgal", settings, logger), settings, &f, spaces_and_walls, 1, logger);
|
||||
|
||||
if (!context_iterator.initialize()) {
|
||||
return;
|
||||
@@ -562,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.ProgressBar(progress);
|
||||
old_progress = progress;
|
||||
}
|
||||
}
|
||||
@@ -578,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 ");
|
||||
}
|
||||
|
||||
@@ -599,4 +600,4 @@ struct intersection_validator {
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user