From 41d7fb32da295abb987f7260b09b4158caea546e Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 25 Aug 2019 12:00:04 +0200 Subject: [PATCH] Provide collection implementation in abstract_kernel --- src/ifcgeom/kernel_agnostic/AbstractKernel.cpp | 8 ++++++++ src/ifcgeom/kernel_agnostic/AbstractKernel.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp b/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp index ac6db16dfd..10168dfaa8 100644 --- a/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp +++ b/src/ifcgeom/kernel_agnostic/AbstractKernel.cpp @@ -39,6 +39,14 @@ ifcopenshell::geometry::kernels::AbstractKernel* ifcopenshell::geometry::kernels } } +bool ifcopenshell::geometry::kernels::AbstractKernel::convert_impl(const taxonomy::collection* collection, ifcopenshell::geometry::ConversionResults& r) { + auto s = r.size(); + for (auto& c : collection->children) { + convert(c, r); + } + return r.size() > s; +} + //void ifcopenshell::geometry::kernels::AbstractKernel::set_conversion_placement_rel_to(const IfcParse::declaration* type) { // placement_rel_to = type; //} diff --git a/src/ifcgeom/kernel_agnostic/AbstractKernel.h b/src/ifcgeom/kernel_agnostic/AbstractKernel.h index 062b6d2a05..0985b23745 100644 --- a/src/ifcgeom/kernel_agnostic/AbstractKernel.h +++ b/src/ifcgeom/kernel_agnostic/AbstractKernel.h @@ -52,7 +52,7 @@ namespace ifcopenshell { namespace geometry { namespace kernels { virtual bool convert_impl(const taxonomy::extrusion*, ifcopenshell::geometry::ConversionResults&) { throw std::runtime_error("Not implemented"); } virtual bool convert_impl(const taxonomy::node*, ifcopenshell::geometry::ConversionResults&) { throw std::runtime_error("Not implemented"); } virtual bool convert_impl(const taxonomy::colour*, ifcopenshell::geometry::ConversionResults&) { throw std::runtime_error("Not implemented"); } - virtual bool convert_impl(const taxonomy::collection*, ifcopenshell::geometry::ConversionResults&) { throw std::runtime_error("Not implemented"); } + virtual bool convert_impl(const taxonomy::collection*, ifcopenshell::geometry::ConversionResults&); }; AbstractKernel* construct(const std::string& geometry_library, IfcParse::IfcFile*);