MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / finalize

Method finalize

src/serializers/SvgSerializer.cpp:1977–2183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1975}
1976
1977void 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(

Callers 6

finalizeFunction · 0.45
finalizeFunction · 0.45
to_obj_fileMethod · 0.45
executeMethod · 0.45
generate_lineworkMethod · 0.45
executeMethod · 0.45

Calls 12

push_backMethod · 0.80
instances_by_typeMethod · 0.80
getUnitMethod · 0.80
isNullMethod · 0.80
GetMethod · 0.80
writeFunction · 0.70
sizeMethod · 0.45
getMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected