Initial plotting support.

This commit is contained in:
jmsgrogan 2023-01-24 17:15:25 +00:00
parent df450a7be0
commit c2027801be
34 changed files with 756 additions and 20 deletions

View file

@ -17,6 +17,7 @@
#include "Path.h"
#include "Line.h"
#include "LineSegment.h"
#include "Polygon.h"
#include "SvgShapeElements.h"
#include "SvgTextElement.h"
@ -149,6 +150,21 @@ void SvgPainter::paintPrimitive(SvgDocument* document, SceneModel* model) const
{
paintLineSegment(document, model);
}
else if (model->getGeometry()->getType() == AbstractGeometricItem::Type::POLYGON)
{
paintPolygon(document, model);
}
}
void SvgPainter::paintPolygon(SvgDocument* document, SceneModel* model) const
{
auto model_polygon = dynamic_cast<ntk::Polygon*>(model->getGeometry());
auto svg_polygon = std::make_unique<SvgPolygon>();
svg_polygon->setPoints(model_polygon->getPoints().getPoints());
setStyle(model, svg_polygon.get());
document->getRoot()->addChild(std::move(svg_polygon));
}
void SvgPainter::paintRect(SvgDocument* document, SceneModel* model) const