Close to working executable

This commit is contained in:
Thomas Krijnen
2019-08-18 15:53:26 +02:00
parent 8f88c601c6
commit 94aa7dfab4
7 changed files with 49 additions and 16 deletions
+10 -8
View File
@@ -6,16 +6,18 @@
if (l->declaration().is(IfcSchema::T::Class())) { \
try { \
taxonomy::item* item = map((IfcSchema::T*)l); \
item->instance = l; \
try { \
if (l->as<IfcSchema::IfcRepresentationItem>()) { \
auto style = find_style(l->as<IfcSchema::IfcRepresentationItem>()); \
if (style) { \
((taxonomy::geom_item*)item)->surface_style = as<taxonomy::style>(map(style)); \
if (item != nullptr) { \
item->instance = l; \
try { \
if (l->as<IfcSchema::IfcRepresentationItem>()) { \
auto style = find_style(l->as<IfcSchema::IfcRepresentationItem>()); \
if (style) { \
((taxonomy::geom_item*)item)->surface_style = as<taxonomy::style>(map(style)); \
} \
} \
} catch (const std::exception& e) { \
Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l); \
} \
} catch (const std::exception& e) { \
Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l); \
} \
return item; \
} catch (const std::exception& e) { \
+17 -1
View File
@@ -126,7 +126,6 @@ namespace {
taxonomy::item* mapping::map(const IfcSchema::IfcExtrudedAreaSolid* inst) {
// @todo length unit
return new taxonomy::extrusion(
inst,
as<taxonomy::matrix4>(map(inst->Position())),
as<taxonomy::face>(map(inst->SweptArea())),
as<taxonomy::direction3>(map(inst->ExtrudedDirection())),
@@ -134,6 +133,23 @@ taxonomy::item* mapping::map(const IfcSchema::IfcExtrudedAreaSolid* inst) {
);
}
taxonomy::item* mapping::map(const IfcSchema::IfcRepresentation* inst) {
auto c = new taxonomy::collection();
IfcSchema::IfcRepresentationItem::list::ptr items = inst->Items();
if (items->size()) {
for (IfcSchema::IfcRepresentationItem::list::it it = items->begin(); it != items->end(); ++it) {
if (auto r = map(*it)) {
c->children.push_back(r);
}
}
}
if (c->children.empty()) {
delete c;
return nullptr;
}
return c;
}
taxonomy::item* mapping::map(const IfcSchema::IfcAxis2Placement3D* inst) {
// @todo length unit
return new taxonomy::matrix4();
+1 -1
View File
@@ -26,7 +26,7 @@
// BIND(IfcShellBasedSurfaceModel);
// BIND(IfcFaceBasedSurfaceModel);
// BIND(IfcRepresentation);
BIND(IfcRepresentation);
// BIND(IfcMappedItem);
// IfcFacetedBrep included
// IfcAdvancedBrep included