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
@@ -21,30 +21,30 @@
#define mapping POSTFIX_SCHEMA(mapping)
using namespace ifcopenshell::geometry;
taxonomy::item* mapping::map_impl(const IfcSchema::IfcCartesianTransformationOperator3D* inst) {
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCartesianTransformationOperator3D* inst) {
Eigen::Vector4d origin;
Eigen::Vector4d axis1(1., 0., 0., 0.);
Eigen::Vector4d axis2(0., 1., 0., 0.);
Eigen::Vector4d axis3(0., 0., 1., 0.);
taxonomy::point3 O = as<taxonomy::point3>(map(inst->LocalOrigin()));
origin << *O.components_, 1.0;
taxonomy::point3::ptr O = taxonomy::cast<taxonomy::point3>(map(inst->LocalOrigin()));
origin << *O->components_, 1.0;
if (inst->Axis1()) {
taxonomy::direction3 ax1 = as<taxonomy::direction3>(map(inst->Axis1()));
axis1 << *ax1.components_, 0.0;
taxonomy::direction3::ptr ax1 = taxonomy::cast<taxonomy::direction3>(map(inst->Axis1()));
axis1 << *ax1->components_, 0.0;
}
if (inst->Axis2()) {
taxonomy::direction3 ax2 = as<taxonomy::direction3>(map(inst->Axis2()));
axis2 << *ax2.components_, 0.0;
taxonomy::direction3::ptr ax2 = taxonomy::cast<taxonomy::direction3>(map(inst->Axis2()));
axis2 << *ax2->components_, 0.0;
}
if (inst->Axis3()) {
taxonomy::direction3 ax3 = as<taxonomy::direction3>(map(inst->Axis3()));
axis3 << *ax3.components_, 0.0;
taxonomy::direction3::ptr ax3 = taxonomy::cast<taxonomy::direction3>(map(inst->Axis3()));
axis3 << *ax3->components_, 0.0;
}
auto m4 = new taxonomy::matrix4(origin.head<3>(), axis3.head<3>(), axis1.head<3>());
auto m4 = taxonomy::make<taxonomy::matrix4>(origin.head<3>(), axis3.head<3>(), axis1.head<3>());
if (m4->ccomponents().col(1).dot(axis2) < 0.) {
m4->components().col(1) *= -1.;
}