Fix linux build.

This commit is contained in:
James Grogan 2023-01-28 16:58:26 +00:00
parent a6d92e142f
commit 9e1d951520
50 changed files with 1586 additions and 1192 deletions

View file

@ -4,30 +4,35 @@
#include "Plot.h"
#include "PlotNode.h"
#include "PlotSeriesNode.h"
#include "PlotCaptionNode.h"
#include "EquationNode.h"
#include "TextNode.h"
#include "LineNode.h"
TEST_CASE(TestPlotting, "[publishing]")
{
auto plot = std::make_unique<Plot>();
plot->setXAxisCaption("X Axis");
plot->setYAxisCaption("Y Axis");
auto plot = std::make_unique<Plot>();
plot->setXAxisCaption("X Axis");
plot->setYAxisCaption("Y Axis");
PlotSeries series("Series-1");
PlotSeries series("Series-1");
std::vector<Point> data{ {0.0, 0.0}, {10.0, 40.0}, {20.0, 80.0} };
series.setData(data);
plot->addSeries(series);
std::vector<Point> data{ {0.0, 0.0}, {10.0, 40.0}, {20.0, 80.0} };
series.setData(data);
plot->addSeries(series);
Point loc(10, 10);
auto plot_node = std::make_unique<PlotNode>(Transform(loc));
plot_node->setAxisEndStyle(LineEndNode::Style::CLOSED_ARROW);
Point loc(10, 10);
auto plot_node = std::make_unique<PlotNode>(Transform(loc));
plot_node->setAxisEndStyle(LineEndNode::Style::CLOSED_ARROW);
plot_node->setContent(plot.get());
plot_node->setContent(plot.get());
TestRenderer renderer(800, 800);
TestRenderer renderer(800, 800);
auto scene = renderer.getScene();
scene->addNode(plot_node.get());
auto scene = renderer.getScene();
scene->addNode(plot_node.get());
renderer.writeSvg(TestUtils::getTestOutputDir(__FILE__) / "plot.svg");
renderer.write(TestUtils::getTestOutputDir(__FILE__) / "plot.png");
}
renderer.writeSvg(TestUtils::getTestOutputDir(__FILE__) / "plot.svg");
renderer.write(TestUtils::getTestOutputDir(__FILE__) / "plot.png");
}