mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
Mapped item
This commit is contained in:
@@ -1170,3 +1170,23 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcPolyline* inst) {
|
|||||||
|
|
||||||
return polygon_from_points(polygon);
|
return polygon_from_points(polygon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taxonomy::item* mapping::map_impl(const IfcSchema::IfcMappedItem* inst) {
|
||||||
|
IfcSchema::IfcCartesianTransformationOperator* transform = inst->MappingTarget();
|
||||||
|
taxonomy::matrix4 gtrsf = as<taxonomy::matrix4>(map(transform));
|
||||||
|
IfcSchema::IfcRepresentationMap* rmap = inst->MappingSource();
|
||||||
|
IfcSchema::IfcAxis2Placement* placement = rmap->MappingOrigin();
|
||||||
|
taxonomy::matrix4 trsf2 = as<taxonomy::matrix4>(map(placement));
|
||||||
|
gtrsf.components = gtrsf.components * trsf2.components;
|
||||||
|
|
||||||
|
// @todo immutable for caching?
|
||||||
|
// @todo allow for multiple levels of matrix?
|
||||||
|
auto shapes = map(rmap->MappedRepresentation());
|
||||||
|
for (auto& c : ((taxonomy::collection*)shapes)->children) {
|
||||||
|
auto item = ((taxonomy::geom_item*)c);
|
||||||
|
item->matrix.components = gtrsf.components * item->matrix.components;
|
||||||
|
// @todo previously style was also copied.
|
||||||
|
}
|
||||||
|
|
||||||
|
return shapes;
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ BIND(IfcProduct);
|
|||||||
// BIND(IfcShellBasedSurfaceModel);
|
// BIND(IfcShellBasedSurfaceModel);
|
||||||
BIND(IfcFaceBasedSurfaceModel);
|
BIND(IfcFaceBasedSurfaceModel);
|
||||||
BIND(IfcRepresentation);
|
BIND(IfcRepresentation);
|
||||||
// BIND(IfcMappedItem);
|
BIND(IfcMappedItem);
|
||||||
// IfcFacetedBrep included
|
// IfcFacetedBrep included
|
||||||
// IfcAdvancedBrep included
|
// IfcAdvancedBrep included
|
||||||
// IfcFacetedBrepWithVoids included
|
// IfcFacetedBrepWithVoids included
|
||||||
|
|||||||
Reference in New Issue
Block a user