void Svg::addLine(const Vector2d &p1, const Vector2d &p2, const int width, const ColorRGB &color) { std::stringstream ss; ss << SvgHelper::elemStart("line") << SvgHelper::attribute("x1", p1.x) << SvgHelper::attribute("y1", p1.y) << SvgHelper::attribute("x2", p2.x) << SvgHelper::attribute("y2", p2.y) << SvgHelper::attribute("stroke-width", width) << SvgHelper::attribute("stroke", color.toString()) << SvgHelper::emptyElemEnd(); body += ss.str(); }
void Svg::addText(const std::string &text, float x, const float y, const ColorRGB &color) { std::stringstream ss; ss << "<text " << SvgHelper::attribute("x", x) << SvgHelper::attribute("y", y) << SvgHelper::attribute("fill", color.toString()) << ">" << text.c_str() << "</text>"; body += ss.str(); }
void Svg::addPoint(const Vector2d &point, const int radius, const ColorRGB &color) { std::stringstream ss; ss << SvgHelper::elemStart("circle"); ss << SvgHelper::attribute("cx", point.x) << SvgHelper::attribute("cy", point.y) << SvgHelper::attribute("r", radius) << SvgHelper::attribute("fill", color.toString()) << SvgHelper::emptyElemEnd(); body += ss.str(); }