| 245 | } |
| 246 | |
| 247 | boost::optional<std::pair<ConstructionBase, int>> Surface_Impl::constructionWithSearchDistance() const { |
| 248 | boost::optional<std::pair<ConstructionBase, int>> result; |
| 249 | |
| 250 | boost::optional<ConstructionBase> construction = |
| 251 | getObject<ModelObject>().getModelObjectTarget<ConstructionBase>(OS_SurfaceFields::ConstructionName); |
| 252 | if (construction) { |
| 253 | return std::make_pair(*construction, 0); |
| 254 | } |
| 255 | |
| 256 | boost::optional<Space> space = this->space(); |
| 257 | if (space) { |
| 258 | result = space->getDefaultConstructionWithSearchDistance(this->getObject<Surface>()); |
| 259 | } |
| 260 | return result; |
| 261 | } |
| 262 | |
| 263 | bool Surface_Impl::isConstructionDefaulted() const { |
| 264 | return isEmpty(OS_SurfaceFields::ConstructionName); |