Support writing SVG to scale

This commit is contained in:
Thomas Krijnen
2020-08-25 15:01:07 +02:00
parent 34c51fa9be
commit c872ee8844
3 changed files with 50 additions and 10 deletions
+5
View File
@@ -73,6 +73,7 @@ protected:
std::ofstream svg_file;
double xmin, ymin, xmax, ymax, width, height;
boost::optional<std::vector<std::pair<std::pair<double, double>, IfcUtil::IfcBaseEntity*>>> section_heights;
boost::optional<double> scale_;
bool rescale, print_space_names_, print_space_areas_, draw_door_arcs_, with_section_heights_from_storey_;
std::multimap<IfcUtil::IfcBaseEntity*, path_object, storey_sorter> paths;
std::vector< boost::shared_ptr<util::string_buffer::float_item> > xcoords;
@@ -90,6 +91,9 @@ public:
, ymax(-std::numeric_limits<double>::infinity())
, with_section_heights_from_storey_(false)
, rescale(false)
, print_space_names_(false)
, print_space_areas_(false)
, draw_door_arcs_(false)
, file(0)
, storey_(0)
{}
@@ -113,6 +117,7 @@ public:
void setPrintSpaceNames(bool b) { print_space_names_ = b; }
void setPrintSpaceAreas(bool b) { print_space_areas_ = b; }
void setDrawDoorArcs(bool b) { draw_door_arcs_ = b; }
void setScale(double s) { scale_ = s; }
std::string nameElement(const IfcUtil::IfcBaseEntity* storey, const IfcGeom::Element<real_t>* elem);
std::string nameElement(const IfcUtil::IfcBaseEntity* elem);
std::string idElement(const IfcUtil::IfcBaseEntity* elem);