Initial scene to svg conversion.
This commit is contained in:
parent
65ac927929
commit
1fc730d413
15 changed files with 164 additions and 28 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "SvgShapeElements.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
SvgCircle::SvgCircle()
|
||||
: SvgShapeElement("circle")
|
||||
{
|
||||
|
@ -60,3 +62,24 @@ void SvgRectangle::setHeight(unsigned h)
|
|||
|
||||
addAttribute(std::move(height));
|
||||
}
|
||||
|
||||
|
||||
SvgPolygon::SvgPolygon()
|
||||
: SvgShapeElement("polygon")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SvgPolygon::setPoints(const std::vector<DiscretePoint>& locs)
|
||||
{
|
||||
auto points = std::make_unique<XmlAttribute>("points");
|
||||
|
||||
std::stringstream sstr;
|
||||
for (const auto& loc : locs)
|
||||
{
|
||||
sstr << loc.GetX() << "," << loc.GetY() << " ";
|
||||
}
|
||||
points->setValue(sstr.str());
|
||||
addAttribute(std::move(points));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue