| 96 | } |
| 97 | |
| 98 | boost::optional<std::pair<ConstructionBase, int>> ShadingSurface_Impl::constructionWithSearchDistance() const { |
| 99 | boost::optional<std::pair<ConstructionBase, int>> result; |
| 100 | |
| 101 | boost::optional<ConstructionBase> construction = |
| 102 | getObject<ModelObject>().getModelObjectTarget<ConstructionBase>(OS_ShadingSurfaceFields::ConstructionName); |
| 103 | if (construction) { |
| 104 | return std::make_pair(*construction, 0); |
| 105 | } |
| 106 | |
| 107 | boost::optional<ShadingSurfaceGroup> shadingSurfaceGroup = this->shadingSurfaceGroup(); |
| 108 | if (shadingSurfaceGroup) { |
| 109 | |
| 110 | // check the space |
| 111 | boost::optional<Space> space = shadingSurfaceGroup->space(); |
| 112 | if (space) { |
| 113 | result = space->getDefaultConstructionWithSearchDistance(this->getObject<ShadingSurface>()); |
| 114 | if (result) { |
| 115 | return result; |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // check the building |
| 120 | boost::optional<Building> building = this->model().building(); |
| 121 | if (building) { |
| 122 | |
| 123 | boost::optional<DefaultConstructionSet> defaultConstructionSet = building->defaultConstructionSet(); |
| 124 | if (defaultConstructionSet) { |
| 125 | construction = defaultConstructionSet->getDefaultConstruction(this->getObject<ShadingSurface>()); |
| 126 | if (construction) { |
| 127 | return std::make_pair(*construction, 4); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | // check the building's space type |
| 132 | boost::optional<SpaceType> spaceType = building->spaceType(); |
| 133 | if (spaceType) { |
| 134 | defaultConstructionSet = spaceType->defaultConstructionSet(); |
| 135 | if (defaultConstructionSet) { |
| 136 | construction = defaultConstructionSet->getDefaultConstruction(this->getObject<ShadingSurface>()); |
| 137 | if (construction) { |
| 138 | return std::make_pair(*construction, 5); |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | return result; |
| 146 | } |
| 147 | |
| 148 | bool ShadingSurface_Impl::isConstructionDefaulted() const { |
| 149 | return isEmpty(OS_ShadingSurfaceFields::ConstructionName); |
nothing calls this directly
no test coverage detected