Track time; fixes for wall connectivity check

This commit is contained in:
Thomas Krijnen
2020-01-29 14:57:49 +01:00
parent e448312d41
commit b91a34c8c6
7 changed files with 225 additions and 38 deletions
+10
View File
@@ -44,11 +44,16 @@ ifcopenshell::geometry::NativeElement* ifcopenshell::geometry::Converter::create
}
*/
std::clock_t map_start = std::clock();
// @todo how to combine product_node and rep_item?
auto product_node = (taxonomy::geom_item*) mapping_->map(product);
if (product_node == nullptr) {
return nullptr;
}
std::clock_t geom_start = std::clock();
auto place = taxonomy::matrix4();
std::swap(place, product_node->matrix);
@@ -57,6 +62,11 @@ ifcopenshell::geometry::NativeElement* ifcopenshell::geometry::Converter::create
shape = new ifcopenshell::geometry::Representation::BRep(s, representation_id_builder.str(), shapes);
std::clock_t geom_end = std::clock();
total_map_time += (geom_start - map_start) / (double) CLOCKS_PER_SEC;
total_geom_time += (geom_end - geom_start) / (double) CLOCKS_PER_SEC;
return new NativeElement(
product->data().id(),
parent_id,
+8
View File
@@ -76,10 +76,18 @@ namespace ifcopenshell { namespace geometry {
}
*/
double total_map_time = 0.;
double total_geom_time = 0.;
ifcopenshell::geometry::ConversionResults convert(IfcUtil::IfcBaseClass* item) {
std::clock_t map_start = std::clock();
auto geom_item = mapping_->map(item);
std::clock_t geom_start = std::clock();
ifcopenshell::geometry::ConversionResults results;
kernel_->convert(geom_item, results);
std::clock_t geom_end = std::clock();
total_map_time += (geom_start - map_start) / (double) CLOCKS_PER_SEC;
total_geom_time += (geom_end - geom_start) / (double) CLOCKS_PER_SEC;
return results;
}