| 803 | } |
| 804 | |
| 805 | void ModelMerger::mergeBuildingUnit(BuildingUnit& currentBuildingUnit, const BuildingUnit& newBuildingUnit) { |
| 806 | if (m_newMergedHandles.find(newBuildingUnit.handle()) != m_newMergedHandles.end()) { |
| 807 | // already merged |
| 808 | return; |
| 809 | } |
| 810 | m_newMergedHandles.insert(newBuildingUnit.handle()); |
| 811 | |
| 812 | currentBuildingUnit.setName(newBuildingUnit.nameString()); |
| 813 | |
| 814 | // rendering color |
| 815 | boost::optional<RenderingColor> newColor = newBuildingUnit.renderingColor(); |
| 816 | if (newColor) { |
| 817 | boost::optional<RenderingColor> currentColor = currentBuildingUnit.renderingColor(); |
| 818 | if (currentColor) { |
| 819 | currentColor->setRenderingRedValue(newColor->renderingRedValue()); |
| 820 | currentColor->setRenderingGreenValue(newColor->renderingGreenValue()); |
| 821 | currentColor->setRenderingBlueValue(newColor->renderingBlueValue()); |
| 822 | currentColor->setRenderingAlphaValue(newColor->renderingAlphaValue()); |
| 823 | } else { |
| 824 | currentColor = RenderingColor::fromColorString(newColor->colorString(), currentBuildingUnit.model()); |
| 825 | OS_ASSERT(currentColor); |
| 826 | currentBuildingUnit.setRenderingColor(*currentColor); |
| 827 | } |
| 828 | } |
| 829 | |
| 830 | // buildingUnitType |
| 831 | // DLM: TODO need to check if other buildingUnitType is defaulted and optionally set |
| 832 | //currentBuildingUnit.setBuildingUnitType(newBuildingUnit.buildingUnitType()); |
| 833 | |
| 834 | // DLM: TODO featureNames() const; |
| 835 | } |
| 836 | |
| 837 | void ModelMerger::mergeDefaultConstructionSet(DefaultConstructionSet& currentDefaultConstructionSet, |
| 838 | const DefaultConstructionSet& newDefaultConstructionSet) { |
nothing calls this directly
no test coverage detected