| 135 | } |
| 136 | |
| 137 | bool DaylightingDeviceTubular_Impl::addTransitionZone(const TransitionZone& transitionZone) { |
| 138 | bool result; |
| 139 | |
| 140 | // Push an extensible group |
| 141 | auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); |
| 142 | bool zone = eg.setPointer(OS_DaylightingDevice_TubularExtensibleFields::TransitionZoneName, transitionZone.thermalZone().handle()); |
| 143 | bool length = eg.setDouble(OS_DaylightingDevice_TubularExtensibleFields::TransitionZoneLength, transitionZone.length()); |
| 144 | if (zone && length) { |
| 145 | result = true; |
| 146 | } else { |
| 147 | // Something went wrong |
| 148 | // So erase the new extensible group |
| 149 | getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); |
| 150 | result = false; |
| 151 | } |
| 152 | result = true; |
| 153 | |
| 154 | return result; |
| 155 | } |
| 156 | |
| 157 | bool DaylightingDeviceTubular_Impl::addTransitionZone(const ThermalZone& zone, double length) { |
| 158 | // Make a transition zone, and then call the above function |