mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 15:57:55 -06:00
ENH: slicing: add cache data load/export for slicing
Change-Id: I88b7c79b6f79ec6bed0f829316b67310cac99b44 (cherry picked from commit 67c1d2e8dd459cc4450ce580632f01e25db038ac)
This commit is contained in:
parent
2ffa56633c
commit
c3abc64b61
13 changed files with 1471 additions and 192 deletions
|
@ -13,6 +13,38 @@
|
|||
|
||||
#include "libslic3r.h"
|
||||
|
||||
//define CLI errors
|
||||
|
||||
#define CLI_SUCCESS 0
|
||||
#define CLI_ENVIRONMENT_ERROR -1
|
||||
#define CLI_INVALID_PARAMS -2
|
||||
#define CLI_FILE_NOTFOUND -3
|
||||
#define CLI_FILELIST_INVALID_ORDER -4
|
||||
#define CLI_CONFIG_FILE_ERROR -5
|
||||
#define CLI_DATA_FILE_ERROR -6
|
||||
#define CLI_INVALID_PRINTER_TECH -7
|
||||
#define CLI_UNSUPPORTED_OPERATION -8
|
||||
|
||||
#define CLI_COPY_OBJECTS_ERROR -9
|
||||
#define CLI_SCALE_TO_FIT_ERROR -10
|
||||
#define CLI_EXPORT_STL_ERROR -11
|
||||
#define CLI_EXPORT_OBJ_ERROR -12
|
||||
#define CLI_EXPORT_3MF_ERROR -13
|
||||
#define CLI_OUT_OF_MEMORY -14
|
||||
|
||||
#define CLI_NO_SUITABLE_OBJECTS -50
|
||||
#define CLI_VALIDATE_ERROR -51
|
||||
#define CLI_OBJECTS_PARTLY_INSIDE -52
|
||||
#define CLI_EXPORT_CACHE_DIRECTORY_CREATE_FAILED -53
|
||||
#define CLI_EXPORT_CACHE_WRITE_FAILED -54
|
||||
#define CLI_IMPORT_CACHE_NOT_FOUND -55
|
||||
#define CLI_IMPORT_CACHE_DATA_CAN_NOT_USE -56
|
||||
#define CLI_IMPORT_CACHE_LOAD_FAILED -57
|
||||
|
||||
|
||||
#define CLI_SLICING_ERROR -100
|
||||
|
||||
|
||||
namespace boost { namespace filesystem { class directory_entry; }}
|
||||
|
||||
namespace Slic3r {
|
||||
|
@ -161,11 +193,11 @@ namespace PerlUtils {
|
|||
|
||||
std::string string_printf(const char *format, ...);
|
||||
|
||||
// Standard "generated by Slic3r version xxx timestamp xxx" header string,
|
||||
// Standard "generated by Slic3r version xxx timestamp xxx" header string,
|
||||
// to be placed at the top of Slic3r generated files.
|
||||
std::string header_slic3r_generated();
|
||||
|
||||
// Standard "generated by PrusaGCodeViewer version xxx timestamp xxx" header string,
|
||||
// Standard "generated by PrusaGCodeViewer version xxx timestamp xxx" header string,
|
||||
// to be placed at the top of Slic3r generated files.
|
||||
std::string header_gcodeviewer_generated();
|
||||
|
||||
|
@ -247,38 +279,38 @@ inline INDEX_TYPE next_idx_modulo(INDEX_TYPE idx, const INDEX_TYPE count)
|
|||
}
|
||||
|
||||
template<typename CONTAINER_TYPE>
|
||||
inline typename CONTAINER_TYPE::size_type prev_idx_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
|
||||
{
|
||||
inline typename CONTAINER_TYPE::size_type prev_idx_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
|
||||
{
|
||||
return prev_idx_modulo(idx, container.size());
|
||||
}
|
||||
|
||||
template<typename CONTAINER_TYPE>
|
||||
inline typename CONTAINER_TYPE::size_type next_idx_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
|
||||
{
|
||||
{
|
||||
return next_idx_modulo(idx, container.size());
|
||||
}
|
||||
|
||||
template<typename CONTAINER_TYPE>
|
||||
inline const typename CONTAINER_TYPE::value_type& prev_value_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
|
||||
{
|
||||
{
|
||||
return container[prev_idx_modulo(idx, container.size())];
|
||||
}
|
||||
|
||||
template<typename CONTAINER_TYPE>
|
||||
inline typename CONTAINER_TYPE::value_type& prev_value_modulo(typename CONTAINER_TYPE::size_type idx, CONTAINER_TYPE &container)
|
||||
{
|
||||
inline typename CONTAINER_TYPE::value_type& prev_value_modulo(typename CONTAINER_TYPE::size_type idx, CONTAINER_TYPE &container)
|
||||
{
|
||||
return container[prev_idx_modulo(idx, container.size())];
|
||||
}
|
||||
|
||||
template<typename CONTAINER_TYPE>
|
||||
inline const typename CONTAINER_TYPE::value_type& next_value_modulo(typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
|
||||
{
|
||||
{
|
||||
return container[next_idx_modulo(idx, container.size())];
|
||||
}
|
||||
|
||||
template<typename CONTAINER_TYPE>
|
||||
inline typename CONTAINER_TYPE::value_type& next_value_modulo(typename CONTAINER_TYPE::size_type idx, CONTAINER_TYPE &container)
|
||||
{
|
||||
{
|
||||
return container[next_idx_modulo(idx, container.size())];
|
||||
}
|
||||
|
||||
|
@ -300,7 +332,7 @@ template<typename T> struct IsTriviallyCopyable : public std::is_trivially_copya
|
|||
struct FilePtr {
|
||||
FilePtr(FILE *f) : f(f) {}
|
||||
~FilePtr() { this->close(); }
|
||||
void close() {
|
||||
void close() {
|
||||
if (this->f) {
|
||||
::fclose(this->f);
|
||||
this->f = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue