| 177 | } |
| 178 | |
| 179 | WindowGroupControl WindowGroup::windowGroupControl() const { |
| 180 | boost::optional<double> largestArea; |
| 181 | boost::optional<Point3d> centroid; |
| 182 | boost::optional<Vector3d> outwardNormal; |
| 183 | |
| 184 | for (const auto& windowPolygon : m_windowPolygons) { |
| 185 | boost::optional<double> area = getArea(windowPolygon); |
| 186 | if (area) { |
| 187 | if (!largestArea || (*area > *largestArea)) { |
| 188 | boost::optional<Point3d> tmpCentroid = getCentroid(windowPolygon); |
| 189 | boost::optional<Vector3d> tmpOutwardNormal = getOutwardNormal(windowPolygon); |
| 190 | if (tmpCentroid && tmpOutwardNormal) { |
| 191 | largestArea = area; |
| 192 | centroid = tmpCentroid; |
| 193 | outwardNormal = tmpOutwardNormal; |
| 194 | } |
| 195 | } |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | WindowGroupControl result; |
| 200 | result.largestArea = largestArea; |
| 201 | result.centroid = centroid; |
| 202 | result.outwardNormal = outwardNormal; |
| 203 | |
| 204 | return result; |
| 205 | } |
| 206 | |
| 207 | std::string WindowGroup::windowGroupPoints() const { |
| 208 | WindowGroupControl control = this->windowGroupControl(); |
no test coverage detected