SLA archiver implemented for svg output, switchable in config.

new config is sla_archive_format as a string.
WIP


Get rid of SVG class, use manual svg creation


Revert changes in SVG.hpp and SVG.cpp
This commit is contained in:
tamasmeszaros 2022-01-07 10:15:16 +01:00
parent eddcebf929
commit 7f153a55b3
13 changed files with 217 additions and 40 deletions

View file

@ -1,6 +1,9 @@
#include "SLAPrint.hpp"
#include "SLAPrintSteps.hpp"
#include "Format/SL1.hpp"
#include "Format/SL1_SVG.hpp"
#include "ClipperUtils.hpp"
#include "Geometry.hpp"
#include "MTUtils.hpp"
@ -240,8 +243,13 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig con
m_material_config.apply_only(config, material_diff, true);
// Handle changes to object config defaults
m_default_object_config.apply_only(config, object_diff, true);
if (m_printer) m_printer->apply(m_printer_config);
if (!m_printer || std::find(printer_diff.begin(), printer_diff.end(), "sla_archive_format") != printer_diff.end()) {
if (m_printer_config.sla_archive_format.value == "SL1")
m_printer = std::make_unique<SL1Archive>(m_printer_config);
else if (m_printer_config.sla_archive_format.value == "SL2")
m_printer = std::make_unique<SL1_SVGArchive>(m_printer_config);
}
struct ModelObjectStatus {
enum Status {
@ -670,12 +678,6 @@ std::string SLAPrint::validate(std::string*) const
return "";
}
void SLAPrint::set_printer(SLAArchive *arch)
{
invalidate_step(slapsRasterize);
m_printer = arch;
}
bool SLAPrint::invalidate_step(SLAPrintStep step)
{
bool invalidated = Inherited::invalidate_step(step);
@ -835,7 +837,8 @@ bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_opt
"display_pixels_y",
"display_mirror_x",
"display_mirror_y",
"display_orientation"
"display_orientation",
"sla_archive_format"
};
static std::unordered_set<std::string> steps_ignore = {