| 1975 | } |
| 1976 | |
| 1977 | void SvgSerializer::finalize() { |
| 1978 | doWriteHeader(); |
| 1979 | |
| 1980 | for (auto& p : drawing_metadata) { |
| 1981 | addTextAnnotations(p.first); |
| 1982 | } |
| 1983 | |
| 1984 | for (auto& p : storey_hlr) { |
| 1985 | draw_hlr(drawing_metadata[{p.first, ""}].pln_3d, { p.first, "" }); |
| 1986 | } |
| 1987 | |
| 1988 | auto m = resize(); |
| 1989 | |
| 1990 | // Update the paper space scale matrices |
| 1991 | for (auto& p : paths) { |
| 1992 | drawing_metadata[p.first].matrix_3 = m; |
| 1993 | } |
| 1994 | |
| 1995 | if (!deferred_section_data_.is_initialized() && (auto_section_ || auto_elevation_)) { |
| 1996 | deferred_section_data_.emplace(); |
| 1997 | } |
| 1998 | |
| 1999 | // @nb keep in mind Y-axis is negated in these 6 definitions to account |
| 2000 | // for coordinate system differences. |
| 2001 | if (auto_section_) { |
| 2002 | { |
| 2003 | gp_Pln pln(gp_Ax3( |
| 2004 | gp_Pnt((xmin + xmax) / 2., (ymin + ymax) / 2., 0.), |
| 2005 | gp_Dir(-1, 0, 0), |
| 2006 | gp_Dir(0, -1, 0))); |
| 2007 | deferred_section_data_->push_back(vertical_section{ pln , "Section North South", true }); |
| 2008 | } |
| 2009 | { |
| 2010 | gp_Pln pln(gp_Ax3( |
| 2011 | gp_Pnt((xmin + xmax) / 2., (ymin + ymax) / -2., 0.), |
| 2012 | gp_Dir(0, -1, 0), |
| 2013 | gp_Dir(1, 0, 0))); |
| 2014 | deferred_section_data_->push_back(vertical_section{ pln , "Section East West", true }); |
| 2015 | } |
| 2016 | } |
| 2017 | |
| 2018 | if (auto_elevation_) { |
| 2019 | { |
| 2020 | gp_Pln pln(gp_Ax3( |
| 2021 | gp_Pnt(0., -(ymin - 0.1), 0.), |
| 2022 | gp_Dir(0, 1, 0), |
| 2023 | gp_Dir(-1, 0, 0))); |
| 2024 | deferred_section_data_->push_back(vertical_section{ pln , "Elevation South", true }); |
| 2025 | } |
| 2026 | { |
| 2027 | gp_Pln pln(gp_Ax3( |
| 2028 | gp_Pnt(xmax + 0.1, 0., 0.), |
| 2029 | gp_Dir(1, 0, 0), |
| 2030 | gp_Dir(0, 1, 0))); |
| 2031 | deferred_section_data_->push_back(vertical_section{ pln , "Elevation East", true }); |
| 2032 | } |
| 2033 | { |
| 2034 | gp_Pln pln(gp_Ax3( |
no test coverage detected