| 531 | } |
| 532 | |
| 533 | void ModelMerger::mergeShadingSurfaceGroup(ShadingSurfaceGroup& currentGroup, const ShadingSurfaceGroup& newGroup) { |
| 534 | if (m_newMergedHandles.find(newGroup.handle()) != m_newMergedHandles.end()) { |
| 535 | // already merged |
| 536 | return; |
| 537 | } |
| 538 | m_newMergedHandles.insert(newGroup.handle()); |
| 539 | |
| 540 | currentGroup.setName(newGroup.nameString()); |
| 541 | |
| 542 | if (newGroup.isDirectionofRelativeNorthDefaulted()) { |
| 543 | currentGroup.resetDirectionofRelativeNorth(); |
| 544 | } else { |
| 545 | currentGroup.setDirectionofRelativeNorth(newGroup.directionofRelativeNorth()); |
| 546 | } |
| 547 | |
| 548 | if (newGroup.isXOriginDefaulted()) { |
| 549 | currentGroup.resetXOrigin(); |
| 550 | } else { |
| 551 | currentGroup.setXOrigin(newGroup.xOrigin()); |
| 552 | } |
| 553 | |
| 554 | if (newGroup.isYOriginDefaulted()) { |
| 555 | currentGroup.resetYOrigin(); |
| 556 | } else { |
| 557 | currentGroup.setYOrigin(newGroup.yOrigin()); |
| 558 | } |
| 559 | |
| 560 | if (newGroup.isZOriginDefaulted()) { |
| 561 | currentGroup.resetZOrigin(); |
| 562 | } else { |
| 563 | currentGroup.setZOrigin(newGroup.zOrigin()); |
| 564 | } |
| 565 | |
| 566 | // remove current shading surfaces |
| 567 | for (auto& currentSurface : currentGroup.shadingSurfaces()) { |
| 568 | currentSurface.remove(); |
| 569 | } |
| 570 | |
| 571 | // change shading surface group type |
| 572 | currentGroup.setShadingSurfaceType(newGroup.shadingSurfaceType()); |
| 573 | |
| 574 | // add new shading surfaces |
| 575 | for (const auto& newSurface : newGroup.shadingSurfaces()) { |
| 576 | // DLM: this should probably be moved to a mergeSurface method |
| 577 | auto clone = newSurface.clone(m_currentModel).cast<ShadingSurface>(); |
| 578 | clone.setShadingSurfaceGroup(currentGroup); |
| 579 | |
| 580 | m_newMergedHandles.insert(newSurface.handle()); |
| 581 | m_currentToNewHandleMapping[clone.handle()] = newSurface.handle(); |
| 582 | m_newToCurrentHandleMapping[newSurface.handle()] = clone.handle(); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | void ModelMerger::mergeThermalZone(ThermalZone& currentThermalZone, const ThermalZone& newThermalZone) { |
| 587 | if (m_newMergedHandles.find(newThermalZone.handle()) != m_newMergedHandles.end()) { |
nothing calls this directly
no test coverage detected