| 1672 | } |
| 1673 | |
| 1674 | IfcFlatMesh IfcGeometryProcessor::GetFlatMesh(uint32_t expressID, bool applyLinearScalingFactor) |
| 1675 | { |
| 1676 | spdlog::debug("[GetFlatMesh({})]", expressID); |
| 1677 | IfcFlatMesh flatMesh; |
| 1678 | flatMesh.expressID = expressID; |
| 1679 | |
| 1680 | IfcComposedMesh composedMesh = GetMesh(expressID); |
| 1681 | |
| 1682 | glm::dmat4 mat = glm::dmat4(1); |
| 1683 | if (applyLinearScalingFactor) |
| 1684 | { |
| 1685 | mat = glm::scale(glm::dvec3(_cache.GetLinearScalingFactor())); |
| 1686 | } |
| 1687 | |
| 1688 | glm::dvec4 color = glm::dvec4(1, 1, 1, 1); |
| 1689 | bool hasColor = false; |
| 1690 | AddComposedMeshToFlatMesh(flatMesh, composedMesh, _transformation * NormalizeIFC * mat, color, hasColor); |
| 1691 | |
| 1692 | return flatMesh; |
| 1693 | } |
| 1694 | |
| 1695 | /** |
| 1696 | * Extracts all the geometries and their associated colors and transformations from a composed mesh |