mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 11:43:53 +00:00
Major update: taxonomy shared pointers, collection type safety, work towards hashing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user