diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2020-04-13 13:31:37 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2020-04-23 20:05:32 +0300 |
commit | 247fca6d55318fbaa5c7424bf7605db7fb02e342 (patch) | |
tree | 828924c2f53b07b04260073ebee0c2928a0ba44b /src/libslic3r/Format/SL1.hpp | |
parent | 6eb51a1cca4d99385f8b1795d5fc1063424c1635 (diff) |
Initial version of sl1 import with sla::Raster refactor.
Diffstat (limited to 'src/libslic3r/Format/SL1.hpp')
-rw-r--r-- | src/libslic3r/Format/SL1.hpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/libslic3r/Format/SL1.hpp b/src/libslic3r/Format/SL1.hpp new file mode 100644 index 000000000..1b9e95392 --- /dev/null +++ b/src/libslic3r/Format/SL1.hpp @@ -0,0 +1,44 @@ +#ifndef ARCHIVETRAITS_HPP +#define ARCHIVETRAITS_HPP + +#include <string> + +#include "libslic3r/Zipper.hpp" +#include "libslic3r/SLAPrint.hpp" + +namespace Slic3r { + +class SL1Archive: public SLAPrinter { + SLAPrinterConfig m_cfg; + +protected: + uqptr<sla::RasterBase> create_raster() const override; + sla::EncodedRaster encode_raster(const sla::RasterBase &rst) const override; + +public: + + SL1Archive() = default; + explicit SL1Archive(const SLAPrinterConfig &cfg): m_cfg(cfg) {} + explicit SL1Archive(SLAPrinterConfig &&cfg): m_cfg(std::move(cfg)) {} + + void export_print(Zipper &zipper, const SLAPrint &print, const std::string &projectname = ""); + void export_print(const std::string &fname, const SLAPrint &print, const std::string &projectname = "") + { + Zipper zipper(fname); + export_print(zipper, print, projectname); + } + + void apply(const SLAPrinterConfig &cfg) override + { + auto diff = m_cfg.diff(cfg); + if (!diff.empty()) { + m_cfg.apply_only(cfg, diff); + m_layers = {}; + } + } +}; + + +} // namespace Slic3r::sla + +#endif // ARCHIVETRAITS_HPP |