diff --git a/.clang-tidy b/.clang-tidy
index ed2378536e..ab2a1dfbd7 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,10 +1,15 @@
# clang-tidy configuration, enforced by the clang-tidy CI job on the lines a pull
-# request changes (scripts/clang_tidy_diff.py). Only missing includes are reported
-# for now: a file should include the header for every symbol it uses, not rely on
-# the precompiled header or another header's includes. Run with --fix to add them.
+# request changes (scripts/clang_tidy_diff.py). Two things are reported.
+# Missing includes: a file should include the header for every symbol it uses, not
+# rely on the precompiled header or another header's includes. Run with --fix to
+# add them.
+# Using-directives and using-declarations in the global namespace of a header:
+# they reach every file that includes the header, and a using-declaration also
+# makes the header look like the one to include for that name. Qualify the name
+# in the header, and put the using in the source files that want it.
# Every check listed here gates pull requests, so enable a new one only once the
# code it flags on touched lines is reasonable to fix in passing.
-Checks: '-*,misc-include-cleaner'
+Checks: '-*,misc-include-cleaner,google-global-names-in-headers'
WarningsAsErrors: '*'
CheckOptions:
# Missing includes only. Builds without the precompiled header break on these.
diff --git a/.claude/skills/orca-profiles/references/extruder-variants.md b/.claude/skills/orca-profiles/references/extruder-variants.md
index 5059fd5c6b..633443cbab 100644
--- a/.claude/skills/orca-profiles/references/extruder-variants.md
+++ b/.claude/skills/orca-profiles/references/extruder-variants.md
@@ -105,11 +105,12 @@ Rules:
`single_extruder_multi_material` off, and in the app when the printer tab loads a printer with a
different number of extruders, the pair is rebuilt from `extruder_variant_list` (one
`Direct Drive Standard` per extruder when the list is absent) and the variant arrays are resized to
- the rebuilt pair, padded with their first value or cut. The resize skips the `machine_max_*` limits
- and `hotend_heating_rate` / `hotend_cooling_rate`: they keep their width, and an extruder beyond it
- reads their first value, so extruder 2 and up of a list-less printer take extruder 1's normal limit
- as their silent one too. With the three in agreement that changes nothing; a pair written without
- the list is replaced. A listed variant the pair lacks is a menu choice that reads variant index 0.
+ the rebuilt pair, padded with their first value or cut. The `machine_max_*` limits are padded the
+ same way, so extruder 2 and up of a list-less printer take extruder 1's normal limit as their
+ silent one too. The resize skips `hotend_heating_rate` / `hotend_cooling_rate`: they keep their
+ width, and an extruder beyond it reads their first value. With the three in agreement that changes
+ nothing; a pair written without the list is replaced. A listed variant the pair lacks is a menu
+ choice that reads variant index 0.
- The pair without `extruder_variant_list` slices, but the sidebar offers no variant switch and
the app cannot add variants to a list-less process: nothing is lost while every extruder
has exactly one variant, and every further variant is unreachable.
diff --git a/AGENTS.md b/AGENTS.md
index 51db547133..8e7b141718 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -4,15 +4,17 @@ OrcaSlicer — open-source C++17 3D slicer. wxWidgets GUI, CMake build system.
## Build Commands
+Build the Release configuration unless asked otherwise.
+
```bash
# macOS
-cmake --build build/arm64 --config RelWithDebInfo --target all --
+cmake --build build/arm64 --config Release --target all --
# Linux
-cmake --build build --config RelWithDebInfo --target all --
+cmake --build build --config Release --target all --
-# Windows (replace %build_type% with Debug/Release/RelWithDebInfo)
-cmake --build . --config %build_type% --target ALL_BUILD -- -m
+# Windows
+cmake --build . --config Release --target ALL_BUILD -- -m
```
## Testing
diff --git a/localization/i18n/list.txt b/localization/i18n/list.txt
index 981e7a040a..b1ebb54f5e 100644
--- a/localization/i18n/list.txt
+++ b/localization/i18n/list.txt
@@ -295,8 +295,6 @@ src/slic3r/GUI/CAD/DesignSketchTool.cpp
src/slic3r/GUI/CAD/SketchInlineEditor.cpp
src/slic3r/GUI/CAD/DesignOffer.hpp
src/slic3r/GUI/CAD/DesignTextDialog.cpp
-src/slic3r/GUI/Gizmos/GLGizmoPrimitive.cpp
-src/slic3r/GUI/Gizmos/GLGizmoSketch.cpp
src/slic3r/GUI/KeyChord.cpp
src/slic3r/GUI/Shortcuts.cpp
src/libslic3r/CAD/CadDocument.cpp
diff --git a/resources/images/toolbar_modifier_cube_dark.svg b/resources/images/toolbar_modifier_cube_dark.svg
deleted file mode 100644
index 7e20cd0dd5..0000000000
--- a/resources/images/toolbar_modifier_cube_dark.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/resources/images/toolbar_sketch.svg b/resources/images/toolbar_sketch.svg
deleted file mode 100644
index 351b3e7924..0000000000
--- a/resources/images/toolbar_sketch.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/resources/images/toolbar_sketch_dark.svg b/resources/images/toolbar_sketch_dark.svg
deleted file mode 100644
index e5cf8d6859..0000000000
--- a/resources/images/toolbar_sketch_dark.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/resources/web/guide/21/common.js b/resources/web/guide/21/common.js
index 9a3c76c248..d0cc510540 100644
--- a/resources/web/guide/21/common.js
+++ b/resources/web/guide/21/common.js
@@ -311,7 +311,7 @@ function CreatePrinterBlock(OneModel)
return '
'+
'
'+
- '
'+
+ '
'+
'
'+
'
?
'+
'
'+
diff --git a/resources/web/guide/img/printer-dummy.png b/resources/web/guide/img/printer-dummy.png
new file mode 100644
index 0000000000..279f80a827
Binary files /dev/null and b/resources/web/guide/img/printer-dummy.png differ
diff --git a/scripts/appimage_lib_policy.sh b/scripts/appimage_lib_policy.sh
index 35925227a0..81936d83c6 100755
--- a/scripts/appimage_lib_policy.sh
+++ b/scripts/appimage_lib_policy.sh
@@ -23,7 +23,13 @@ appimage_is_host_library() {
}
appimage_is_elf_file() {
- file -b "$1" 2>/dev/null | grep -q '^ELF '
+ # Read the four-byte ELF magic rather than asking file(1): this runs once per candidate, and an
+ # AppDir holds thousands of them (the bundled Python runtime alone is ~5k files, none of them
+ # ELF). Two processes per call made this ~14 s of a ~95 s image build on its own.
+ local magic
+ [[ -f "$1" && -r "$1" ]] || return 1
+ IFS= read -r -n 4 -d '' magic < "$1" 2>/dev/null
+ [[ $magic == $'\177ELF' ]]
}
appimage_list_direct_dependencies() {
diff --git a/scripts/clang_tidy_diff.py b/scripts/clang_tidy_diff.py
index 130e4661df..1e716b6baf 100644
--- a/scripts/clang_tidy_diff.py
+++ b/scripts/clang_tidy_diff.py
@@ -311,11 +311,12 @@ def main():
for path in fixed:
print(f" {path}")
if failed and fixed:
- print(f"\nclang-tidy still fails on {len(failed)} file(s); the findings above are what --fix could not add.")
+ print(f"\nclang-tidy still fails on {len(failed)} file(s); the findings above are what --fix could not fix.")
return 1
if failed:
print(f"\nclang-tidy failed on {len(failed)} file(s). Add the includes it names, or apply its "
- "suggestions locally with scripts/run_clang_tidy.sh --fix (scripts\\run_clang_tidy.ps1 -Fix on Windows).")
+ "suggestions locally with scripts/run_clang_tidy.sh --fix (scripts\\run_clang_tidy.ps1 -Fix on Windows). "
+ "Other findings need a manual fix.")
return 1
print("clang-tidy passed.")
return 0
diff --git a/scripts/disable_validation.entitlements b/scripts/disable_validation.entitlements
index 123d12a53e..af12034ce0 100644
--- a/scripts/disable_validation.entitlements
+++ b/scripts/disable_validation.entitlements
@@ -4,5 +4,10 @@
com.apple.security.cs.disable-library-validation
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp
index 170a27a53a..854a05bbd9 100644
--- a/src/OrcaSlicer.cpp
+++ b/src/OrcaSlicer.cpp
@@ -23,7 +23,6 @@
#include
#include
#include "libslic3r/PrintBase.hpp"
-#include "slic3r/Utils/json_diff.hpp"
#include
#include
#include
@@ -78,12 +77,10 @@
#include
#include
#include
-//add json logic
-#include "nlohmann/json.hpp"
-
-using namespace nlohmann;
#endif
+#include "nlohmann/json.hpp"
+
#include
#include
#include
@@ -157,6 +154,7 @@ using namespace nlohmann;
#include
namespace fs = boost::filesystem;
+using json = nlohmann::json;
#ifdef __WXGTK__
#if __has_include()
@@ -3529,7 +3527,7 @@ int CLI::run(int argc, char **argv)
ConfigOptionStrings *curr_variant_opt = m_print_config.option("filament_extruder_variant");
if (!curr_variant_opt) {
curr_variant_opt = m_print_config.option("filament_extruder_variant", true);
- std::vector& filament_variants = curr_variant_opt->values;
+ std::vector& filament_variants = curr_variant_opt->values;
filament_variants.resize(filament_count, get_extruder_variant_string(etDirectDrive, nvtStandard));
}
// See the filament_self_index note above: one variant per filament for
@@ -3640,6 +3638,9 @@ int CLI::run(int argc, char **argv)
{
if (opt_key == "compatible_prints" || opt_key == "compatible_printers" || opt_key == "model_id" || opt_key == "dev_model_name" || opt_key == "filament_settings_id")
continue;
+ // rebuilt from every filament after this loop
+ if (filament_dev_options.find(opt_key) != filament_dev_options.end())
+ continue;
ConfigOption *opt = m_print_config.option(opt_key, true);
if (opt == nullptr) {
// opt_key does not exist in this ConfigBase and it cannot be created, because it is not defined by this->def().
@@ -3712,6 +3713,14 @@ int CLI::run(int argc, char **argv)
}
}
+ // The stored values cannot be told apart per filament, so they are kept as they are unless every slot has a config.
+ std::vector filament_configs(filament_count, nullptr);
+ for (size_t index = 0; index < load_filaments_config.size(); index++)
+ if (load_filaments_index[index] >= 1 && load_filaments_index[index] <= filament_count)
+ filament_configs[load_filaments_index[index] - 1] = &load_filaments_config[index];
+ if (std::find(filament_configs.begin(), filament_configs.end(), nullptr) == filament_configs.end())
+ set_filament_dev_options(m_print_config, filament_configs);
+
if (m_print_config.option("filament_extruder_variant")) {
std::vector& filament_self_indice = m_print_config.option("filament_self_index", true)->values;
int index_size = m_print_config.option("filament_extruder_variant")->size();
@@ -6587,7 +6596,7 @@ int CLI::run(int argc, char **argv)
std::vector result_filaments;
//result_filaments.reserve(conflict_filaments.size());
std::set_intersection(conflict_filament_vector.begin(), conflict_filament_vector.end(), unprintable_filament_vec[index].begin(),
- unprintable_filament_vec[index].end(), insert_iterator>(result_filaments, result_filaments.begin()));
+ unprintable_filament_vec[index].end(), std::insert_iterator>(result_filaments, result_filaments.begin()));
conflict_filament_vector = result_filaments;
}
}
diff --git a/src/dev-utils/platform/osx/entitlements.plist b/src/dev-utils/platform/osx/entitlements.plist
index 59274f955f..5ba7ca02e3 100644
--- a/src/dev-utils/platform/osx/entitlements.plist
+++ b/src/dev-utils/platform/osx/entitlements.plist
@@ -5,5 +5,10 @@
com.apple.security.cs.disable-library-validation
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
diff --git a/src/dev-utils/platform/unix/build_linux_image.sh.in b/src/dev-utils/platform/unix/build_linux_image.sh.in
index 873cf2e1b1..8466597d34 100755
--- a/src/dev-utils/platform/unix/build_linux_image.sh.in
+++ b/src/dev-utils/platform/unix/build_linux_image.sh.in
@@ -118,9 +118,13 @@ bundle_dependency_closure() {
# (scripts/check_appimage_libs.sh).
local -a search_dirs=("$dst_dir")
- while [ ${#queue[@]} -gt 0 ]; do
- target="${queue[0]}"
- queue=("${queue[@]:1}")
+ # Walked with a read index rather than by reslicing the array: "${queue[@]:1}" rebuilds the whole
+ # queue on every pop, so draining it costs O(n^2). At the ~5k entries this bundle reaches that was
+ # ~22 s of the image build spent copying an array around.
+ local head=0
+ while [ "$head" -lt ${#queue[@]} ]; do
+ target="${queue[$head]}"
+ head=$((head + 1))
if [ ! -e "$target" ] || ! appimage_is_elf_file "$target"; then
continue
diff --git a/src/libslic3r/AppConfig.hpp b/src/libslic3r/AppConfig.hpp
index 122ca83d11..3afb2bb138 100644
--- a/src/libslic3r/AppConfig.hpp
+++ b/src/libslic3r/AppConfig.hpp
@@ -15,8 +15,6 @@
#include "libslic3r/Semver.hpp"
#include "calib.hpp"
-using namespace nlohmann;
-
#define ENV_DEV_HOST "0"
#define ENV_QAT_HOST "1"
#define ENV_PRE_HOST "2"
diff --git a/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp b/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp
index 3248116169..077ffd1af6 100644
--- a/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp
+++ b/src/libslic3r/Arachne/SkeletalTrapezoidation.cpp
@@ -466,8 +466,6 @@ void SkeletalTrapezoidation::constructFromPolygons(const Polygons& polys)
edge.from->incident_edge = &edge;
}
-using NodeSet = SkeletalTrapezoidation::NodeSet;
-
void SkeletalTrapezoidation::separatePointyQuadEndNodes()
{
NodeSet visited_nodes;
diff --git a/src/libslic3r/Arrange.cpp b/src/libslic3r/Arrange.cpp
index 79d93f7909..eacb122d05 100644
--- a/src/libslic3r/Arrange.cpp
+++ b/src/libslic3r/Arrange.cpp
@@ -93,7 +93,6 @@ using namespace libnest2d;
using Item = _Item;
using Box = _Box;
using Circle = _Circle;
-using Segment = _Segment;
using MultiPolygon = ExPolygons;
// Summon the spatial indexing facilities from boost
diff --git a/src/libslic3r/CAD/CadDocument.cpp b/src/libslic3r/CAD/CadDocument.cpp
index 391ff56a87..cec5a3a74e 100644
--- a/src/libslic3r/CAD/CadDocument.cpp
+++ b/src/libslic3r/CAD/CadDocument.cpp
@@ -62,6 +62,7 @@
#include
#include
#include
+#include
#include // multi-body: compound of bodies for display/compat
#include
#include // outward-normal orientation for face-extrude
diff --git a/src/libslic3r/CAD/GeometryEngine.cpp b/src/libslic3r/CAD/GeometryEngine.cpp
index 827493fb26..454b37fce2 100644
--- a/src/libslic3r/CAD/GeometryEngine.cpp
+++ b/src/libslic3r/CAD/GeometryEngine.cpp
@@ -33,7 +33,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -53,6 +52,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -244,30 +244,6 @@ TopoDS_Shape GeometryEngine::mesh_to_brep(const indexed_triangle_set& its,
return shape;
}
-// ---- Primitive creation ----
-
-TopoDS_Solid GeometryEngine::make_primitive(const PrimitiveParams& params)
-{
- switch (params.type) {
- case PrimitiveType::Box:
- return BRepPrimAPI_MakeBox(gp_Pnt(-params.box_w/2, -params.box_d/2, 0),
- params.box_w, params.box_d, params.box_h).Solid();
- case PrimitiveType::Cylinder:
- return BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)),
- params.cyl_radius, params.cyl_height).Solid();
- case PrimitiveType::Sphere:
- return BRepPrimAPI_MakeSphere(gp_Pnt(0,0,params.sph_radius), params.sph_radius).Solid();
- case PrimitiveType::Cone:
- return BRepPrimAPI_MakeCone(gp_Ax2(gp_Pnt(0,0,0), gp_Dir(0,0,1)),
- params.cone_r1, params.cone_r2, params.cone_height).Solid();
- case PrimitiveType::Torus:
- return BRepPrimAPI_MakeTorus(gp_Ax2(gp_Pnt(0,0,params.torus_r2), gp_Dir(0,0,1)),
- params.torus_r1, params.torus_r2).Solid();
- default:
- return BRepPrimAPI_MakeBox(gp_Pnt(-10,-10,0), 20,20,20).Solid();
- }
-}
-
// ---- Face classification ----
FaceGroup GeometryEngine::classify_face(const TopoDS_Face& face, const TopoDS_Shape& /*solid*/)
@@ -545,19 +521,6 @@ GeometryEngine::MassProps GeometryEngine::mass_properties(const TopoDS_Shape& sh
return p;
}
-std::string GeometryEngine::primitive_name(PrimitiveType type)
-{
- switch (type) {
- // TRN Default name of an object created from the box primitive shape.
- case PrimitiveType::Box: return _u8L("Box");
- case PrimitiveType::Cylinder: return _u8L("Cylinder");
- case PrimitiveType::Sphere: return _u8L("Sphere");
- case PrimitiveType::Cone: return _u8L("Cone");
- case PrimitiveType::Torus: return _u8L("Torus");
- default: return _u8L("Unknown");
- }
-}
-
// ---- Topology accessors ----
int GeometryEngine::face_count(const TopoDS_Shape& shape)
diff --git a/src/libslic3r/CAD/GeometryEngine.hpp b/src/libslic3r/CAD/GeometryEngine.hpp
index e7e92c0438..66f00859be 100644
--- a/src/libslic3r/CAD/GeometryEngine.hpp
+++ b/src/libslic3r/CAD/GeometryEngine.hpp
@@ -4,15 +4,8 @@
#include "libslic3r/Point.hpp"
#include "libslic3r/TriangleMesh.hpp"
-#include
-#include
-#include
-#include
-#include
#include
#include
-#include
-#include
#include
#include
#include
@@ -20,44 +13,11 @@
namespace Slic3r {
-enum class PrimitiveType { Box, Cylinder, Sphere, Cone, Torus, COUNT };
-enum class DressUpType { Fillet, Chamfer };
enum class FaceGroup { Top, Bottom, Lateral, All };
-struct PrimitiveParams {
- PrimitiveType type{PrimitiveType::Box};
- double box_w{20}, box_h{20}, box_d{20};
- double cyl_radius{10}, cyl_height{20};
- double sph_radius{10};
- double cone_r1{10}, cone_r2{5}, cone_height{20};
- double torus_r1{10}, torus_r2{3};
-
- // Dress-up
- bool dressup_enabled{false};
- DressUpType dressup_type{DressUpType::Fillet};
- FaceGroup dressup_faces{FaceGroup::All};
- double dressup_radius{1.0}; // fillet radius
- double dressup_chamfer_dist{1.0}; // chamfer distance (symmetric)
-
- // Mesh quality — the Design tab's own density (CadDocument::linear_deflection), so a
- // primitive and the same body modelled in the Design tab reach the screen alike.
- double linear_deflection{0.003};
- double angular_deflection{0.5};
-
- template
- void serialize(Archive& ar) {
- ar(type, box_w, box_h, box_d, cyl_radius, cyl_height, sph_radius,
- cone_r1, cone_r2, cone_height, torus_r1, torus_r2,
- dressup_enabled, dressup_type, dressup_faces, dressup_radius, dressup_chamfer_dist,
- linear_deflection, angular_deflection);
- }
-};
-
class GeometryEngine
{
public:
- static TopoDS_Solid make_primitive(const PrimitiveParams& params);
-
// Read a STEP file into its top-level solids (one TopoDS_Shape per solid; falls back to
// the whole shape if it contains no closed solids). Reuses OCCT's STEPControl_Reader,
// already linked via Format/STEP.cpp — no new dependency. err is set on failure (empty result).
@@ -132,7 +92,6 @@ public:
static TriangleMesh tessellate(const TopoDS_Shape& shape,
double linear_deflection = 0.003,
double angular_deflection = 0.5);
- static std::string primitive_name(PrimitiveType type);
// Topology accessors for in-viewport face/edge picking (Design tab). Face index is the
// TopExp_Explorer(shape, TopAbs_FACE) ordinal — identical to SketchEngine::tessellate's
diff --git a/src/libslic3r/CAD/SketchEngine.hpp b/src/libslic3r/CAD/SketchEngine.hpp
index 93fbf72cb9..22dade5af0 100644
--- a/src/libslic3r/CAD/SketchEngine.hpp
+++ b/src/libslic3r/CAD/SketchEngine.hpp
@@ -3,7 +3,6 @@
#include "libslic3r/TriangleMesh.hpp"
#include "libslic3r/Point.hpp"
-#include "libslic3r/CAD/GeometryEngine.hpp"
#include
#include
@@ -211,30 +210,6 @@ ConstraintPlan plan_entity_constraint(const std::vector& ents,
bool solve_sketch_entities(std::vector& entities,
const std::vector& constraints);
-struct SketchParams {
- // Extrude/Revolve
- double extrude_len{10}; bool extrude_sym{false}; double extrude_taper{0};
- double revolve_deg{360};
- bool is_pocket{false}; // cut into selected object instead of new
-
- // Dress-up
- bool dressup_enabled{false};
- DressUpType dressup_type{DressUpType::Fillet};
- FaceGroup dressup_faces{FaceGroup::All};
- double dressup_radius{1.0};
- double dressup_chamfer_dist{1.0};
-
- // Mesh
- double linear_deflection{0.01};
-
- template
- void serialize(Archive& ar) {
- ar(extrude_len, extrude_sym, extrude_taper, revolve_deg, is_pocket,
- dressup_enabled, dressup_type, dressup_faces, dressup_radius, dressup_chamfer_dist,
- linear_deflection);
- }
-};
-
class SketchEngine
{
public:
diff --git a/src/libslic3r/ClipperUtils.hpp b/src/libslic3r/ClipperUtils.hpp
index 00cf60076b..26585a1fef 100644
--- a/src/libslic3r/ClipperUtils.hpp
+++ b/src/libslic3r/ClipperUtils.hpp
@@ -23,11 +23,6 @@ enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };
} // namespace Slic3r
-// import these wherever we're included
-using Slic3r::jtMiter;
-using Slic3r::jtRound;
-using Slic3r::jtSquare;
-
namespace Slic3r {
static constexpr const float ClipperSafetyOffset = 10.f;
diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp
index 8967f6c2ba..cf5bd119f4 100644
--- a/src/libslic3r/CutSurface.cpp
+++ b/src/libslic3r/CutSurface.cpp
@@ -2851,7 +2851,6 @@ bool is_patch_inside_of_model(const SurfacePatch &patch,
/// shape point index
uint32_t get_shape_point_index(const CutAOI &cut, const CutMesh &model);
-using PatchNumber = CutMesh::Property_map;
///
/// Separate triangles singned with number n
///
diff --git a/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp b/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp
index ae8d50edb7..301eabebc3 100644
--- a/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp
+++ b/src/libslic3r/Feature/FuzzySkin/FuzzySkin.cpp
@@ -32,8 +32,6 @@
// #define DEBUG_FUZZY
-using namespace Slic3r;
-
namespace Slic3r::Feature::FuzzySkin {
// Produces a random value between 0 and 1. Thread-safe.
diff --git a/src/libslic3r/Fill/FillTpmsFK.cpp b/src/libslic3r/Fill/FillTpmsFK.cpp
index 61dd220e64..164e240280 100644
--- a/src/libslic3r/Fill/FillTpmsFK.cpp
+++ b/src/libslic3r/Fill/FillTpmsFK.cpp
@@ -122,8 +122,6 @@ Polylines get_polylines(const ScalarField& sf, const double tolerance = SCALED_E
namespace Slic3r {
-using namespace std;
-
void FillTpmsFK::_fill_surface_single(const FillParams& params,
unsigned int thickness_layers,
const std::pair& direction,
diff --git a/src/libslic3r/Format/AMF.cpp b/src/libslic3r/Format/AMF.cpp
index 57165794c2..fa28d93f09 100644
--- a/src/libslic3r/Format/AMF.cpp
+++ b/src/libslic3r/Format/AMF.cpp
@@ -25,7 +25,6 @@
#include
#include
#include
-namespace pt = boost::property_tree;
#include
#include
diff --git a/src/libslic3r/GCode/SeamPlacer.cpp b/src/libslic3r/GCode/SeamPlacer.cpp
index cc2bc7ea44..24fed0493c 100644
--- a/src/libslic3r/GCode/SeamPlacer.cpp
+++ b/src/libslic3r/GCode/SeamPlacer.cpp
@@ -1135,7 +1135,6 @@ void SeamPlacer::gather_seam_candidates(const PrintObject *po, const SeamPlacerI
void SeamPlacer::calculate_candidates_visibility(const PrintObject *po,
const SeamPlacerImpl::GlobalModelInfo &global_model_info) {
- using namespace SeamPlacerImpl;
std::vector &layers = m_seam_per_object[po].layers;
tbb::parallel_for(tbb::blocked_range(0, layers.size()),
diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp
index 10b34123b6..979371e304 100644
--- a/src/libslic3r/GCode/ToolOrdering.cpp
+++ b/src/libslic3r/GCode/ToolOrdering.cpp
@@ -1550,7 +1550,6 @@ static FilamentGroupContext build_filament_group_context(
FilamentMapMode mode,
const std::unordered_map& nozzle_status)
{
- using namespace MultiNozzleUtils;
using namespace FilamentGroupUtils;
FilamentGroupContext context;
@@ -1759,7 +1758,6 @@ static std::vector apply_master_extruder_preference(const FilamentGroupCont
// multi-nozzle (H2C/A2L) resolves to a nozzle-granular result.
MultiNozzleUtils::LayeredNozzleGroupResult ToolOrdering::get_recommended_filament_maps(const std::vector>& layer_filaments, const Print* print, const FilamentMapMode mode, const std::vector>& physical_unprintables, const std::vector>& geometric_unprintables, const std::map>& unprintable_volumes, const std::unordered_map& nozzle_status)
{
- using namespace FilamentGroupUtils;
using namespace MultiNozzleUtils;
if (!print || layer_filaments.empty())
diff --git a/src/libslic3r/Geometry/Voronoi.cpp b/src/libslic3r/Geometry/Voronoi.cpp
index 7d59e2d2b8..31f9f974a7 100644
--- a/src/libslic3r/Geometry/Voronoi.cpp
+++ b/src/libslic3r/Geometry/Voronoi.cpp
@@ -16,6 +16,7 @@
namespace Slic3r::Geometry {
+using VD = VoronoiDiagram;
using PolygonsSegmentIndexConstIt = std::vector::const_iterator;
using LinesIt = Lines::iterator;
using ColoredLinesConstIt = ColoredLines::const_iterator;
diff --git a/src/libslic3r/Geometry/VoronoiUtils.cpp b/src/libslic3r/Geometry/VoronoiUtils.cpp
index d0ad07cc7e..305e9128ef 100644
--- a/src/libslic3r/Geometry/VoronoiUtils.cpp
+++ b/src/libslic3r/Geometry/VoronoiUtils.cpp
@@ -20,6 +20,7 @@
namespace Slic3r::Geometry {
+using VD = VoronoiDiagram;
using PolygonsSegmentIndexConstIt = std::vector::const_iterator;
using LinesIt = Lines::iterator;
using ColoredLinesIt = ColoredLines::iterator;
diff --git a/src/libslic3r/Geometry/VoronoiUtils.hpp b/src/libslic3r/Geometry/VoronoiUtils.hpp
index d9b15fd839..13c2492bf9 100644
--- a/src/libslic3r/Geometry/VoronoiUtils.hpp
+++ b/src/libslic3r/Geometry/VoronoiUtils.hpp
@@ -10,8 +10,6 @@
#include "libslic3r/Point.hpp"
#include "libslic3r/libslic3r.h"
-using VD = Slic3r::Geometry::VoronoiDiagram;
-
namespace Slic3r::Geometry {
// Represent trapezoid Voronoi cell around segment.
@@ -19,8 +17,8 @@ template struct SegmentCellRange
{
const PT source_segment_start_point; // The start point of the source segment of this cell.
const PT source_segment_end_point; // The end point of the source segment of this cell.
- const VD::edge_type *edge_begin = nullptr; // The edge of the Voronoi diagram where the loop around the cell starts.
- const VD::edge_type *edge_end = nullptr; // The edge of the Voronoi diagram where the loop around the cell ends.
+ const VoronoiDiagram::edge_type *edge_begin = nullptr; // The edge of the Voronoi diagram where the loop around the cell starts.
+ const VoronoiDiagram::edge_type *edge_end = nullptr; // The edge of the Voronoi diagram where the loop around the cell ends.
SegmentCellRange() = delete;
explicit SegmentCellRange(const PT &source_segment_start_point, const PT &source_segment_end_point)
@@ -34,8 +32,8 @@ template struct SegmentCellRange
template struct PointCellRange
{
const PT source_point; // The source point of this cell.
- const VD::edge_type *edge_begin = nullptr; // The edge of the Voronoi diagram where the loop around the cell starts.
- const VD::edge_type *edge_end = nullptr; // The edge of the Voronoi diagram where the loop around the cell ends.
+ const VoronoiDiagram::edge_type *edge_begin = nullptr; // The edge of the Voronoi diagram where the loop around the cell starts.
+ const VoronoiDiagram::edge_type *edge_end = nullptr; // The edge of the Voronoi diagram where the loop around the cell ends.
PointCellRange() = delete;
explicit PointCellRange(const PT &source_point) : source_point(source_point) {}
@@ -46,20 +44,20 @@ template struct PointCellRange
class VoronoiUtils
{
public:
- static Vec2i64 to_point(const VD::vertex_type *vertex);
+ static Vec2i64 to_point(const VoronoiDiagram::vertex_type *vertex);
- static Vec2i64 to_point(const VD::vertex_type &vertex);
+ static Vec2i64 to_point(const VoronoiDiagram::vertex_type &vertex);
- static bool is_finite(const VD::vertex_type &vertex);
+ static bool is_finite(const VoronoiDiagram::vertex_type &vertex);
- static VD::vertex_type make_rotated_vertex(VD::vertex_type &vertex, double angle);
+ static VoronoiDiagram::vertex_type make_rotated_vertex(VoronoiDiagram::vertex_type &vertex, double angle);
template
static typename boost::polygon::enable_if<
typename boost::polygon::gtl_if::value_type>::type>::type>::type,
typename std::iterator_traits::reference>::type
- get_source_segment(const VD::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
+ get_source_segment(const VoronoiDiagram::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
template
static typename boost::polygon::enable_if<
@@ -73,7 +71,7 @@ public:
typename boost::polygon::gtl_if::value_type>::type>::type>::type,
Arachne::PolygonsPointIndex>::type
- get_source_point_index(const VD::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
+ get_source_point_index(const VoronoiDiagram::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
/**
* Discretize a parabola based on (approximate) step size.
@@ -113,7 +111,7 @@ public:
typename boost::polygon::geometry_concept::value_type>::type>::type>::type,
Geometry::SegmentCellRange<
typename boost::polygon::segment_point_type::value_type>::type>>::type
- compute_segment_cell_range(const VD::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
+ compute_segment_cell_range(const VoronoiDiagram::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
/**
* Compute the range of line segments that surround a cell of the skeletal
@@ -140,19 +138,19 @@ public:
typename boost::polygon::geometry_concept::value_type>::type>::type>::type,
Geometry::PointCellRange<
typename boost::polygon::segment_point_type::value_type>::type>>::type
- compute_point_cell_range(const VD::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
+ compute_point_cell_range(const VoronoiDiagram::cell_type &cell, SegmentIterator segment_begin, SegmentIterator segment_end);
template static bool is_in_range(double value)
{
return double(std::numeric_limits::lowest()) <= value && value <= double(std::numeric_limits::max());
}
- template static bool is_in_range(const VD::vertex_type &vertex)
+ template static bool is_in_range(const VoronoiDiagram::vertex_type &vertex)
{
return VoronoiUtils::is_finite(vertex) && is_in_range(vertex.x()) && is_in_range(vertex.y());
}
- template static bool is_in_range(const VD::edge_type &edge)
+ template static bool is_in_range(const VoronoiDiagram::edge_type &edge)
{
if (edge.vertex0() == nullptr || edge.vertex1() == nullptr)
return false;
diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp
index 5bc68c4ca5..340f9a590d 100644
--- a/src/libslic3r/LayerRegion.cpp
+++ b/src/libslic3r/LayerRegion.cpp
@@ -230,7 +230,6 @@ std::vector get_grouped_bridges(
{
result.reserve(bridge_expansions.size());
uint32_t group_id = 0;
- using std::move_iterator;
for (ExPolygon& expolygon : bridge_expolygons)
result.push_back({ std::move(expolygon), group_id ++, bridge_expansions.end() });
}
@@ -432,7 +431,6 @@ Surfaces expand_bridges_detect_orientations(
const float closing_radius
)
{
- using namespace Slic3r::Algorithm;
double thickness;
ExPolygons bridge_expolygons = fill_surfaces_extract_expolygons(surfaces, {stBottomBridge}, thickness);
diff --git a/src/libslic3r/MeshBoolean.cpp b/src/libslic3r/MeshBoolean.cpp
index 2a05378f58..8f30b356d1 100644
--- a/src/libslic3r/MeshBoolean.cpp
+++ b/src/libslic3r/MeshBoolean.cpp
@@ -660,7 +660,6 @@ bool empty(const CGALMesh &mesh)
bool repair(TriangleMesh& mesh, RepairedMeshErrors* repaired_errors, std::string* error)
{
- using namespace CGAL;
namespace PMP = CGAL::Polygon_mesh_processing;
if (mesh.empty())
diff --git a/src/libslic3r/MultiMaterialSegmentation.cpp b/src/libslic3r/MultiMaterialSegmentation.cpp
index be20878bfb..19dbee88dc 100644
--- a/src/libslic3r/MultiMaterialSegmentation.cpp
+++ b/src/libslic3r/MultiMaterialSegmentation.cpp
@@ -63,6 +63,7 @@ namespace Slic3r { enum class EnforcerBlockerType : int8_t; }
namespace Slic3r {
using boost::polygon::voronoi_diagram;
+using VD = Geometry::VoronoiDiagram;
static inline Point mk_point(const Voronoi::VD::vertex_type *point) { return {coord_t(point->x()), coord_t(point->y())}; }
diff --git a/src/libslic3r/NSVGUtils.cpp b/src/libslic3r/NSVGUtils.cpp
index 5274ffad4f..d81d5d5258 100644
--- a/src/libslic3r/NSVGUtils.cpp
+++ b/src/libslic3r/NSVGUtils.cpp
@@ -263,7 +263,6 @@ size_t get_shapes_count(const NSVGimage &image)
} // namespace Slic3r
namespace {
-using namespace Slic3r; // Polygon + Vec2f
Point::coord_type to_coor(float val, double scale) { return static_cast(std::round(val * scale)); }
diff --git a/src/libslic3r/PlaceholderParser.cpp b/src/libslic3r/PlaceholderParser.cpp
index 8bddfc1f10..18bbc7812e 100644
--- a/src/libslic3r/PlaceholderParser.cpp
+++ b/src/libslic3r/PlaceholderParser.cpp
@@ -2175,7 +2175,6 @@ namespace client
{
macro_processor() : macro_processor::base_type(start)
{
- using namespace qi::labels;
qi::alpha_type alpha;
qi::alnum_type alnum;
qi::eps_type eps;
diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp
index 4b2b28d4a8..2e9577e9c8 100644
--- a/src/libslic3r/Preset.cpp
+++ b/src/libslic3r/Preset.cpp
@@ -87,6 +87,7 @@
#include "libslic3r/GCode/Thumbnails.hpp"
namespace fs = boost::filesystem;
+using json = nlohmann::json;
using boost::property_tree::ptree;
diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp
index eb8321e4bd..b1fad347f1 100644
--- a/src/libslic3r/PresetBundle.cpp
+++ b/src/libslic3r/PresetBundle.cpp
@@ -80,6 +80,8 @@
#include
#include
+namespace fs = boost::filesystem;
+
// Mark string for localization and translate.
#define L(s) Slic3r::I18N::translate(s)
@@ -87,6 +89,8 @@
// This breaks compatibility with the upstream Slic3r if the --datadir is used to switch between the two versions.
//#define SLIC3R_PROFILE_USE_PRESETS_SUBDIR
+using json = nlohmann::json;
+
namespace Slic3r {
// Project-level options imported from a loaded 3MF into project_config. s_project_options_published
@@ -1527,7 +1531,6 @@ bool PresetBundle::apply_vendor_config(
const std::string& preferred_printer_variant,
const std::string& preferred_filament)
{
- namespace fs = boost::filesystem;
// Get current configuration from AppConfig
const auto old_vendors = app_config->vendors();
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index 8e5b2e2b0f..503e7c464b 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -10266,6 +10266,13 @@ static void extend_extruder_variant(DynamicPrintConfig& config, const unsigned i
printer_extruder_variant_opt->values.insert(printer_extruder_variant_opt->values.end(), variants_list.begin(), variants_list.end());
}
}
+
+ // 3. Size the machine limits to the rebuilt variants, padded with their first value like the other variant keys.
+ // They are not extruder option keys, so the resize loop in set_num_extruders skips them.
+ const auto &defaults = FullPrintConfig::defaults();
+ for (const std::string &key : printer_options_with_variant_2)
+ if (auto *opt = config.option(key))
+ opt->resize(config.get_parameter_size(key, num_extruders), defaults.option(key));
}
void DynamicPrintConfig::set_num_extruders(unsigned int num_extruders)
@@ -11058,6 +11065,22 @@ void normalize_filament_values_to_variants(DynamicPrintConfig &config)
}
}
+void set_filament_dev_options(DynamicPrintConfig &config, const std::vector &filament_configs)
+{
+ for (const std::string &key : filament_dev_options) {
+ if (std::none_of(filament_configs.begin(), filament_configs.end(), [&key](const DynamicPrintConfig *filament) { return filament->has(key); }))
+ continue;
+ const ConfigOption *default_value = print_config_def.get(key)->default_value.get();
+ auto *dst = static_cast(config.option(key, true));
+ dst->clear();
+ for (const DynamicPrintConfig *filament : filament_configs) {
+ const auto *src = static_cast(filament->has(key) ? filament->option(key) : default_value);
+ if (!src->empty())
+ dst->append(src);
+ }
+ }
+}
+
//used for object/region config
//use the smallest of multiple to single
@@ -11756,12 +11779,18 @@ void DynamicPrintConfig::update_non_diff_values_to_base_config(DynamicPrintConfi
int cur_variant_count = cur_extruder_variants.size();
int target_variant_count = target_extruder_variants.size();
+ // A base variant this config does not list (the base gained it after the config was saved, or the
+ // config lists none) takes this config's first variant of the same extruder, as a user preset's
+ // values do in update_diff_values_to_child_config. Left unmatched, the base's value would silently
+ // replace the user's.
variant_index.resize(target_variant_count, -1);
if (cur_variant_count == 0) {
// Defensive: target_variant_count may be 0 if the preset doesn't carry extruder_variant_name.
// In that case keep variant_index empty and let the downstream size checks produce a useful error.
if (!variant_index.empty())
- variant_index[0] = 0;
+ // This config's one value belongs to the extruder of the base's first variant.
+ variant_index = map_variant_indices(target_extruder_variants, target_extruder_ids, {},
+ target_extruder_ids.empty() ? std::vector() : std::vector{target_extruder_ids[0]});
}
else if ((cur_extruder_ids.size() > 0) && cur_variant_count != cur_extruder_ids.size()){
//should not happen
@@ -11774,18 +11803,7 @@ void DynamicPrintConfig::update_non_diff_values_to_base_config(DynamicPrintConfi
%extruder_variant_name %target_variant_count %extruder_id_name %target_extruder_ids.size();
}
else {
- for (int i = 0; i < target_variant_count; i++)
- {
- for (int j = 0; j < cur_variant_count; j++)
- {
- if ((target_extruder_variants[i] == cur_extruder_variants[j])
- &&(target_extruder_ids.empty() || (target_extruder_ids[i] == cur_extruder_ids[j])))
- {
- variant_index[i] = j;
- break;
- }
- }
- }
+ variant_index = map_variant_indices(target_extruder_variants, target_extruder_ids, cur_extruder_variants, cur_extruder_ids);
}
for (auto& opt : keys) {
@@ -11810,6 +11828,13 @@ void DynamicPrintConfig::update_non_diff_values_to_base_config(DynamicPrintConfi
if (cur_variant_count > target_variant_count)
continue;
+ // The variant lists are the base's layout itself, which every other value is
+ // carried onto: a variant this config lacks keeps its own name and id.
+ if (opt == extruder_id_name || opt == extruder_variant_name) {
+ opt_src->set(opt_target);
+ continue;
+ }
+
int stride = 1;
if (key_set2.find(opt) != key_set2.end())
stride = 2;
diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp
index 05ee97a806..133d854a61 100644
--- a/src/libslic3r/PrintConfig.hpp
+++ b/src/libslic3r/PrintConfig.hpp
@@ -953,6 +953,11 @@ void normalize_filament_values_to_variants(DynamicPrintConfig &config);
extern std::set filament_dev_options;
+// Orca: a filament_dev_options option holds several values per filament, and how many is up to the
+// filament preset, so one filament's values cannot be replaced in place. This rebuilds each option from
+// filament_configs, one config per filament in slot order, as the filaments' values one after another.
+void set_filament_dev_options(DynamicPrintConfig &config, const std::vector &filament_configs);
+
extern void update_static_print_config_from_dynamic(ConfigBase& config, const DynamicPrintConfig& dest_config, std::vector variant_index, std::set& key_set1, int stride = 1);
extern void compute_filament_override_value(const std::string& opt_key, const ConfigOption *opt_old_machine, const ConfigOption *opt_new_machine, const ConfigOption *opt_new_filament, const DynamicPrintConfig& new_full_config,
t_config_option_keys& diff_keys, DynamicPrintConfig& filament_overrides, std::vector& f_map_indices);
diff --git a/src/libslic3r/ProjectTask.hpp b/src/libslic3r/ProjectTask.hpp
index 47eaa37dcc..64c4ddc447 100644
--- a/src/libslic3r/ProjectTask.hpp
+++ b/src/libslic3r/ProjectTask.hpp
@@ -11,8 +11,6 @@
#include
#include
-namespace fs = boost::filesystem;
-
namespace Slic3r {
class BBLProject;
@@ -208,7 +206,7 @@ public:
std::string task_profile_id; /* profile id*/
std::string task_name; /* task name, generally filename as task name */
std::string task_file; /* local full file path of 3mf or gcode */
- fs::path task_path; /* local path of 3mf or gcode */
+ boost::filesystem::path task_path; /* local path of 3mf or gcode */
std::string task_gcode_in_3mf; /* gcode in 3mf */
std::string task_create_time; /* time created by cloud */
std::string task_thumbnail_url; /* url of task thumbnail */
@@ -326,7 +324,7 @@ public:
std::string project_url_md5; /* md5 of project url file */
std::string project_name;
std::string project_3mf_file;
- fs::path project_path;
+ boost::filesystem::path project_path;
std::string project_content;
std::string project_country_code;
diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp
index 8d5ab732be..cd9ecf100d 100644
--- a/src/libslic3r/utils.cpp
+++ b/src/libslic3r/utils.cpp
@@ -404,7 +404,6 @@ std::string debug_out_path(const char *name, ...)
}
namespace logging = boost::log;
-namespace src = boost::log::sources;
namespace expr = boost::log::expressions;
namespace keywords = boost::log::keywords;
namespace attrs = boost::log::attributes;
@@ -892,7 +891,6 @@ int copy_file_linux_read_write(int infile, int outfile, uintmax_t file_size)
// and only features supported by Linux 3.10 (on our build server with CentOS 7) are kept, namely sendfile with ranges and statx() are not supported.
bool copy_file_linux(const boost::filesystem::path &from, const boost::filesystem::path &to, boost::system::error_code &ec)
{
- using namespace boost::filesystem;
struct fd_wrapper
{
diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt
index fdd7475d48..de3b69565d 100644
--- a/src/slic3r/CMakeLists.txt
+++ b/src/slic3r/CMakeLists.txt
@@ -851,11 +851,6 @@ if (SLIC3R_CAD)
GUI/CAD/SketchInlineEditor.hpp
GUI/CAD/McpControl.cpp
GUI/CAD/McpControl.hpp
- GUI/Gizmos/GLGizmoSketch.cpp
- GUI/Gizmos/GLGizmoSketch.hpp
- # Needs GeometryEngine (make_primitive / apply_fillet / tessellate).
- GUI/Gizmos/GLGizmoPrimitive.cpp
- GUI/Gizmos/GLGizmoPrimitive.hpp
)
endif ()
diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp
index d53a7dc17d..5a39f9a279 100644
--- a/src/slic3r/GUI/3DScene.cpp
+++ b/src/slic3r/GUI/3DScene.cpp
@@ -1592,7 +1592,7 @@ bool GLVolumeCollection::check_outside_state(const BuildVolume &build_volume, Mo
{
std::vector result_filaments;
//result_filaments.reserve(conflict_filaments.size());
- std::set_intersection (conflict_filament_vector.begin(), conflict_filament_vector.end(), unprintable_filament_vec[index].begin(), unprintable_filament_vec[index].end(), insert_iterator>(result_filaments, result_filaments.begin()));
+ std::set_intersection (conflict_filament_vector.begin(), conflict_filament_vector.end(), unprintable_filament_vec[index].begin(), unprintable_filament_vec[index].end(), std::insert_iterator>(result_filaments, result_filaments.begin()));
conflict_filament_vector = result_filaments;
}
}
diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp
index 66e87ac3af..83dd6a2d07 100644
--- a/src/slic3r/GUI/AMSMaterialsSetting.cpp
+++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp
@@ -974,8 +974,8 @@ bool AMSMaterialsSetting::Show(bool show)
static void _collect_filament_info(const wxString& shown_name,
const Preset& filament,
- unordered_map& query_filament_vendors,
- unordered_map& query_filament_types)
+ std::unordered_map& query_filament_vendors,
+ std::unordered_map& query_filament_types)
{
query_filament_vendors[shown_name] = filament.config.get_filament_vendor();
query_filament_types[shown_name] = filament.config.get_filament_type();
diff --git a/src/slic3r/GUI/Auxiliary.cpp b/src/slic3r/GUI/Auxiliary.cpp
index bb952e8ae0..85f6533c1c 100644
--- a/src/slic3r/GUI/Auxiliary.cpp
+++ b/src/slic3r/GUI/Auxiliary.cpp
@@ -69,6 +69,7 @@
#include
namespace fs = boost::filesystem;
+using json = nlohmann::json;
namespace Slic3r { namespace GUI {
@@ -855,14 +856,14 @@ void AuxiliaryPanel::Split(const std::string &src, const std::string &separator,
dest.clear();
index = str.find_first_of(separator, start);
do {
- if (index != string::npos) {
+ if (index != std::string::npos) {
substring = str.substr(start, index - start);
dest.push_back(substring);
start = index + separator.size();
index = str.find(separator, start);
- if (start == string::npos) break;
+ if (start == std::string::npos) break;
}
- } while (index != string::npos);
+ } while (index != std::string::npos);
// the last part
substring = str.substr(start);
diff --git a/src/slic3r/GUI/Auxiliary.hpp b/src/slic3r/GUI/Auxiliary.hpp
index c7fb89f920..4f25aab439 100644
--- a/src/slic3r/GUI/Auxiliary.hpp
+++ b/src/slic3r/GUI/Auxiliary.hpp
@@ -11,7 +11,7 @@
#include "slic3r/GUI/Widgets/Button.hpp"
#include "slic3r/GUI/Widgets/ComboBox.hpp"
#include
-#include "slic3r/GUI/Printer/PrinterFileSystem.h"
+#include
#include
#include
#include
@@ -246,7 +246,7 @@ public:
void create_folder(wxString name = wxEmptyString);
std::string replaceSpace(std::string s, std::string ts, std::string ns);
void on_import_file(wxCommandEvent &event);
- void Reload(wxString aux_path, std::map> paths);
+ void Reload(wxString aux_path, std::map> paths);
void update_all_panel();
void update_all_cover();
diff --git a/src/slic3r/GUI/AuxiliaryDataViewModel.hpp b/src/slic3r/GUI/AuxiliaryDataViewModel.hpp
index 026f22421b..c26988e9bb 100644
--- a/src/slic3r/GUI/AuxiliaryDataViewModel.hpp
+++ b/src/slic3r/GUI/AuxiliaryDataViewModel.hpp
@@ -18,8 +18,6 @@
class AuxiliaryModelNode;
WX_DEFINE_ARRAY_PTR(AuxiliaryModelNode*, AuxiliaryModelNodePtrArray);
-namespace fs = boost::filesystem;
-
class AuxiliaryModelNode
{
public:
diff --git a/src/slic3r/GUI/BBLStatusBar.hpp b/src/slic3r/GUI/BBLStatusBar.hpp
index e643a9b536..1ff2fd6f0f 100644
--- a/src/slic3r/GUI/BBLStatusBar.hpp
+++ b/src/slic3r/GUI/BBLStatusBar.hpp
@@ -73,10 +73,6 @@ private:
CancelFn m_cancel_cb;
};
-namespace GUI {
- using Slic3r::BBLStatusBar;
-}
-
}
#endif // BBLSTATUSBAR_HPP
diff --git a/src/slic3r/GUI/BBLStatusBarBind.hpp b/src/slic3r/GUI/BBLStatusBarBind.hpp
index dd647aa26c..b1b06b60b6 100644
--- a/src/slic3r/GUI/BBLStatusBarBind.hpp
+++ b/src/slic3r/GUI/BBLStatusBarBind.hpp
@@ -80,10 +80,6 @@ private:
CancelFn m_cancel_cb_fina;
};
-namespace GUI {
-using Slic3r::BBLStatusBarBind;
-}
-
} // namespace Slic3r
#endif // BBLSTATUSBAR_HPP
diff --git a/src/slic3r/GUI/BBLStatusBarPrint.hpp b/src/slic3r/GUI/BBLStatusBarPrint.hpp
index 0622516791..bc82d80068 100644
--- a/src/slic3r/GUI/BBLStatusBarPrint.hpp
+++ b/src/slic3r/GUI/BBLStatusBarPrint.hpp
@@ -97,10 +97,6 @@ private:
CancelFn m_cancel_cb_fina;
};
-namespace GUI {
-using Slic3r::BBLStatusBarPrint;
-}
-
wxDECLARE_EVENT(EVT_SHOW_ERROR_INFO, wxCommandEvent);
} // namespace Slic3r
diff --git a/src/slic3r/GUI/BBLStatusBarSend.hpp b/src/slic3r/GUI/BBLStatusBarSend.hpp
index abe4bece3b..1c4b267c6f 100644
--- a/src/slic3r/GUI/BBLStatusBarSend.hpp
+++ b/src/slic3r/GUI/BBLStatusBarSend.hpp
@@ -99,10 +99,6 @@ private:
CancelFn m_cancel_cb_fina;
};
-namespace GUI {
-using Slic3r::BBLStatusBarSend;
-}
-
wxDECLARE_EVENT(EVT_SHOW_ERROR_INFO_SEND, wxCommandEvent);
wxDECLARE_EVENT(EVT_SHOW_ERROR_FAIL_SEND, wxCommandEvent);
} // namespace Slic3r
diff --git a/src/slic3r/GUI/BBLTopbar.cpp b/src/slic3r/GUI/BBLTopbar.cpp
index 40f6457ae4..eb85b9413b 100644
--- a/src/slic3r/GUI/BBLTopbar.cpp
+++ b/src/slic3r/GUI/BBLTopbar.cpp
@@ -41,6 +41,7 @@
#define TOPBAR_TITLE_WIDTH 300
using namespace Slic3r;
+using namespace Slic3r::GUI;
enum CUSTOM_ID
{
diff --git a/src/slic3r/GUI/BBLTopbar.hpp b/src/slic3r/GUI/BBLTopbar.hpp
index 3d71a56e4c..bad0727452 100644
--- a/src/slic3r/GUI/BBLTopbar.hpp
+++ b/src/slic3r/GUI/BBLTopbar.hpp
@@ -18,8 +18,6 @@ class wxMouseCaptureLostEvent;
class wxMouseEvent;
class wxWindow;
-using namespace Slic3r::GUI;
-
class CenteredTitle : public wxControl
{
public:
diff --git a/src/slic3r/GUI/BackgroundSlicingProcess.cpp b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
index e9417782db..50c69f40dc 100644
--- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
+++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
@@ -218,7 +218,7 @@ std::string BackgroundSlicingProcess::output_filepath_for_project(const boost::f
void BackgroundSlicingProcess::process_fff()
{
assert(m_print == m_fff_print);
- PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
+ PresetBundle& preset_bundle = *GUI::wxGetApp().preset_bundle;
m_fff_print->is_BBL_printer() = preset_bundle.is_bbl_vendor();
// BBS: add the logic to process from an existed gcode file
if (m_print->finished()) {
@@ -727,7 +727,7 @@ StringObjectException BackgroundSlicingProcess::validate(std::vectoris_BBL_printer() = wxGetApp().preset_bundle->is_bbl_vendor();
+ m_fff_print->is_BBL_printer() = GUI::wxGetApp().preset_bundle->is_bbl_vendor();
return m_print->validate(warnings, collison_polygons, height_polygons);
}
diff --git a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp
index 14575aa988..c9e4e4b76e 100644
--- a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp
+++ b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp
@@ -22,8 +22,6 @@
#include "CapsuleButton.hpp"
namespace Slic3r::GUI { struct IntEvent; }
-using namespace Slic3r;
-using namespace Slic3r::GUI;
namespace Slic3r { namespace GUI {
#define ANIMATION_REFRESH_INTERVAL 20
diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp
index c16bcf016d..2f1283b790 100644
--- a/src/slic3r/GUI/BindDialog.cpp
+++ b/src/slic3r/GUI/BindDialog.cpp
@@ -26,7 +26,7 @@
#include
#include "slic3r/GUI/BBLStatusBarBind.hpp"
#include "slic3r/GUI/Jobs/BindJob.hpp"
-#include "slic3r/GUI/Printer/PrinterFileSystem.h"
+#include
#include "slic3r/GUI/DeviceCore/DevDefs.h"
#include "slic3r/GUI/Jobs/Worker.hpp"
#include
@@ -54,6 +54,8 @@
#include "DeviceCore/DevManager.h"
+using json = nlohmann::json;
+
namespace Slic3r {
namespace GUI {
diff --git a/src/slic3r/GUI/BitmapComboBox.cpp b/src/slic3r/GUI/BitmapComboBox.cpp
index 217b885b91..9e5645bb41 100644
--- a/src/slic3r/GUI/BitmapComboBox.cpp
+++ b/src/slic3r/GUI/BitmapComboBox.cpp
@@ -45,8 +45,6 @@
#include
#endif
-using Slic3r::GUI::format_wxstr;
-
#define BORDER_W 10
// ---------------------------------
diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp
index e49ebfb787..3ed3ca66df 100644
--- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp
+++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp
@@ -1307,7 +1307,7 @@ void CalibrationPresetPage::stripWhiteSpace(std::string& str)
{
if (str == "") { return; }
- string::iterator cur_it;
+ std::string::iterator cur_it;
cur_it = str.begin();
while (cur_it != str.end()) {
@@ -2597,7 +2597,7 @@ void CalibrationPresetPage::update_multi_extruder_filament_combobox(const std::s
int ams_id_int = 0;
try {
if (!ams_id.empty())
- ams_id_int = stoi(ams_id.c_str());
+ ams_id_int = std::stoi(ams_id.c_str());
} catch (...) {}
@@ -2685,7 +2685,7 @@ void CalibrationPresetPage::update_filament_combobox(std::string ams_id)
int ams_id_int = 0;
try {
if (!ams_id.empty())
- ams_id_int = stoi(ams_id.c_str());
+ ams_id_int = std::stoi(ams_id.c_str());
} catch (...) {}
diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp
index 6596cdca0c..347973c667 100644
--- a/src/slic3r/GUI/ConfigWizard.cpp
+++ b/src/slic3r/GUI/ConfigWizard.cpp
@@ -95,7 +95,6 @@ namespace GUI {
using Config::Snapshot;
-using Config::SnapshotDB;
// Configuration data structures extensions needed for the wizard
diff --git a/src/slic3r/GUI/ConfigWizard_private.hpp b/src/slic3r/GUI/ConfigWizard_private.hpp
index a1f9b61b00..5f7720ab84 100644
--- a/src/slic3r/GUI/ConfigWizard_private.hpp
+++ b/src/slic3r/GUI/ConfigWizard_private.hpp
@@ -43,8 +43,6 @@
#include
-namespace fs = boost::filesystem;
-
namespace Slic3r {
namespace GUI {
@@ -88,7 +86,7 @@ struct Bundle
// cache or its profile JSONs, whichever is usable.
// Returns false if not loaded. Reason for that is logged as boost::log error.
//BBS: set BBL as default
- bool load(fs::path dir, const std::string &vendor_name, bool is_in_resources, bool is_bbl_bundle = false);
+ bool load(boost::filesystem::path dir, const std::string &vendor_name, bool is_in_resources, bool is_bbl_bundle = false);
const std::string& vendor_id() const { return vendor_profile->id; }
};
diff --git a/src/slic3r/GUI/CreatePresetsDialog.cpp b/src/slic3r/GUI/CreatePresetsDialog.cpp
index 24591ae0f8..c7c9cd2760 100644
--- a/src/slic3r/GUI/CreatePresetsDialog.cpp
+++ b/src/slic3r/GUI/CreatePresetsDialog.cpp
@@ -25,7 +25,7 @@
#include "slic3r/GUI/Widgets/RadioBox.hpp"
#include
#include
-#include "slic3r/GUI/Printer/PrinterFileSystem.h"
+#include
#include
#include "slic3r/GUI/GUI_Utils.hpp"
#include "slic3r/GUI/Widgets/Label.hpp"
@@ -91,6 +91,8 @@
#define SELECT_ALL_OPTION_COLOUR wxColour("#009688")
#define DEFAULT_PROMPT_TEXT_COLOUR wxColour("#ACACAC")
+using json = nlohmann::json;
+
namespace Slic3r {
namespace GUI {
@@ -345,7 +347,7 @@ static std::string get_curr_timestmp()
// return timestampString;
}
-static void get_filament_compatible_printer(Preset* preset, vector& printers)
+static void get_filament_compatible_printer(Preset* preset, std::vector& printers)
{
auto compatible_printers = dynamic_cast(preset->config.option("compatible_printers"));
if (compatible_printers == nullptr) return;
@@ -1579,7 +1581,7 @@ void CreateFilamentPresetDialog::sort_printer_by_nozzle(std::vector nozzle_diameter = nozzle_diameter_map;
std::sort(printer_name_to_filament_preset.begin(), printer_name_to_filament_preset.end(),
- [&nozzle_diameter](const std::pair &a, const std::pair &b) {
+ [&nozzle_diameter](const std::pair &a, const std::pair &b) {
size_t nozzle_index_a = a.first.find(" nozzle");
size_t nozzle_index_b = b.first.find(" nozzle");
if (nozzle_index_a == std::string::npos || nozzle_index_b == std::string::npos) return a.first < b.first;
@@ -3141,7 +3143,7 @@ void CreatePrinterPresetDialog::set_current_visible_printer()
wxArrayString CreatePrinterPresetDialog::printer_preset_sort_with_nozzle_diameter(const VendorProfile &vendor_profile, float nozzle_diameter)
{
- std::vector> preset_sort;
+ std::vector> preset_sort;
auto get_nozzle_size_for_printer_model = [this](const std::string & model_name) -> size_t {
auto iter = m_printer_name_to_preset.find(model_name);
@@ -4962,7 +4964,7 @@ wxBoxSizer *CreatePresetForPrinterDialog::create_selected_filament_preset_sizer(
m_selected_printer->Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &e) {
wxString printer_name = m_selected_printer->GetStringSelection();
- std::unordered_map>>::iterator filament_iter = m_printer_compatible_filament_presets.find(into_u8(printer_name));
+ std::unordered_map>>::iterator filament_iter = m_printer_compatible_filament_presets.find(into_u8(printer_name));
if (m_printer_compatible_filament_presets.end() != filament_iter) {
filament_choice_to_filament_preset.clear();
wxArrayString filament_choices;
diff --git a/src/slic3r/GUI/DeviceCore/DevAxis.cpp b/src/slic3r/GUI/DeviceCore/DevAxis.cpp
index 1274054507..5dc0245a3a 100644
--- a/src/slic3r/GUI/DeviceCore/DevAxis.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevAxis.cpp
@@ -1,10 +1,12 @@
#include "DevAxis.h"
#include "DevUtil.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/DeviceCore/DevDefs.h"
+using json = nlohmann::json;
+
namespace Slic3r
{
diff --git a/src/slic3r/GUI/DeviceCore/DevAxis.h b/src/slic3r/GUI/DeviceCore/DevAxis.h
index d543132e49..6e8b3ef20d 100644
--- a/src/slic3r/GUI/DeviceCore/DevAxis.h
+++ b/src/slic3r/GUI/DeviceCore/DevAxis.h
@@ -2,7 +2,6 @@
#include
#include
#include
-#include "slic3r/Utils/json_diff.hpp"
namespace Slic3r {
@@ -22,7 +21,7 @@ public:
bool IsArchCoreXY() const;
public:
- void ParseAxis(const json &print_json);
+ void ParseAxis(const nlohmann::json &print_json);
int Ctrl_GoHome();
int Ctrl_Axis(std::string axis, double unit = 1.0f, double input_val = 1.0f, int speed = 3000); // xyz e
diff --git a/src/slic3r/GUI/DeviceCore/DevAxisCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevAxisCtrl.cpp
index ee9c8f00e8..6178a0e1ce 100644
--- a/src/slic3r/GUI/DeviceCore/DevAxisCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevAxisCtrl.cpp
@@ -1,11 +1,13 @@
#include "DevAxis.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
#include
#include
#include
+using json = nlohmann::json;
+
namespace Slic3r
{
diff --git a/src/slic3r/GUI/DeviceCore/DevBed.cpp b/src/slic3r/GUI/DeviceCore/DevBed.cpp
index 134de17e30..48ab32f947 100644
--- a/src/slic3r/GUI/DeviceCore/DevBed.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevBed.cpp
@@ -1,7 +1,9 @@
#include "DevBed.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
+using json = nlohmann::json;
+
namespace Slic3r {
void DevBed::ParseV1_0(const json &print_json, DevBed *system)
diff --git a/src/slic3r/GUI/DeviceCore/DevBed.h b/src/slic3r/GUI/DeviceCore/DevBed.h
index dcdb698449..ddfd1e8902 100644
--- a/src/slic3r/GUI/DeviceCore/DevBed.h
+++ b/src/slic3r/GUI/DeviceCore/DevBed.h
@@ -1,6 +1,5 @@
#pragma once
#include
-#include "slic3r/Utils/json_diff.hpp"
namespace Slic3r {
@@ -16,8 +15,8 @@ public:
public:
- static void ParseV1_0(const json &print_json, DevBed *system);
- static void ParseV2_0(const json &print_json, DevBed *system);
+ static void ParseV1_0(const nlohmann::json &print_json, DevBed *system);
+ static void ParseV2_0(const nlohmann::json &print_json, DevBed *system);
private:
diff --git a/src/slic3r/GUI/DeviceCore/DevCalib.cpp b/src/slic3r/GUI/DeviceCore/DevCalib.cpp
index 61566c83ed..ec1e55a247 100644
--- a/src/slic3r/GUI/DeviceCore/DevCalib.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevCalib.cpp
@@ -1,6 +1,6 @@
#include
#include
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
@@ -22,6 +22,8 @@
#include "DevFilaSystem.h"
#include "DevConfig.h"
+using json = nlohmann::json;
+
namespace Slic3r {
static float string_to_float(const std::string &str_value)
diff --git a/src/slic3r/GUI/DeviceCore/DevCalib.h b/src/slic3r/GUI/DeviceCore/DevCalib.h
index 54f5f4b053..f0600424e2 100644
--- a/src/slic3r/GUI/DeviceCore/DevCalib.h
+++ b/src/slic3r/GUI/DeviceCore/DevCalib.h
@@ -2,7 +2,6 @@
#include
#include
#include
-#include "slic3r/Utils/json_diff.hpp"
#include "DevDefs.h"
@@ -86,11 +85,11 @@ public:
std::vector GetFlowRatioResult() const {return m_flow_ratio_results; }
protected:
- void ExtrusionCalibSetParse(const json &jj);
- void ExtrusionCalibSelectParse(const json &jj);
- void ExtrusionCalibGetTableParse(const json &jj);
- void ExtrusionCalibGetResultParse(const json &jj);
- void FlowrateGetResultParse(const json &jj);
+ void ExtrusionCalibSetParse(const nlohmann::json &jj);
+ void ExtrusionCalibSelectParse(const nlohmann::json &jj);
+ void ExtrusionCalibGetTableParse(const nlohmann::json &jj);
+ void ExtrusionCalibGetResultParse(const nlohmann::json &jj);
+ void FlowrateGetResultParse(const nlohmann::json &jj);
private:
MachineObject* m_owner{nullptr};
@@ -119,11 +118,11 @@ private:
bool m_calib_finished{false};
public:
- static void ParseCalibVersion(const json& j, DevCalib* system);
+ static void ParseCalibVersion(const nlohmann::json& j, DevCalib* system);
static void ParseSupportNewAutoCalib(int flag, DevCalib* system);
- static void ParseV1_0(const json& print_json, DevCalib* system, bool key_field_only);
+ static void ParseV1_0(const nlohmann::json& print_json, DevCalib* system, bool key_field_only);
};
} // namespace Slic3r
\ No newline at end of file
diff --git a/src/slic3r/GUI/DeviceCore/DevChamber.cpp b/src/slic3r/GUI/DeviceCore/DevChamber.cpp
index 8cd47481f2..3c1a0c8e8b 100644
--- a/src/slic3r/GUI/DeviceCore/DevChamber.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevChamber.cpp
@@ -3,9 +3,11 @@
#include "DevConfig.h"
#include "DevUtil.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
+using json = nlohmann::json;
+
namespace Slic3r {
bool DevChamber::HasChamber() const { return m_owner->GetConfig()->HasChamber(); }
diff --git a/src/slic3r/GUI/DeviceCore/DevChamber.h b/src/slic3r/GUI/DeviceCore/DevChamber.h
index 6fcafabcf2..0e6464a839 100644
--- a/src/slic3r/GUI/DeviceCore/DevChamber.h
+++ b/src/slic3r/GUI/DeviceCore/DevChamber.h
@@ -1,7 +1,6 @@
#pragma once
#include
#include
-#include "slic3r/Utils/json_diff.hpp"
namespace Slic3r {
@@ -25,10 +24,10 @@ public: // getter
public:
// setter
- void ParseChamber(const json &print_json);
+ void ParseChamber(const nlohmann::json &print_json);
- void ParseChamberV1_0(const json& print_json);
- void ParseChamberV2_0(const json& print_json);
+ void ParseChamberV1_0(const nlohmann::json& print_json);
+ void ParseChamberV2_0(const nlohmann::json& print_json);
// control
int CtrlSetChamberTemp(int temp);
diff --git a/src/slic3r/GUI/DeviceCore/DevChamberCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevChamberCtrl.cpp
index 01201998ce..13ab7bccc9 100644
--- a/src/slic3r/GUI/DeviceCore/DevChamberCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevChamberCtrl.cpp
@@ -1,8 +1,10 @@
#include "DevChamber.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
#include
+using json = nlohmann::json;
+
namespace Slic3r {
int DevChamber::CtrlSetChamberTemp(int temp)
diff --git a/src/slic3r/GUI/DeviceCore/DevConfig.cpp b/src/slic3r/GUI/DeviceCore/DevConfig.cpp
index cce5257527..9833731040 100644
--- a/src/slic3r/GUI/DeviceCore/DevConfig.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevConfig.cpp
@@ -2,7 +2,6 @@
#include "DevConfig.h"
#include "DevUtil.h"
-#include "json_diff.hpp"
using namespace nlohmann;
diff --git a/src/slic3r/GUI/DeviceCore/DevConfig.h b/src/slic3r/GUI/DeviceCore/DevConfig.h
index b0cdcb936e..9fa26d9238 100644
--- a/src/slic3r/GUI/DeviceCore/DevConfig.h
+++ b/src/slic3r/GUI/DeviceCore/DevConfig.h
@@ -1,7 +1,7 @@
#pragma once
#include "libslic3r/CommonDefs.hpp"
-#include "slic3r/Utils/json_diff.hpp"
+#include
#include
#include
@@ -47,11 +47,11 @@ public:
public:
/*Setters*/
- void ParseConfig(const json& print_json);
+ void ParseConfig(const nlohmann::json& print_json);
- void ParseChamberConfig(const json& print_json); // chamber
- void ParsePrintOptionsConfig(const json& print_json); // print options
- void ParseCalibrationConfig(const json& print_json); //cali
+ void ParseChamberConfig(const nlohmann::json& print_json); // chamber
+ void ParsePrintOptionsConfig(const nlohmann::json& print_json); // print options
+ void ParseCalibrationConfig(const nlohmann::json& print_json); //cali
private:
[[maybe_unused]] MachineObject* m_obj;
diff --git a/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp b/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp
index e6679f4463..b0a6f2678c 100644
--- a/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevConfigUtil.cpp
@@ -1,6 +1,6 @@
#include "DevConfigUtil.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
#include
diff --git a/src/slic3r/GUI/DeviceCore/DevCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevCtrl.cpp
index 56547e2a03..011d9228a0 100644
--- a/src/slic3r/GUI/DeviceCore/DevCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevCtrl.cpp
@@ -4,7 +4,6 @@
#include "DevCtrl.h"
// TODO: remove this include
-#include "json_diff.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
using namespace nlohmann;
diff --git a/src/slic3r/GUI/DeviceCore/DevCtrl.h b/src/slic3r/GUI/DeviceCore/DevCtrl.h
index 55d0dc4c3e..6b38cc1569 100644
--- a/src/slic3r/GUI/DeviceCore/DevCtrl.h
+++ b/src/slic3r/GUI/DeviceCore/DevCtrl.h
@@ -1,6 +1,6 @@
#pragma once
-#include "slic3r/Utils/json_diff.hpp"
+#include
#include
#include
#include
@@ -15,7 +15,7 @@ class DevCtrlInfo
{
public:
DevCtrlInfo() {};
- DevCtrlInfo(MachineObject* obj, int sequence_id, const json& req_json, int interval_max = 3, int interval_min = 0);
+ DevCtrlInfo(MachineObject* obj, int sequence_id, const nlohmann::json& req_json, int interval_max = 3, int interval_min = 0);
public:
bool CheckCanUpdateData(const nlohmann::json& jj);
@@ -32,7 +32,7 @@ private:
time_t m_request_time = 0;
int m_request_seq = 0;
- json m_request_json = json();
+ nlohmann::json m_request_json = nlohmann::json();
// check
int m_request_interval_max = 3;
diff --git a/src/slic3r/GUI/DeviceCore/DevExtensionTool.cpp b/src/slic3r/GUI/DeviceCore/DevExtensionTool.cpp
index 1947cf1d87..86cb7362c8 100644
--- a/src/slic3r/GUI/DeviceCore/DevExtensionTool.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevExtensionTool.cpp
@@ -5,8 +5,6 @@
#include
#include
-using namespace nlohmann;
-
namespace Slic3r
{
diff --git a/src/slic3r/GUI/DeviceCore/DevExtensionTool.h b/src/slic3r/GUI/DeviceCore/DevExtensionTool.h
index 8ce33b6e43..0b16c95a90 100644
--- a/src/slic3r/GUI/DeviceCore/DevExtensionTool.h
+++ b/src/slic3r/GUI/DeviceCore/DevExtensionTool.h
@@ -3,7 +3,7 @@
#include
#include "libslic3r/CommonDefs.hpp"
-#include "slic3r/Utils/json_diff.hpp"
+#include
#include
#include "DevDefs.h"
diff --git a/src/slic3r/GUI/DeviceCore/DevExtruderSystem.cpp b/src/slic3r/GUI/DeviceCore/DevExtruderSystem.cpp
index 20975a7ca3..5013d85228 100644
--- a/src/slic3r/GUI/DeviceCore/DevExtruderSystem.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevExtruderSystem.cpp
@@ -15,7 +15,6 @@
#include "DevFilaSystem.h" // complete type for GetFilaSystem()->GetTrayIndexMap() in GetBackupAmsSlotInGroup
// TODO: remove this include
-#include "json_diff.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/I18N.hpp"
diff --git a/src/slic3r/GUI/DeviceCore/DevExtruderSystem.h b/src/slic3r/GUI/DeviceCore/DevExtruderSystem.h
index 4d9f7c9abf..e7e083050f 100644
--- a/src/slic3r/GUI/DeviceCore/DevExtruderSystem.h
+++ b/src/slic3r/GUI/DeviceCore/DevExtruderSystem.h
@@ -5,7 +5,7 @@
#include
#include "libslic3r/CommonDefs.hpp"
-#include "slic3r/Utils/json_diff.hpp"
+#include
#include
#include
diff --git a/src/slic3r/GUI/DeviceCore/DevExtruderSystemCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevExtruderSystemCtrl.cpp
index 38513a2274..9379920b27 100644
--- a/src/slic3r/GUI/DeviceCore/DevExtruderSystemCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevExtruderSystemCtrl.cpp
@@ -1,11 +1,8 @@
-#include
#include "DevExtruderSystem.h"
#include "slic3r/GUI/DeviceManager.hpp"
-using namespace nlohmann;
-
namespace Slic3r
{
int DevExtderSystem::CtrlRetrySwitching()
diff --git a/src/slic3r/GUI/DeviceCore/DevFan.cpp b/src/slic3r/GUI/DeviceCore/DevFan.cpp
index 52ac9f1d76..c4fc80116b 100644
--- a/src/slic3r/GUI/DeviceCore/DevFan.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevFan.cpp
@@ -6,7 +6,6 @@
#include
#include
#include
-#include "json_diff.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
using namespace nlohmann;
diff --git a/src/slic3r/GUI/DeviceCore/DevFan.h b/src/slic3r/GUI/DeviceCore/DevFan.h
index 393c8a477c..b36705a19b 100644
--- a/src/slic3r/GUI/DeviceCore/DevFan.h
+++ b/src/slic3r/GUI/DeviceCore/DevFan.h
@@ -2,7 +2,6 @@
#include
#include
#include
-#include "slic3r/Utils/json_diff.hpp"
#include
#include
@@ -13,7 +12,7 @@ namespace Slic3r {
class MachineObject;
enum AirDuctType { AIR_FAN_TYPE, AIR_DOOR_TYPE };
-typedef std::function CommandCallBack;
+typedef std::function CommandCallBack;
enum AIR_FUN : int {
FAN_HEAT_BREAK_0_IDX = 0,
@@ -123,14 +122,14 @@ public:
AirDuctData GetAirDuctData() { return m_air_duct_data; };
void converse_to_duct(bool is_suppt_part_fun, bool is_suppt_aux_fun, bool is_suppt_cham_fun); // Convert the data to duct type to make the newand old protocols consistent
- int command_handle_response(const json &response);
+ int command_handle_response(const nlohmann::json &response);
int command_control_fan(int fan_type, int val); // Old protocol
int command_control_fan_new(int fan_id, int val); // New protocol
int command_control_air_duct(int mode_id, int submode, const CommandCallBack& cb);
- void ParseV1_0(const json &print_json);
- void ParseV2_0(const json &print_json);
- void ParseV3_0(const json &print_json);
+ void ParseV1_0(const nlohmann::json &print_json);
+ void ParseV2_0(const nlohmann::json &print_json);
+ void ParseV3_0(const nlohmann::json &print_json);
public:
bool GetSupportAirduct() { return is_support_airduct; };
diff --git a/src/slic3r/GUI/DeviceCore/DevFilaAmsSettingCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevFilaAmsSettingCtrl.cpp
index cc8312ce9a..f86838729c 100644
--- a/src/slic3r/GUI/DeviceCore/DevFilaAmsSettingCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevFilaAmsSettingCtrl.cpp
@@ -1,11 +1,13 @@
#include "DevFilaAmsSetting.h"
#include "DevFilaSystem.h"
-#include "json_diff.hpp"
+#include
#include "slic3r/GUI/DeviceManager.hpp"
#include
#include "slic3r/GUI/DeviceCore/DevCtrl.h"
+using json = nlohmann::json;
+
namespace Slic3r {
int DevAmsSystemFirmwareSwitch::CrtlSwitchFirmware(int firmware_idx)
{
diff --git a/src/slic3r/GUI/DeviceCore/DevFilaBlackList.cpp b/src/slic3r/GUI/DeviceCore/DevFilaBlackList.cpp
index c499b89622..ef921c5620 100644
--- a/src/slic3r/GUI/DeviceCore/DevFilaBlackList.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevFilaBlackList.cpp
@@ -14,7 +14,6 @@
#include "slic3r/GUI/DeviceCore/DevDefs.h"
#include "DevFilaBlackList.h"
-#include "json_diff.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "DevFilaSystem.h"
diff --git a/src/slic3r/GUI/DeviceCore/DevFilaBlackList.h b/src/slic3r/GUI/DeviceCore/DevFilaBlackList.h
index 1f727396a8..43e50360b9 100644
--- a/src/slic3r/GUI/DeviceCore/DevFilaBlackList.h
+++ b/src/slic3r/GUI/DeviceCore/DevFilaBlackList.h
@@ -5,7 +5,7 @@
#include
#include
#include
-#include "slic3r/Utils/json_diff.hpp"
+#include
namespace Slic3r
{
@@ -67,7 +67,7 @@ public:
static CheckResult check_filaments_in_blacklist(const CheckFilamentInfo& info);
public:
- static json filaments_blacklist;
+ static nlohmann::json filaments_blacklist;
};// class DevFilaBlacklist
}// namespace Slic3r
diff --git a/src/slic3r/GUI/DeviceCore/DevFilaSystem.cpp b/src/slic3r/GUI/DeviceCore/DevFilaSystem.cpp
index 14880a6ef3..14d78fba1f 100644
--- a/src/slic3r/GUI/DeviceCore/DevFilaSystem.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevFilaSystem.cpp
@@ -18,7 +18,6 @@
#include
#include
#include "DevFilaSystem.h"
-#include "json_diff.hpp"
#include "slic3r/Utils/NetworkAgent.hpp"
#include "DevNozzleSystem.h" // DevNozzle / DevNozzleSystem for GetNozzleFlowStringByAmsId
@@ -161,7 +160,7 @@ DevAms::~DevAms()
m_trays.clear();
}
-static unordered_map s_ams_display_formats = {
+static std::unordered_map s_ams_display_formats = {
{DevAms::AMS, "AMS-%d"},
{DevAms::AMS_LITE, "AMS Lite-%d"},
{DevAms::N3F, "AMS 2 PRO-%d"},
diff --git a/src/slic3r/GUI/DeviceCore/DevFilaSystem.h b/src/slic3r/GUI/DeviceCore/DevFilaSystem.h
index 32edc06a32..27dc238e9e 100644
--- a/src/slic3r/GUI/DeviceCore/DevFilaSystem.h
+++ b/src/slic3r/GUI/DeviceCore/DevFilaSystem.h
@@ -1,6 +1,6 @@
#pragma once
#include "libslic3r/CommonDefs.hpp"
-#include "slic3r/Utils/json_diff.hpp"
+#include
#include "DevDefs.h"
#include "DevFilaAmsSetting.h"
@@ -415,9 +415,9 @@ private:
class DevFilaSystemParser
{
public:
- static void ParseV1_0(const json& print_json, MachineObject* obj, DevFilaSystem* system, bool key_field_only);
+ static void ParseV1_0(const nlohmann::json& print_json, MachineObject* obj, DevFilaSystem* system, bool key_field_only);
- static void ParseAgentFilament(const json& data, MachineObject* obj, DevFilaSystem* system);
+ static void ParseAgentFilament(const nlohmann::json& data, MachineObject* obj, DevFilaSystem* system);
};
struct DevFilamentDryingPreset
diff --git a/src/slic3r/GUI/DeviceCore/DevFilaSystemCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevFilaSystemCtrl.cpp
index 16121f00d2..e7181580cd 100644
--- a/src/slic3r/GUI/DeviceCore/DevFilaSystemCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevFilaSystemCtrl.cpp
@@ -2,7 +2,6 @@
#include
#include "DevFilaSystem.h"
-#include "json_diff.hpp"
#include "slic3r/GUI/DeviceManager.hpp"// TODO: remove this include
using namespace nlohmann;
diff --git a/src/slic3r/GUI/DeviceCore/DevFirmware.h b/src/slic3r/GUI/DeviceCore/DevFirmware.h
index 1b251144e5..bc0a0f0168 100644
--- a/src/slic3r/GUI/DeviceCore/DevFirmware.h
+++ b/src/slic3r/GUI/DeviceCore/DevFirmware.h
@@ -1,11 +1,9 @@
#pragma once
#include "DevFirmware.h"
-#include "slic3r/Utils/json_diff.hpp"
#include
#include
#include
-#include "slic3r/Utils/json_diff.hpp"
namespace Slic3r {
@@ -51,10 +49,10 @@ public:
bool isCuttingModule() const { return product_name.Contains("Cutting Module"); }
bool isRotary() const { return product_name.Contains("Rotary"); }// Rotary Attachment
bool isExtinguishSystem() const { return product_name.Contains("Extinguishing System"); }// Auto Fire Extinguishing System
- bool isWTM() const { return name.find("wtm") != string::npos; } // nozzle
+ bool isWTM() const { return name.find("wtm") != std::string::npos; } // nozzle
bool isExhaustFan() const { return product_name.Contains("Exhaust Fan"); }
- bool isHmshub() const { return product_name.find("Filament Buffer") != string::npos; }
- bool isFilaTrackSwitch() const { return product_name.find("Filament Track") != string::npos; }
+ bool isHmshub() const { return product_name.find("Filament Buffer") != std::string::npos; }
+ bool isFilaTrackSwitch() const { return product_name.find("Filament Track") != std::string::npos; }
};
diff --git a/src/slic3r/GUI/DeviceCore/DevHMS.cpp b/src/slic3r/GUI/DeviceCore/DevHMS.cpp
index 456e806170..b696542658 100644
--- a/src/slic3r/GUI/DeviceCore/DevHMS.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevHMS.cpp
@@ -2,10 +2,12 @@
#include "DevHMS.h"
#include
#include
-#include "json_diff.hpp"
+#include
#include
#include
+using json = nlohmann::json;
+
namespace Slic3r
{
diff --git a/src/slic3r/GUI/DeviceCore/DevHMS.h b/src/slic3r/GUI/DeviceCore/DevHMS.h
index 82022833cf..1e499f3aea 100644
--- a/src/slic3r/GUI/DeviceCore/DevHMS.h
+++ b/src/slic3r/GUI/DeviceCore/DevHMS.h
@@ -1,6 +1,6 @@
#pragma once
-#include "slic3r/Utils/json_diff.hpp"
+#include
#include
#include
#include
@@ -18,7 +18,7 @@ public:
DevHMS(MachineObject* obj) : m_object(obj) {}
public:
- void ParseHMSItems(const json& hms_json);
+ void ParseHMSItems(const nlohmann::json& hms_json);
const std::vector& GetHMSItems() const { return m_hms_list; };
private:
@@ -69,7 +69,7 @@ public:
bool has_read() const { return m_already_read; };
protected:
- friend void DevHMS::ParseHMSItems(const json& hms_json);
+ friend void DevHMS::ParseHMSItems(const nlohmann::json& hms_json);
bool parse_hms_info(unsigned attr, unsigned code);
private:
diff --git a/src/slic3r/GUI/DeviceCore/DevLampCtrl.cpp b/src/slic3r/GUI/DeviceCore/DevLampCtrl.cpp
index 5190632b5b..fefad1479f 100644
--- a/src/slic3r/GUI/DeviceCore/DevLampCtrl.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevLampCtrl.cpp
@@ -3,7 +3,6 @@
#include "DevLamp.h"
// TODO: remove this include
-#include "json_diff.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
using namespace nlohmann;
diff --git a/src/slic3r/GUI/DeviceCore/DevManager.cpp b/src/slic3r/GUI/DeviceCore/DevManager.cpp
index 0fd5ed2cc0..c04321e71f 100644
--- a/src/slic3r/GUI/DeviceCore/DevManager.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevManager.cpp
@@ -23,7 +23,6 @@
#include "DevUtil.h"
// TODO: remove this include
-#include "json_diff.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/GUI_App.hpp"
diff --git a/src/slic3r/GUI/DeviceCore/DevManager.h b/src/slic3r/GUI/DeviceCore/DevManager.h
index 5ab3eed01b..1a669d0aee 100644
--- a/src/slic3r/GUI/DeviceCore/DevManager.h
+++ b/src/slic3r/GUI/DeviceCore/DevManager.h
@@ -3,7 +3,6 @@
#include
#include "libslic3r/CommonDefs.hpp"
-#include "slic3r/Utils/json_diff.hpp"
#include
#include
#include
diff --git a/src/slic3r/GUI/DeviceCore/DevMapping.cpp b/src/slic3r/GUI/DeviceCore/DevMapping.cpp
index 1ad35d3ee9..906ac2345b 100644
--- a/src/slic3r/GUI/DeviceCore/DevMapping.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevMapping.cpp
@@ -6,7 +6,6 @@
#include
#include
-#include
#include
#include
#include
@@ -21,8 +20,6 @@
#include "slic3r/GUI/DeviceManager.hpp"
#include "slic3r/GUI/GuiColor.hpp"
-using namespace nlohmann;
-
namespace Slic3r
{
bool DevMappingUtil::is_valid_mapping_result(const MachineObject* obj, std::vector& result, bool check_empty_slot)
diff --git a/src/slic3r/GUI/DeviceCore/DevMappingNozzle.cpp b/src/slic3r/GUI/DeviceCore/DevMappingNozzle.cpp
index ee935a58a0..95081f5382 100644
--- a/src/slic3r/GUI/DeviceCore/DevMappingNozzle.cpp
+++ b/src/slic3r/GUI/DeviceCore/DevMappingNozzle.cpp
@@ -6,7 +6,6 @@
#include "DevUtil.h"
#include "DevUtilBackend.h"
-#include "json_diff.hpp"
#include "libslic3r/MultiNozzleUtils.hpp"
#include "slic3r/GUI/DeviceManager.hpp"
@@ -251,7 +250,7 @@ int DevNozzleMappingCtrl::CtrlGetAutoNozzleMappingV1(Slic3r::GUI::Plater* plater
void DevNozzleMappingCtrl::ParseAutoNozzleMapping(const json& print_jj)
{
- if (print_jj.contains("command") && print_jj["command"].get() == "get_auto_nozzle_mapping") {
+ if (print_jj.contains("command") && print_jj["command"].get