| 1533 | } |
| 1534 | |
| 1535 | double Surface_Impl::skylightToProjectedFloorRatio() const { |
| 1536 | double result = 0.0; |
| 1537 | |
| 1538 | if (!istringEqual(this->surfaceType(), "RoofCeiling")) { |
| 1539 | return result; |
| 1540 | } |
| 1541 | |
| 1542 | Point3dVector vertices = this->vertices(); |
| 1543 | Plane horizontal(Point3d(0, 0, 0), Vector3d(0, 0, 1)); |
| 1544 | std::vector<Point3d> projectedVertics = horizontal.project(vertices); |
| 1545 | |
| 1546 | boost::optional<double> grossArea = getArea(projectedVertics); |
| 1547 | |
| 1548 | if (!grossArea || grossArea.get() == 0) { |
| 1549 | return result; |
| 1550 | } |
| 1551 | |
| 1552 | double skylightArea = 0.0; |
| 1553 | for (const SubSurface& subSurface : this->subSurfaces()) { |
| 1554 | if (istringEqual(subSurface.subSurfaceType(), "Skylight")) { |
| 1555 | skylightArea += subSurface.multiplier() * subSurface.netArea(); |
| 1556 | } |
| 1557 | } |
| 1558 | |
| 1559 | result = skylightArea / grossArea.get(); |
| 1560 | |
| 1561 | return result; |
| 1562 | } |
| 1563 | |
| 1564 | boost::optional<SubSurface> Surface_Impl::setWindowToWallRatio(double wwr) { |
| 1565 | return setWindowToWallRatio(wwr, 0.762, true); |