mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Major update: taxonomy shared pointers, collection type safety, work towards hashing
This commit is contained in:
@@ -23,7 +23,7 @@ using namespace ifcopenshell::geometry;
|
||||
|
||||
#include "../profile_helper.h"
|
||||
|
||||
taxonomy::item* mapping::map_impl(const IfcSchema::IfcRectangleHollowProfileDef* inst) {
|
||||
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcRectangleHollowProfileDef* inst) {
|
||||
const double x = inst->XDim() / 2.0f * length_unit_;
|
||||
const double y = inst->YDim() / 2.0f * length_unit_;
|
||||
const double d = inst->WallThickness() * length_unit_;
|
||||
@@ -41,13 +41,13 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcRectangleHollowProfileDef*
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
taxonomy::matrix4 m4;
|
||||
taxonomy::matrix4::ptr m4;
|
||||
bool has_position = true;
|
||||
#ifdef SCHEMA_IfcParameterizedProfileDef_Position_IS_OPTIONAL
|
||||
has_position = !!inst->Position();
|
||||
#endif
|
||||
if (has_position) {
|
||||
m4 = as<taxonomy::matrix4>(map(inst->Position()));
|
||||
m4 = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
|
||||
}
|
||||
|
||||
auto s1 = profile_helper(m4, {
|
||||
@@ -69,7 +69,10 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcRectangleHollowProfileDef*
|
||||
}
|
||||
|
||||
s1->children.push_back(s2->children[0]);
|
||||
|
||||
#ifdef TAXONOMY_USE_NAKED_PTR
|
||||
delete s2;
|
||||
#endif
|
||||
|
||||
return s1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user