diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index c2187c9d9d..0a15bc0a20 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -428,6 +428,8 @@ int main(int argc, char** argv) { " and any other value means that 6 or 7 decimals are used.") ("print-space-names", "Prints IfcSpace LongName and Name in the geometry output. Applicable for SVG output") ("print-space-areas", "Prints calculated IfcSpace areas in square meters. Applicable for SVG output") + ("space-name-transform", po::value(), + "Additional transform to the space labels in SVG") ("edge-arrows", "Adds arrow heads to edge segments to signify edge direction") ; @@ -1015,6 +1017,11 @@ int main(int argc, char** argv) { vmap["storey-height-line-length"].as() ); } + if (vmap.count("space-name-transform")) { + static_cast(serializer.get())->setSpaceNameTransform( + vmap["space-name-transform"].as() + ); + } } if (convert_back_units) { diff --git a/src/serializers/SvgSerializer.cpp b/src/serializers/SvgSerializer.cpp index 40325202e5..7650ac46c9 100644 --- a/src/serializers/SvgSerializer.cpp +++ b/src/serializers/SvgSerializer.cpp @@ -1345,7 +1345,11 @@ void SvgSerializer::write(const geometry_data& data) { xcoords.push_back(path.add(center_point->X())); path.add("\" y=\""); ycoords.push_back(path.add(center_point->Y())); - path.add("\">"); + path.add("\""); + if (space_name_transform_) { + path.add(" transform=\"" + *space_name_transform_ + "\""); + } + path.add(">"); for (auto lit = labels.begin(); lit != labels.end(); ++lit) { const auto& l = *lit; double dy = labels.begin() == lit diff --git a/src/serializers/SvgSerializer.h b/src/serializers/SvgSerializer.h index f80447d3e7..0772e03bdb 100644 --- a/src/serializers/SvgSerializer.h +++ b/src/serializers/SvgSerializer.h @@ -139,6 +139,7 @@ protected: boost::optional scale_, calculated_scale_, center_x_, center_y_, scale_backup_; boost::optional storey_height_line_length_; boost::optional> size_, size_backup_; + boost::optional space_name_transform_; bool with_section_heights_from_storey_, print_space_names_, print_space_areas_; storey_height_display_types storey_height_display_; @@ -218,6 +219,7 @@ public: void setDrawStoreyHeights(storey_height_display_types sh) { storey_height_display_ = sh; } void setDrawDoorArcs(bool b) { draw_door_arcs_ = b; } void setStoreyHeightLineLength(double d) { storey_height_line_length_ = d; } + void setSpaceNameTransform(const std::string& v) { space_name_transform_ = v; } std::array, 3> resize(); void resetScale();