mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 15:08:51 +00:00
This commit is contained in:
@@ -246,7 +246,13 @@ namespace IfcGeom {
|
|||||||
typedef P Precision;
|
typedef P Precision;
|
||||||
typedef PP PlacementPrecision;
|
typedef PP PlacementPrecision;
|
||||||
|
|
||||||
|
boost::optional<bool> initialization_outcome_;
|
||||||
|
|
||||||
bool initialize() {
|
bool initialize() {
|
||||||
|
if (initialization_outcome_) {
|
||||||
|
return *initialization_outcome_;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initUnits();
|
initUnits();
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
@@ -364,27 +370,25 @@ namespace IfcGeom {
|
|||||||
|
|
||||||
if (representations->size() == 0) {
|
if (representations->size() == 0) {
|
||||||
Logger::Warning("No representations encountered, aborting");
|
Logger::Warning("No representations encountered, aborting");
|
||||||
return false;
|
initialization_outcome_ = false;
|
||||||
}
|
|
||||||
|
|
||||||
representation_iterator = representations->begin();
|
|
||||||
ifcproducts.reset();
|
|
||||||
|
|
||||||
done = 0;
|
|
||||||
total = representations->size();
|
|
||||||
|
|
||||||
if (num_threads_ != 1) {
|
|
||||||
collect();
|
|
||||||
process_concurrently();
|
|
||||||
|
|
||||||
return all_processed_elements_.size();
|
|
||||||
} else {
|
} else {
|
||||||
if (!create()) {
|
representation_iterator = representations->begin();
|
||||||
return false;
|
ifcproducts.reset();
|
||||||
|
|
||||||
|
done = 0;
|
||||||
|
total = representations->size();
|
||||||
|
|
||||||
|
if (num_threads_ != 1) {
|
||||||
|
collect();
|
||||||
|
process_concurrently();
|
||||||
|
|
||||||
|
initialization_outcome_ = !all_processed_elements_.empty();
|
||||||
|
} else {
|
||||||
|
initialization_outcome_ = create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return *initialization_outcome_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void collect() {
|
void collect() {
|
||||||
|
|||||||
Reference in New Issue
Block a user