MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / SVGLinesToString

Function SVGLinesToString

src/cpp/test/io_helpers.cpp:106–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 void SVGLinesToString(Bounds bounds, glm::dvec2 size, glm::dvec2 offset, SVGLineSet lineSet, std::stringstream &svg)
107 {
108 for (auto &line : lineSet.lines)
109 {
110 if (line.size() > 1)
111 {
112 for (size_t i = 1; i < line.size(); i++)
113 {
114 glm::dvec2 a = rescale(line[i], bounds, size, offset);
115 glm::dvec2 b = rescale(line[i - 1], bounds, size, offset);
116
117 svgMakeLine(a, b, svg, lineSet.color);
118 }
119 }
120 else
121 {
122 glm::dvec2 a = rescale(line[0], bounds, size, offset);
123 svg << "<circle cx = \"" << a.x << "\" cy = \"" << a.y << "\" r = \"3\" style = \"stroke:rgb(0,0,255);stroke-width:2\" />";
124 }
125 }
126 }
127
128 std::string makeSVGLines(SVGDrawing drawing)
129 {

Callers 1

makeSVGLinesFunction · 0.70

Calls 3

sizeMethod · 0.80
rescaleFunction · 0.70
svgMakeLineFunction · 0.70

Tested by

no test coverage detected