OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Utils.hpp File Reference
#include <cstddef>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <cstdint>
#include <cstdio>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/date_time/posix_time/posix_time_io.hpp>
#include <algorithm>
#include <iomanip>
#include <limits>
#include <locale>
#include <set>
#include <string>
#include <sstream>
#include <stdexcept>
#include <utility>
#include <functional>
#include <type_traits>
#include <system_error>
#include <initializer_list>
#include <string_view>
#include <boost/system/error_code.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/date_time.hpp>
#include "boost/date_time/posix_time/ptime.hpp"
#include <openssl/md5.h>
#include <vector>
#include "libslic3r.h"
#include "Semver.hpp"
Include dependency graph for Utils.hpp:

Go to the source code of this file.

Classes

struct  Slic3r::IsTriviallyCopyable< T >
struct  Slic3r::FilePtr
class  Slic3r::ScopeGuard

Namespaces

namespace  boost
namespace  boost::filesystem
namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  Slic3r::PerlUtils

Macros

#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_3MF_NOT_SUPPORT_MACHINE_CHANGE   -15
#define CLI_3MF_NEW_MACHINE_NOT_SUPPORTED   -16
#define CLI_PROCESS_NOT_COMPATIBLE   -17
#define CLI_INVALID_VALUES_IN_3MF   -18
#define CLI_POSTPROCESS_NOT_SUPPORTED   -19
#define CLI_PRINTABLE_SIZE_REDUCED   -20
#define CLI_OBJECT_ARRANGE_FAILED   -21
#define CLI_OBJECT_ORIENT_FAILED   -22
#define CLI_MODIFIED_PARAMS_TO_PRINTER   -23
#define CLI_FILE_VERSION_NOT_SUPPORTED   -24
#define CLI_EXPORT_STATISTICS_ERROR   -25
#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_TIME_EXCEEDS_LIMIT   -58
#define CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT   -59
#define CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP   -60
#define CLI_FILAMENT_NOT_MATCH_BED_TYPE   -61
#define CLI_FILAMENTS_DIFFERENT_TEMP   -62
#define CLI_OBJECT_COLLISION_IN_SEQ_PRINT   -63
#define CLI_OBJECT_COLLISION_IN_LAYER_PRINT   -64
#define CLI_SPIRAL_MODE_INVALID_PARAMS   -65
#define CLI_FILAMENT_CAN_NOT_MAP   -66
#define CLI_ONLY_ONE_TPU_SUPPORTED   -67
#define CLI_FILAMENTS_NOT_SUPPORTED_BY_EXTRUDER   -68
#define CLI_MIXED_FILAMENT_INVALID   -69
#define CLI_SLICING_ERROR   -100
#define CLI_GCODE_PATH_CONFLICTS   -101
#define CLI_GCODE_PATH_IN_UNPRINTABLE_AREA   -102
#define SLIC3R_STDVEC_MEMSIZE(NAME, TYPE)
#define SLIC3R_STDUNORDEREDSET_MEMSIZE(NAME, TYPE)

Typedefs

typedef std::string Slic3r::local_encoded_string

Enumerations

enum  Slic3r::CopyFileResult {
  Slic3r::SUCCESS = 0 , Slic3r::FAIL_COPY_FILE , Slic3r::FAIL_FILES_DIFFERENT , Slic3r::FAIL_RENAMING ,
  Slic3r::FAIL_CHECK_ORIGIN_NOT_OPENED , Slic3r::FAIL_CHECK_TARGET_NOT_OPENED
}

Functions

void Slic3r::set_logging_level (unsigned int level)
void Slic3r::set_logging_file (const std::string &file)
unsigned int Slic3r::level_string_to_boost (std::string level)
std::string Slic3r::get_string_logging_level (unsigned level)
unsigned Slic3r::get_logging_level ()
void Slic3r::trace (unsigned int level, const char *message)
std::string Slic3r::format_memsize_MB (size_t n)
std::string Slic3r::format_memsize (size_t bytes, unsigned int decimals)
std::string Slic3r::log_memory_info (bool ignore_loglevel)
void Slic3r::disable_multi_threading ()
size_t Slic3r::total_physical_memory ()
void Slic3r::set_var_dir (const std::string &dir)
const std::string & Slic3r::var_dir ()
std::string Slic3r::var (const std::string &file_name)
std::string Slic3r::format_diameter_to_str (double diameter, int precision)
void Slic3r::set_resources_dir (const std::string &dir)
const std::string & Slic3r::resources_dir ()
void Slic3r::set_temporary_dir (const std::string &dir)
const std::string & Slic3r::temporary_dir ()
std::string Slic3r::convert_to_full_version (std::string short_version)
template<typename DataType>
DataType Slic3r::round_divide (DataType dividend, DataType divisor)
template<typename From, typename To>
std::vector< To > Slic3r::convert_vector (const std::vector< From > &src)
void Slic3r::set_local_dir (const std::string &dir)
const std::string & Slic3r::localization_dir ()
void Slic3r::set_sys_shapes_dir (const std::string &dir)
const std::string & Slic3r::sys_shapes_dir ()
std::string Slic3r::custom_shapes_dir ()
std::string Slic3r::handy_models_dir ()
void Slic3r::set_custom_gcodes_dir (const std::string &dir)
const std::string & Slic3r::custom_gcodes_dir ()
void Slic3r::set_data_dir (const std::string &dir)
const std::string & Slic3r::data_dir ()
bool Slic3r::makedir (const std::string path)
std::string Slic3r::debug_out_path (const char *name,...)
void Slic3r::set_log_path_and_level (const std::string &file, unsigned int level)
void Slic3r::flush_logs ()
void Slic3r::shutdown_console_logging ()
boost::filesystem::path Slic3r::get_log_file_name ()
size_t Slic3r::get_utf8_sequence_length (const std::string &text, size_t pos)
size_t Slic3r::get_utf8_sequence_length (const char *seq, size_t size)
std::string Slic3r::encode_path (const char *src)
std::string Slic3r::decode_path (const char *src)
std::string Slic3r::normalize_utf8_nfc (const char *src)
std::vector< std::string > Slic3r::split_string (const std::string &str, char delimiter)
std::error_code Slic3r::rename_file (const std::string &from, const std::string &to)
std::error_code Slic3r::write_file_atomically (const std::string &path, std::initializer_list< std::string_view > chunks, bool binary)
std::error_code Slic3r::write_file_atomically (const std::string &path, const std::string &content, bool binary=false)
CopyFileResult Slic3r::copy_file_inner (const std::string &from, const std::string &to, std::string &error_message)
CopyFileResult Slic3r::copy_file (const std::string &from, const std::string &to, std::string &error_message, const bool with_check)
bool Slic3r::copy_framework (const std::string &from, const std::string &to)
CopyFileResult Slic3r::check_copy (const std::string &origin, const std::string &copy)
bool Slic3r::is_plain_file (const boost::filesystem::directory_entry &dir_entry)
bool Slic3r::is_ini_file (const boost::filesystem::directory_entry &dir_entry)
bool Slic3r::is_idx_file (const boost::filesystem::directory_entry &dir_entry)
bool Slic3r::is_gcode_file (const std::string &path)
bool Slic3r::is_img_file (const std::string &path)
bool Slic3r::is_gallery_file (const boost::filesystem::directory_entry &dir_entry, char const *type)
bool Slic3r::is_gallery_file (const std::string &path, char const *type)
bool Slic3r::is_shapes_dir (const std::string &dir)
bool Slic3r::is_json_file (const std::string &path)
bool Slic3r::is_path_within_root (const std::string &rel_path, const boost::filesystem::path &root)
bool Slic3r::is_symlink_target_within_root (const std::string &link_rel_path, const std::string &target, const boost::filesystem::path &root)
bool Slic3r::is_absolute_path_within_root (const boost::filesystem::path &path, const boost::filesystem::path &root)
bool Slic3r::is_safe_to_open_file_name (const std::string &file_name)
bool Slic3r::ascii_iequals (std::string_view a, std::string_view b)
bool Slic3r::is_orca_open (const std::string &url)
bool Slic3r::is_prusaslicer_open (const std::string &url)
bool Slic3r::is_bambustudio_open (const std::string &url)
bool Slic3r::is_cura_open (const std::string &url)
bool Slic3r::is_supported_open_protocol (const std::string &url)
bool Slic3r::is_printables_link (const std::string &url)
bool Slic3r::is_makerworld_link (const std::string &url)
bool Slic3r::is_thingiverse_link (const std::string &url)
std::string Slic3r::sanitize_filename (const std::string &filename)
std::string Slic3r::sanitize_file_basename (const std::string &name)
boost::filesystem::path Slic3r::download_marker_path (const boost::filesystem::path &dest_folder, const std::string &filename)
bool Slic3r::find_unused_filename (const boost::filesystem::path &dest_folder, const std::string &filename, const boost::filesystem::path &ignored_marker, std::string &result)
std::string Slic3r::PerlUtils::path_to_filename (const char *src)
std::string Slic3r::PerlUtils::path_to_stem (const char *src)
std::string Slic3r::PerlUtils::path_to_extension (const char *src)
std::string Slic3r::PerlUtils::path_to_parent_path (const char *src)
std::string Slic3r::string_printf (const char *format,...)
std::string Slic3r::header_slic3r_generated ()
std::string Slic3r::header_gcodeviewer_generated ()
unsigned Slic3r::get_current_pid ()
std::string Slic3r::per_user_temp_id ()
std::string Slic3r::per_user_temp_dir (const std::string &base, const std::string &user_id)
std::string Slic3r::resolve_cli_input_path (const std::string &path)
std::string Slic3r::get_process_name (int pid)
uint16_t Slic3r::next_highest_power_of_2 (uint16_t v)
uint32_t Slic3r::next_highest_power_of_2 (uint32_t v)
uint64_t Slic3r::next_highest_power_of_2 (uint64_t v)
template<class T>
size_t Slic3r::next_highest_power_of_2 (T v, typename std::enable_if< std::is_same< T, size_t >::value, T >::type=0, typename std::enable_if<!std::is_same< T, uint64_t >::value, T >::type=0, typename std::enable_if<!std::is_same< T, uint32_t >::value, T >::type=0, typename std::enable_if< sizeof(T)==8, T >::type=0)
template<class T>
size_t Slic3r::next_highest_power_of_2 (T v, typename std::enable_if< std::is_same< T, size_t >::value, T >::type=0, typename std::enable_if<!std::is_same< T, uint64_t >::value, T >::type=0, typename std::enable_if<!std::is_same< T, uint32_t >::value, T >::type=0, typename std::enable_if< sizeof(T)==4, T >::type=0)
template<class VectorType>
void Slic3r::reserve_power_of_2 (VectorType &vector, size_t n)
template<class VectorType>
void Slic3r::reserve_more (VectorType &vector, size_t n)
template<class VectorType>
void Slic3r::reserve_more_power_of_2 (VectorType &vector, size_t n)
template<typename INDEX_TYPE>
INDEX_TYPE Slic3r::prev_idx_modulo (INDEX_TYPE idx, const INDEX_TYPE count)
template<typename INDEX_TYPE>
INDEX_TYPE Slic3r::next_idx_modulo (INDEX_TYPE idx, const INDEX_TYPE count)
template<typename INDEX_TYPE>
INDEX_TYPE Slic3r::round_up_divide (const INDEX_TYPE dividend, const INDEX_TYPE divisor)
template<typename CONTAINER_TYPE>
CONTAINER_TYPE::size_type Slic3r::prev_idx_modulo (typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
template<typename CONTAINER_TYPE>
CONTAINER_TYPE::size_type Slic3r::next_idx_modulo (typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
template<typename CONTAINER_TYPE>
const CONTAINER_TYPE::value_type & Slic3r::prev_value_modulo (typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
template<typename CONTAINER_TYPE>
CONTAINER_TYPE::value_type & Slic3r::prev_value_modulo (typename CONTAINER_TYPE::size_type idx, CONTAINER_TYPE &container)
template<typename CONTAINER_TYPE>
const CONTAINER_TYPE::value_type & Slic3r::next_value_modulo (typename CONTAINER_TYPE::size_type idx, const CONTAINER_TYPE &container)
template<typename CONTAINER_TYPE>
CONTAINER_TYPE::value_type & Slic3r::next_value_modulo (typename CONTAINER_TYPE::size_type idx, CONTAINER_TYPE &container)
std::string Slic3r::xml_escape (std::string text, bool is_marked)
std::string Slic3r::xml_escape_double_quotes_attribute_value (std::string text)
std::string Slic3r::xml_unescape (std::string s)
std::string Slic3r::short_time (const std::string &time)
std::string Slic3r::get_time_dhms (float time_in_secs)
std::string Slic3r::get_bbl_time_dhms (float time_in_secs)
std::string Slic3r::get_timezone_utc_hm (long second)
std::string Slic3r::get_time_dhm (float time_in_secs)
std::string Slic3r::get_time_hms (float time_in_secs)
std::string Slic3r::get_bbl_monitor_time_dhm (float time_in_secs)
std::string Slic3r::get_bbl_monitor_end_time_dhm (float time_in_secs)
std::string Slic3r::get_bbl_remain_time_dhms (float time_in_secs)
bool Slic3r::bbl_calc_md5 (std::string &filename, std::string &md5_out)
std::string Slic3r::filter_characters (const std::string &str, const std::string &filterChars)
void Slic3r::copy_directory_recursively (const boost::filesystem::path &source, const boost::filesystem::path &target, std::function< bool(const std::string)> filter, bool merge_mode)
bool Slic3r::is_vendor_installed (const std::string &vendor)
Semver Slic3r::installed_vendor_version (const std::string &vendor)
void Slic3r::remove_installed_vendor (const std::string &vendor)
std::set< std::string > Slic3r::vendor_names_in (const boost::filesystem::path &dir)
Semver Slic3r::resource_vendor_version (const std::string &vendor)
bool Slic3r::install_vendor_bundles_from_resources (const std::vector< std::string > &bundle_names, const std::string &resource_subdir, const std::string &data_subdir)
void Slic3r::save_string_file (const boost::filesystem::path &p, const std::string &str)
void Slic3r::load_string_file (const boost::filesystem::path &p, std::string &str)
bool Slic3r::check_layer_id_pattern (const std::string &pattern, int layer_id)
boost::filesystem::path Slic3r::extended_path (const boost::filesystem::path &path)

Macro Definition Documentation

◆ CLI_3MF_NEW_MACHINE_NOT_SUPPORTED

#define CLI_3MF_NEW_MACHINE_NOT_SUPPORTED   -16

Referenced by Slic3r::CLI::run().

◆ CLI_3MF_NOT_SUPPORT_MACHINE_CHANGE

#define CLI_3MF_NOT_SUPPORT_MACHINE_CHANGE   -15

◆ CLI_CONFIG_FILE_ERROR

#define CLI_CONFIG_FILE_ERROR   -5

Referenced by Slic3r::CLI::run().

◆ CLI_COPY_OBJECTS_ERROR

#define CLI_COPY_OBJECTS_ERROR   -9

Referenced by Slic3r::CLI::run().

◆ CLI_DATA_FILE_ERROR

#define CLI_DATA_FILE_ERROR   -6

◆ CLI_ENVIRONMENT_ERROR

#define CLI_ENVIRONMENT_ERROR   -1

Referenced by Slic3r::CLI::run().

◆ CLI_EXPORT_3MF_ERROR

#define CLI_EXPORT_3MF_ERROR   -13

Referenced by Slic3r::CLI::run().

◆ CLI_EXPORT_CACHE_DIRECTORY_CREATE_FAILED

#define CLI_EXPORT_CACHE_DIRECTORY_CREATE_FAILED   -53

◆ CLI_EXPORT_CACHE_WRITE_FAILED

#define CLI_EXPORT_CACHE_WRITE_FAILED   -54

◆ CLI_EXPORT_OBJ_ERROR

#define CLI_EXPORT_OBJ_ERROR   -12

Referenced by Slic3r::CLI::run().

◆ CLI_EXPORT_STATISTICS_ERROR

#define CLI_EXPORT_STATISTICS_ERROR   -25

Referenced by Slic3r::CLI::run().

◆ CLI_EXPORT_STL_ERROR

#define CLI_EXPORT_STL_ERROR   -11

Referenced by Slic3r::CLI::run().

◆ CLI_FILAMENT_CAN_NOT_MAP

#define CLI_FILAMENT_CAN_NOT_MAP   -66

Referenced by Slic3r::CLI::run().

◆ CLI_FILAMENT_NOT_MATCH_BED_TYPE

#define CLI_FILAMENT_NOT_MATCH_BED_TYPE   -61

Referenced by Slic3r::CLI::run().

◆ CLI_FILAMENTS_DIFFERENT_TEMP

#define CLI_FILAMENTS_DIFFERENT_TEMP   -62

Referenced by Slic3r::CLI::run().

◆ CLI_FILAMENTS_NOT_SUPPORTED_BY_EXTRUDER

#define CLI_FILAMENTS_NOT_SUPPORTED_BY_EXTRUDER   -68

Referenced by Slic3r::CLI::run().

◆ CLI_FILE_NOTFOUND

#define CLI_FILE_NOTFOUND   -3

◆ CLI_FILE_VERSION_NOT_SUPPORTED

#define CLI_FILE_VERSION_NOT_SUPPORTED   -24

Referenced by Slic3r::CLI::run().

◆ CLI_FILELIST_INVALID_ORDER

#define CLI_FILELIST_INVALID_ORDER   -4

Referenced by Slic3r::CLI::run().

◆ CLI_GCODE_PATH_CONFLICTS

#define CLI_GCODE_PATH_CONFLICTS   -101

Referenced by Slic3r::CLI::run().

◆ CLI_GCODE_PATH_IN_UNPRINTABLE_AREA

#define CLI_GCODE_PATH_IN_UNPRINTABLE_AREA   -102

Referenced by Slic3r::CLI::run().

◆ CLI_IMPORT_CACHE_DATA_CAN_NOT_USE

#define CLI_IMPORT_CACHE_DATA_CAN_NOT_USE   -56

◆ CLI_IMPORT_CACHE_LOAD_FAILED

#define CLI_IMPORT_CACHE_LOAD_FAILED   -57

◆ CLI_IMPORT_CACHE_NOT_FOUND

#define CLI_IMPORT_CACHE_NOT_FOUND   -55

◆ CLI_INVALID_PARAMS

#define CLI_INVALID_PARAMS   -2

◆ CLI_INVALID_PRINTER_TECH

#define CLI_INVALID_PRINTER_TECH   -7

Referenced by Slic3r::CLI::run().

◆ CLI_INVALID_VALUES_IN_3MF

#define CLI_INVALID_VALUES_IN_3MF   -18

Referenced by Slic3r::CLI::run().

◆ CLI_MIXED_FILAMENT_INVALID

#define CLI_MIXED_FILAMENT_INVALID   -69

Referenced by Slic3r::CLI::run().

◆ CLI_MODIFIED_PARAMS_TO_PRINTER

#define CLI_MODIFIED_PARAMS_TO_PRINTER   -23

Referenced by Slic3r::CLI::run().

◆ CLI_NO_SUITABLE_OBJECTS

#define CLI_NO_SUITABLE_OBJECTS   -50

Referenced by Slic3r::CLI::run().

◆ CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP

#define CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP   -60

Referenced by Slic3r::CLI::run().

◆ CLI_OBJECT_ARRANGE_FAILED

#define CLI_OBJECT_ARRANGE_FAILED   -21

Referenced by Slic3r::CLI::run().

◆ CLI_OBJECT_COLLISION_IN_LAYER_PRINT

#define CLI_OBJECT_COLLISION_IN_LAYER_PRINT   -64

Referenced by Slic3r::CLI::run().

◆ CLI_OBJECT_COLLISION_IN_SEQ_PRINT

#define CLI_OBJECT_COLLISION_IN_SEQ_PRINT   -63

Referenced by Slic3r::CLI::run().

◆ CLI_OBJECT_ORIENT_FAILED

#define CLI_OBJECT_ORIENT_FAILED   -22

◆ CLI_OBJECTS_PARTLY_INSIDE

#define CLI_OBJECTS_PARTLY_INSIDE   -52

Referenced by Slic3r::CLI::run().

◆ CLI_ONLY_ONE_TPU_SUPPORTED

#define CLI_ONLY_ONE_TPU_SUPPORTED   -67

Referenced by Slic3r::CLI::run().

◆ CLI_OUT_OF_MEMORY

#define CLI_OUT_OF_MEMORY   -14

◆ CLI_POSTPROCESS_NOT_SUPPORTED

#define CLI_POSTPROCESS_NOT_SUPPORTED   -19

Referenced by Slic3r::CLI::run().

◆ CLI_PRINTABLE_SIZE_REDUCED

#define CLI_PRINTABLE_SIZE_REDUCED   -20

◆ CLI_PROCESS_NOT_COMPATIBLE

#define CLI_PROCESS_NOT_COMPATIBLE   -17

Referenced by Slic3r::CLI::run().

◆ CLI_SCALE_TO_FIT_ERROR

#define CLI_SCALE_TO_FIT_ERROR   -10

Referenced by Slic3r::CLI::run().

◆ CLI_SLICING_ERROR

#define CLI_SLICING_ERROR   -100

Referenced by Slic3r::CLI::run().

◆ CLI_SLICING_TIME_EXCEEDS_LIMIT

#define CLI_SLICING_TIME_EXCEEDS_LIMIT   -58

Referenced by Slic3r::CLI::run().

◆ CLI_SPIRAL_MODE_INVALID_PARAMS

#define CLI_SPIRAL_MODE_INVALID_PARAMS   -65

◆ CLI_SUCCESS

#define CLI_SUCCESS   0

Referenced by Slic3r::CLI::run().

◆ CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT

#define CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT   -59

Referenced by Slic3r::CLI::run().

◆ CLI_UNSUPPORTED_OPERATION

#define CLI_UNSUPPORTED_OPERATION   -8

Referenced by Slic3r::CLI::run().

◆ CLI_VALIDATE_ERROR

#define CLI_VALIDATE_ERROR   -51

Referenced by Slic3r::CLI::run().

◆ SLIC3R_STDUNORDEREDSET_MEMSIZE

#define SLIC3R_STDUNORDEREDSET_MEMSIZE ( NAME,
TYPE )
Value:
NAME.size() * ((sizeof(TYPE) + alignof(TYPE) - 1) / alignof(TYPE)) * alignof(TYPE)

◆ SLIC3R_STDVEC_MEMSIZE

#define SLIC3R_STDVEC_MEMSIZE ( NAME,
TYPE )
Value:
NAME.capacity() * ((sizeof(TYPE) + alignof(TYPE) - 1) / alignof(TYPE)) * alignof(TYPE)