Major update: taxonomy shared pointers, collection type safety, work towards hashing

This commit is contained in:
Thomas Krijnen
2023-07-27 16:42:06 +08:00
parent 98a73f1646
commit 65a5646bf0
122 changed files with 1669 additions and 1203 deletions
@@ -24,25 +24,25 @@ using namespace ifcopenshell::geometry;
#ifdef SCHEMA_HAS_IfcExtrudedAreaSolidTapered
#define mapping POSTFIX_SCHEMA(mapping)
taxonomy::item* mapping::map_impl(const IfcSchema::IfcExtrudedAreaSolidTapered* inst) {
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcExtrudedAreaSolidTapered* inst) {
const double height = inst->Depth() * length_unit_;
if (height < conv_settings_.getValue(ConversionSettings::GV_PRECISION)) {
Logger::Message(Logger::LOG_ERROR, "Non-positive extrusion height encountered for:", inst);
return nullptr;
}
taxonomy::direction3 dir = as<taxonomy::direction3>(map(inst->ExtrudedDirection()));
Eigen::Affine3d af3d(Eigen::Translation3d(height * dir.ccomponents()));
taxonomy::direction3::ptr dir = taxonomy::cast<taxonomy::direction3>(map(inst->ExtrudedDirection()));
Eigen::Affine3d af3d(Eigen::Translation3d(height * dir->ccomponents()));
Eigen::Matrix4d end_profile = af3d.matrix();
auto loft = new taxonomy::loft;
auto loft = taxonomy::make<taxonomy::loft>();
loft->children = {
map(inst->SweptArea()),
map(inst->EndSweptArea())
taxonomy::cast<taxonomy::face>(map(inst->SweptArea())),
taxonomy::cast<taxonomy::face>(map(inst->EndSweptArea()))
};
auto old = ((taxonomy::geom_item*)loft->children.back())->matrix.ccomponents();
((taxonomy::geom_item*)loft->children.back())->matrix.components() = old * end_profile;
auto old = loft->children.back()->matrix->ccomponents();
loft->children.back()->matrix->components() = old * end_profile;
return loft;