mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
Close to working executable
This commit is contained in:
@@ -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) { \
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
// BIND(IfcShellBasedSurfaceModel);
|
||||
// BIND(IfcFaceBasedSurfaceModel);
|
||||
// BIND(IfcRepresentation);
|
||||
BIND(IfcRepresentation);
|
||||
// BIND(IfcMappedItem);
|
||||
// IfcFacetedBrep included
|
||||
// IfcAdvancedBrep included
|
||||
|
||||
Reference in New Issue
Block a user