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
+7 -5
View File
@@ -21,16 +21,16 @@
#define mapping POSTFIX_SCHEMA(mapping)
using namespace ifcopenshell::geometry;
taxonomy::item* mapping::map_impl(const IfcSchema::IfcFace* inst) {
taxonomy::face* face = new taxonomy::face;
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcFace* inst) {
auto face = taxonomy::make<taxonomy::face>();
auto bounds = inst->Bounds();
for (auto& bound : *bounds) {
if (auto r = map(bound->Bound())) {
if (auto r = taxonomy::cast<taxonomy::loop>(map(bound->Bound()))) {
if (!bound->Orientation()) {
r->reverse();
}
if (bound->declaration().is(IfcSchema::IfcFaceOuterBound::Class())) {
((taxonomy::loop*)r)->external = true;
r->external = true;
/*
// Make a copy in case we need immutability later for e.g. caching
auto s = r->clone();
@@ -43,7 +43,9 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcFace* inst) {
}
}
if (face->children.empty()) {
#ifdef TAXONOMY_USE_NAKED_PTR
delete face;
#endif
return nullptr;
}
return face;
@@ -76,7 +78,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcFace* inst) {
#define mapping POSTFIX_SCHEMA(mapping)
taxonomy::item* mapping::map_impl(const IfcSchema::IfcFace* l, TopoDS_Shape& result) {
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcFace* l, TopoDS_Shape& result) {
IfcSchema::IfcFaceBound::list::ptr bounds = inst->Bounds();
util::face_definition fd;