| 292 | } |
| 293 | |
| 294 | void DefaultConstructionSet_Impl::merge(const DefaultConstructionSet& other) { |
| 295 | boost::optional<DefaultSurfaceConstructions> thisSurfaceConstructions; |
| 296 | boost::optional<DefaultSurfaceConstructions> otherSurfaceConstructions; |
| 297 | boost::optional<DefaultSubSurfaceConstructions> thisSubSurfaceConstructions; |
| 298 | boost::optional<DefaultSubSurfaceConstructions> otherSubSurfaceConstructions; |
| 299 | |
| 300 | otherSurfaceConstructions = other.defaultExteriorSurfaceConstructions(); |
| 301 | if (otherSurfaceConstructions) { |
| 302 | thisSurfaceConstructions = this->defaultExteriorSurfaceConstructions(); |
| 303 | if (!thisSurfaceConstructions) { |
| 304 | this->setDefaultExteriorSurfaceConstructions(*otherSurfaceConstructions); |
| 305 | } else { |
| 306 | if (thisSurfaceConstructions->handle() == otherSurfaceConstructions->handle()) { |
| 307 | // no op |
| 308 | } else { |
| 309 | if (thisSurfaceConstructions->numSources() > 1) { |
| 310 | thisSurfaceConstructions = thisSurfaceConstructions->clone(this->model()).cast<DefaultSurfaceConstructions>(); |
| 311 | this->setDefaultExteriorSurfaceConstructions(*thisSurfaceConstructions); |
| 312 | } |
| 313 | thisSurfaceConstructions->merge(*otherSurfaceConstructions); |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | otherSurfaceConstructions = other.defaultInteriorSurfaceConstructions(); |
| 319 | if (otherSurfaceConstructions) { |
| 320 | thisSurfaceConstructions = this->defaultInteriorSurfaceConstructions(); |
| 321 | if (!thisSurfaceConstructions) { |
| 322 | this->setDefaultInteriorSurfaceConstructions(*otherSurfaceConstructions); |
| 323 | } else { |
| 324 | if (thisSurfaceConstructions->handle() == otherSurfaceConstructions->handle()) { |
| 325 | // no op |
| 326 | } else { |
| 327 | if (thisSurfaceConstructions->numSources() > 1) { |
| 328 | thisSurfaceConstructions = thisSurfaceConstructions->clone(this->model()).cast<DefaultSurfaceConstructions>(); |
| 329 | this->setDefaultInteriorSurfaceConstructions(*thisSurfaceConstructions); |
| 330 | } |
| 331 | thisSurfaceConstructions->merge(*otherSurfaceConstructions); |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | otherSurfaceConstructions = other.defaultGroundContactSurfaceConstructions(); |
| 337 | if (otherSurfaceConstructions) { |
| 338 | thisSurfaceConstructions = this->defaultGroundContactSurfaceConstructions(); |
| 339 | if (!thisSurfaceConstructions) { |
| 340 | this->setDefaultGroundContactSurfaceConstructions(*otherSurfaceConstructions); |
| 341 | } else { |
| 342 | if (thisSurfaceConstructions->handle() == otherSurfaceConstructions->handle()) { |
| 343 | // no op |
| 344 | } else { |
| 345 | if (thisSurfaceConstructions->numSources() > 1) { |
| 346 | thisSurfaceConstructions = thisSurfaceConstructions->clone(this->model()).cast<DefaultSurfaceConstructions>(); |
| 347 | this->setDefaultGroundContactSurfaceConstructions(*thisSurfaceConstructions); |
| 348 | } |
| 349 | thisSurfaceConstructions->merge(*otherSurfaceConstructions); |
| 350 | } |
| 351 | } |
nothing calls this directly
no test coverage detected