convert workspace to given coordinate systems all geometry will be converted to upper-left-corner, counterclockwise all simple geometry will be converted to detailed geometry
| 95 | /// all geometry will be converted to upper-left-corner, counterclockwise |
| 96 | /// all simple geometry will be converted to detailed geometry |
| 97 | bool GeometryTranslator::convert(const CoordinateSystem& detailedSystem, const CoordinateSystem& daylightingSystem) { |
| 98 | bool result = true; |
| 99 | |
| 100 | IddObjectTypeVector translatedTypes = {IddObjectType::Building, |
| 101 | IddObjectType::Zone, |
| 102 | IddObjectType::BuildingSurface_Detailed, |
| 103 | IddObjectType::Wall_Detailed, |
| 104 | IddObjectType::Wall_Exterior, |
| 105 | IddObjectType::Wall_Adiabatic, |
| 106 | IddObjectType::Wall_Underground, |
| 107 | IddObjectType::Wall_Interzone, |
| 108 | IddObjectType::RoofCeiling_Detailed, |
| 109 | IddObjectType::Roof, |
| 110 | IddObjectType::Ceiling_Adiabatic, |
| 111 | IddObjectType::Ceiling_Interzone, |
| 112 | IddObjectType::Floor_Detailed, |
| 113 | IddObjectType::Floor_GroundContact, |
| 114 | IddObjectType::Floor_Adiabatic, |
| 115 | IddObjectType::Floor_Interzone, |
| 116 | IddObjectType::Shading_Site, |
| 117 | IddObjectType::Shading_Site_Detailed, |
| 118 | IddObjectType::Shading_Building, |
| 119 | IddObjectType::Shading_Building_Detailed, |
| 120 | IddObjectType::Shading_Zone_Detailed, |
| 121 | IddObjectType::Shading_Overhang, |
| 122 | IddObjectType::Shading_Overhang_Projection, |
| 123 | IddObjectType::Shading_Fin, |
| 124 | IddObjectType::Shading_Fin_Projection, |
| 125 | IddObjectType::FenestrationSurface_Detailed, |
| 126 | IddObjectType::Window, |
| 127 | IddObjectType::Window_Interzone, |
| 128 | IddObjectType::Door, |
| 129 | IddObjectType::GlazedDoor, |
| 130 | IddObjectType::Door_Interzone, |
| 131 | IddObjectType::GlazedDoor_Interzone, |
| 132 | IddObjectType::Daylighting_Controls, |
| 133 | IddObjectType::Daylighting_ReferencePoint, |
| 134 | IddObjectType::Output_IlluminanceMap}; |
| 135 | |
| 136 | bool skipConvert = !std::any_of(translatedTypes.cbegin(), translatedTypes.cend(), |
| 137 | [this](const auto& iddObjectType) { return !m_workspace.getObjectsByType(iddObjectType).empty(); }); |
| 138 | |
| 139 | if (skipConvert) { |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | // current geometry rules |
| 144 | GlobalGeometryRules currentRules = globalGeometryRules(); |
| 145 | |
| 146 | // convert to counter clockwise vertex entry direction |
| 147 | if (currentRules.ved == VertexEntryDirection::Clockwise) { |
| 148 | result = result && reverseAllDetailedVertices(); |
| 149 | } |
| 150 | |
| 151 | // change from current detailed system to new detailed system |
| 152 | CoordinateChange detailedCoordChange = CoordinateChange::NoChange; |
| 153 | if (equal(currentRules.detailedSystem, CoordinateSystem::Relative) && equal(detailedSystem, CoordinateSystem::Absolute)) { |
| 154 | detailedCoordChange = CoordinateChange::RelativeToAbsolute; |