MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / mergeBuildingUnit

Method mergeBuildingUnit

src/model/ModelMerger.cpp:805–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 15

nameStringMethod · 0.80
setRenderingRedValueMethod · 0.80
renderingRedValueMethod · 0.80
renderingGreenValueMethod · 0.80
setRenderingBlueValueMethod · 0.80
renderingBlueValueMethod · 0.80
renderingAlphaValueMethod · 0.80
colorStringMethod · 0.80
findMethod · 0.45
handleMethod · 0.45

Tested by

no test coverage detected