| 356 | } |
| 357 | |
| 358 | std::vector<uint32_t> GetInversePropertyForItem(uint32_t modelID, uint32_t expressID, emscripten::val targetTypes, uint32_t position, bool set) |
| 359 | { |
| 360 | if (!manager.IsModelOpen(modelID)) |
| 361 | return {}; |
| 362 | auto loader = manager.GetIfcLoader(modelID); |
| 363 | std::vector<uint32_t> inverseIDs; |
| 364 | auto expressIDs = GetLineIDsWithType(modelID, targetTypes); |
| 365 | for (auto foundExpressID : expressIDs) |
| 366 | { |
| 367 | loader->MoveToLineArgument(foundExpressID, position); |
| 368 | |
| 369 | webifc::parsing::IfcTokenType t = loader->GetTokenType(); |
| 370 | if (t == webifc::parsing::IfcTokenType::REF) |
| 371 | { |
| 372 | loader->StepBack(); |
| 373 | uint32_t val = loader->GetRefArgument(); |
| 374 | if (val == expressID) |
| 375 | { |
| 376 | inverseIDs.push_back(foundExpressID); |
| 377 | if (!set) |
| 378 | return inverseIDs; |
| 379 | } |
| 380 | } |
| 381 | else if (t == webifc::parsing::IfcTokenType::SET_BEGIN) |
| 382 | { |
| 383 | while (!loader->IsAtEnd()) |
| 384 | { |
| 385 | webifc::parsing::IfcTokenType setValueType = loader->GetTokenType(); |
| 386 | if (setValueType == webifc::parsing::IfcTokenType::SET_END) |
| 387 | break; |
| 388 | if (setValueType == webifc::parsing::IfcTokenType::REF) |
| 389 | { |
| 390 | loader->StepBack(); |
| 391 | uint32_t val = loader->GetRefArgument(); |
| 392 | if (val == expressID) |
| 393 | { |
| 394 | inverseIDs.push_back(foundExpressID); |
| 395 | if (!set) |
| 396 | return inverseIDs; |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | return inverseIDs; |
| 403 | } |
| 404 | |
| 405 | bool ValidateExpressID(uint32_t modelID, uint32_t expressId) |
| 406 | { |
nothing calls this directly
no test coverage detected