| 1231 | } |
| 1232 | |
| 1233 | IfcBound3D IfcGeometryLoader::GetBound(uint32_t expressID) const |
| 1234 | { |
| 1235 | spdlog::debug("[GetBound({})]", expressID); |
| 1236 | auto lineType = _loader.GetLineType(expressID); |
| 1237 | |
| 1238 | switch (lineType) |
| 1239 | { |
| 1240 | case schema::IFCFACEOUTERBOUND: |
| 1241 | { |
| 1242 | _loader.MoveToArgumentOffset(expressID, 0); |
| 1243 | uint32_t loop = _loader.GetRefArgument(); |
| 1244 | _loader.MoveToArgumentOffset(expressID, 1); |
| 1245 | std::string_view orientValue = _loader.GetStringArgument(); |
| 1246 | bool orient = orientValue == "T"; |
| 1247 | |
| 1248 | IfcBound3D bound; |
| 1249 | bound.curve = GetLoop(loop); |
| 1250 | bound.orientation = orient; |
| 1251 | bound.type = IfcBoundType::OUTERBOUND; |
| 1252 | |
| 1253 | if (!orient) |
| 1254 | { |
| 1255 | std::reverse(bound.curve.points.begin(), bound.curve.points.end()); |
| 1256 | } |
| 1257 | |
| 1258 | return bound; |
| 1259 | } |
| 1260 | case schema::IFCFACEBOUND: |
| 1261 | { |
| 1262 | _loader.MoveToArgumentOffset(expressID, 0); |
| 1263 | uint32_t loop = _loader.GetRefArgument(); |
| 1264 | _loader.MoveToArgumentOffset(expressID, 1); |
| 1265 | std::string_view orientValue = _loader.GetStringArgument(); |
| 1266 | bool orient = orientValue == "T"; |
| 1267 | |
| 1268 | IfcBound3D bound; |
| 1269 | bound.curve = GetLoop(loop); |
| 1270 | bound.orientation = orient; |
| 1271 | bound.type = IfcBoundType::BOUND; |
| 1272 | |
| 1273 | if (!orient) |
| 1274 | { |
| 1275 | std::reverse(bound.curve.points.begin(), bound.curve.points.end()); |
| 1276 | } |
| 1277 | |
| 1278 | return bound; |
| 1279 | } |
| 1280 | default: |
| 1281 | spdlog::error("[(GetBounds)] unexpected bound type {}", expressID, lineType); |
| 1282 | break; |
| 1283 | } |
| 1284 | |
| 1285 | return IfcBound3D(); |
| 1286 | } |
| 1287 | |
| 1288 | IfcCurve IfcGeometryLoader::GetLoop(uint32_t expressID) const |
| 1289 | { |
no test coverage detected