Improve node to svg conversion.
This commit is contained in:
parent
64f0b3e77a
commit
26ecae46b3
22 changed files with 403 additions and 126 deletions
|
@ -3,9 +3,16 @@
|
|||
#include "DrawingSurface.h"
|
||||
#include "DrawingContext.h"
|
||||
#include "AbstractPainter.h"
|
||||
#include "Scene.h"
|
||||
|
||||
#include "SvgConverter.h"
|
||||
#include "SvgWriter.h"
|
||||
#include "SvgDocument.h"
|
||||
|
||||
#include "Image.h"
|
||||
#include "PngWriter.h"
|
||||
#include "Scene.h"
|
||||
|
||||
#include "File.h"
|
||||
|
||||
class TestRenderer
|
||||
{
|
||||
|
@ -34,6 +41,18 @@ public:
|
|||
writer.write(image);
|
||||
}
|
||||
|
||||
void writeSvg(const Path& path)
|
||||
{
|
||||
SvgConverter converter;
|
||||
auto svg_document = converter.convert(mSurface->getScene());
|
||||
|
||||
SvgWriter writer;
|
||||
auto svg_content = writer.toString(svg_document.get());
|
||||
|
||||
File svg_file(path);
|
||||
svg_file.writeText(svg_content);
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<DrawingSurface> mSurface;
|
||||
std::unique_ptr<DrawingContext> mDrawingContext;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue