0f3cabb5d9
config bundles, project files (3MFs, AMFs). When loading these files, the caller may decide whether to substitute some of the configuration values the current PrusaSlicer version does not understand with some reasonable default value, and whether to report it. If substitution is disabled, an exception is being thrown as before this commit. If substitution is enabled, list of substitutions is returned by the API to be presented to the user. This allows us to introduce for example new firmware flavor key in PrusaSlicer 2.4 while letting PrusaSlicer 2.3.2 to fall back to some default and to report it to the user. When slicing from command line, substutions are performed by default and reported into the console, however substitutions may be either disabled or made silent with the new "config-compatibility" command line option. Substitute enums and bools only. Allow booleans to be parsed as true: "1", "enabled", "on" case insensitive false: "0", "disabled", "off" case insensitive This will allow us in the future for example to switch the draft_shield boolean to an enum with the following values: "disabled" / "enabled" / "limited". Added "enum_bitmask.hpp" - support for type safe sets of options. See for example PresetBundle::load_configbundle(... LoadConfigBundleAttributes flags) for an example of intended usage. WIP: GUI for reporting the list of config substitutions needs to be implemented by @YuSanka.
133 lines
3.4 KiB
C++
133 lines
3.4 KiB
C++
#ifdef WIN32
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#endif
|
|
#ifndef NOMINMAX
|
|
#define NOMINMAX
|
|
#endif
|
|
#endif
|
|
|
|
#include <float.h>
|
|
#include <math.h>
|
|
#include <stdarg.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
|
|
#include <cassert>
|
|
#include <climits>
|
|
#include <cmath>
|
|
#include <cstddef>
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
#include <cstring>
|
|
#include <ctime>
|
|
|
|
#include <algorithm>
|
|
#include <atomic>
|
|
#include <deque>
|
|
#include <exception>
|
|
#include <fstream>
|
|
#include <functional>
|
|
#include <iostream>
|
|
#include <istream>
|
|
#include <limits>
|
|
#include <list>
|
|
#include <locale>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <numeric>
|
|
#include <ostream>
|
|
#include <queue>
|
|
#include <regex>
|
|
#include <set>
|
|
#include <sstream>
|
|
#include <stack>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <thread>
|
|
#include <type_traits>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
#include <boost/algorithm/string.hpp>
|
|
#include <boost/algorithm/string/case_conv.hpp>
|
|
#include <boost/algorithm/string/classification.hpp>
|
|
#include <boost/algorithm/string/erase.hpp>
|
|
#include <boost/algorithm/string/find.hpp>
|
|
#include <boost/algorithm/string/predicate.hpp>
|
|
#include <boost/algorithm/string/replace.hpp>
|
|
#include <boost/algorithm/string/split.hpp>
|
|
#include <boost/algorithm/string/trim.hpp>
|
|
#include <boost/bind/bind.hpp>
|
|
#include <boost/config.hpp>
|
|
#include <boost/config/warning_disable.hpp>
|
|
#include <boost/container/small_vector.hpp>
|
|
#include <boost/date_time/local_time/local_time.hpp>
|
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
#include <boost/filesystem.hpp>
|
|
#include <boost/filesystem/path.hpp>
|
|
#include <boost/foreach.hpp>
|
|
#include <boost/format.hpp>
|
|
#include <boost/geometry.hpp>
|
|
#include <boost/geometry/geometries/box.hpp>
|
|
#include <boost/geometry/geometries/point.hpp>
|
|
#include <boost/geometry/geometries/point_xy.hpp>
|
|
#include <boost/geometry/index/rtree.hpp>
|
|
#include <boost/lexical_cast.hpp>
|
|
#include <boost/locale.hpp>
|
|
#include <boost/log/core.hpp>
|
|
#include <boost/log/expressions.hpp>
|
|
#include <boost/log/trivial.hpp>
|
|
#include <boost/multi_array.hpp>
|
|
#include <boost/nowide/cenv.hpp>
|
|
#include <boost/nowide/convert.hpp>
|
|
#include <boost/nowide/cstdio.hpp>
|
|
#include <boost/nowide/cstdlib.hpp>
|
|
#include <boost/nowide/fstream.hpp>
|
|
#include <boost/nowide/integration/filesystem.hpp>
|
|
#include <boost/nowide/iostream.hpp>
|
|
|
|
// boost/property_tree/json_parser/detail/parser.hpp includes boost/bind.hpp, which is deprecated.
|
|
// Suppress the following boost message:
|
|
// The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated.
|
|
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
|
|
#include <boost/property_tree/ini_parser.hpp>
|
|
#include <boost/property_tree/ptree.hpp>
|
|
#undef BOOST_BIND_GLOBAL_PLACEHOLDERS
|
|
|
|
#include <boost/thread.hpp>
|
|
#include <boost/version.hpp>
|
|
|
|
#include <tbb/parallel_for.h>
|
|
#include <tbb/spin_mutex.h>
|
|
#include <tbb/task_group.h>
|
|
|
|
#include <Eigen/Dense>
|
|
#include <Eigen/Geometry>
|
|
|
|
#include <cereal/access.hpp>
|
|
#include <cereal/types/base_class.hpp>
|
|
|
|
#include <clipper/clipper_z.hpp>
|
|
#include "clipper.hpp"
|
|
#include "BoundingBox.hpp"
|
|
#include "ClipperUtils.hpp"
|
|
#include "Config.hpp"
|
|
#include "enum_bitmask.hpp"
|
|
#include "format.hpp"
|
|
#include "I18N.hpp"
|
|
#include "MultiPoint.hpp"
|
|
#include "Point.hpp"
|
|
#include "Polygon.hpp"
|
|
#include "Polyline.hpp"
|
|
#include "SVG.hpp"
|
|
|
|
#include "libslic3r.h"
|
|
#include "libslic3r_version.h"
|
|
|
|
#include <Shiny/Shiny.h>
|
|
|
|
#include <admesh/stl.h>
|