Work towards v1.0 data model with encapsulated weak_ptr as basis for instances

This commit is contained in:
Thomas Krijnen
2026-01-04 10:40:02 +01:00
parent f09ca658f1
commit 7098beb819
210 changed files with 28269 additions and 26471 deletions
+6 -6
View File
@@ -23,28 +23,28 @@
using namespace ifcopenshell::geometry;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcAxis2Placement3D* inst) {
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcAxis2Placement3D& inst) {
Eigen::Vector3d o(0, 0, 0), axis(0, 0, 1), refDirection, X(1, 0, 0);
try {
taxonomy::point3::ptr v = taxonomy::cast<taxonomy::point3>(map(inst->Location()));
taxonomy::point3::ptr v = taxonomy::cast<taxonomy::point3>(map(inst.Location()));
o = *v->components_;
} catch (const std::exception&) {
Logger::Warning("Placement with invalid Location:", inst);
}
const bool hasAxis = !!inst->Axis();
const bool hasRef = !!inst->RefDirection();
const bool hasAxis = !!inst.Axis();
const bool hasRef = !!inst.RefDirection();
if (hasAxis != hasRef) {
Logger::Warning("Axis and RefDirection should be specified together", inst);
}
if (hasAxis) {
taxonomy::direction3::ptr v = taxonomy::cast<taxonomy::direction3>(map(inst->Axis()));
taxonomy::direction3::ptr v = taxonomy::cast<taxonomy::direction3>(map(inst.Axis()));
axis = *v->components_;
}
if (hasRef) {
taxonomy::direction3::ptr v = taxonomy::cast<taxonomy::direction3>(map(inst->RefDirection()));
taxonomy::direction3::ptr v = taxonomy::cast<taxonomy::direction3>(map(inst.RefDirection()));
refDirection = *v->components_;
} else {
if (acos(axis.dot(X)) > 1.e-5) {