mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 10:59:17 +00:00
Major update: taxonomy shared pointers, collection type safety, work towards hashing
This commit is contained in:
@@ -21,18 +21,20 @@
|
||||
#define mapping POSTFIX_SCHEMA(mapping)
|
||||
using namespace ifcopenshell::geometry;
|
||||
|
||||
taxonomy::item* mapping::map_impl(const IfcSchema::IfcHalfSpaceSolid* inst) {
|
||||
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcHalfSpaceSolid* inst) {
|
||||
IfcSchema::IfcSurface* surface = inst->BaseSurface();
|
||||
if (!surface->declaration().is(IfcSchema::IfcPlane::Class())) {
|
||||
Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface);
|
||||
return nullptr;
|
||||
}
|
||||
auto p = new taxonomy::plane;
|
||||
p->matrix = as<taxonomy::matrix4>(map(((IfcSchema::IfcPlane*)surface)->Position()));
|
||||
auto f = new taxonomy::face;
|
||||
auto p = taxonomy::make<taxonomy::plane>();
|
||||
p->matrix = taxonomy::cast<taxonomy::matrix4>(map(((IfcSchema::IfcPlane*)surface)->Position()));
|
||||
auto f = taxonomy::make<taxonomy::face>();
|
||||
f->orientation.reset(!inst->AgreementFlag());
|
||||
f->basis = p;
|
||||
auto s = new taxonomy::solid;
|
||||
s->children.push_back(f);
|
||||
return s;
|
||||
auto sh = taxonomy::make<taxonomy::shell>();
|
||||
sh->children.push_back(f);
|
||||
auto so = taxonomy::make<taxonomy::solid>();
|
||||
so->children.push_back(sh);
|
||||
return so;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user