Merge remote-tracking branch 'remotes/origin/tm_sla_png_minz'

This commit is contained in:
bubnikv 2019-03-28 09:14:37 +01:00
commit fc49abc2a4
319 changed files with 496 additions and 116392 deletions

View file

@ -6,7 +6,7 @@
#include "PrintExport.hpp"
#include "Point.hpp"
#include "MTUtils.hpp"
#include <iterator>
#include "Zipper.hpp"
namespace Slic3r {
@ -315,6 +315,39 @@ struct SLAPrintStatistics
}
};
struct SLAminzZipper {};
// The implementation of creating zipped archives with wxWidgets
template<> class LayerWriter<SLAminzZipper> {
Zipper m_zip;
public:
inline LayerWriter(const std::string& zipfile_path): m_zip(zipfile_path) {}
inline void next_entry(const std::string& fname) { m_zip.add_entry(fname); }
inline void binary_entry(const std::string& fname,
const std::uint8_t* buf,
size_t l)
{
m_zip.add_entry(fname, buf, l);
}
inline std::string get_name() const {
return m_zip.get_name();
}
template<class T> inline LayerWriter& operator<<(T&& arg) {
m_zip << std::forward<T>(arg); return *this;
}
bool is_ok() const {
return true; // m_zip blows up if something goes wrong...
}
inline void close() { m_zip.close(); }
};
/**
* @brief This class is the high level FSM for the SLA printing process.
*
@ -372,9 +405,11 @@ public:
// Returns true if the last step was finished with success.
bool finished() const override { return this->is_step_done(slaposIndexSlices) && this->Inherited::is_step_done(slapsRasterize); }
template<class Fmt> void export_raster(const std::string& fname) {
template<class Fmt = SLAminzZipper>
void export_raster(const std::string& fname) {
if(m_printer) m_printer->save<Fmt>(fname);
}
const PrintObjects& objects() const { return m_objects; }
const SLAPrintConfig& print_config() const { return m_print_config; }