Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenricoturri1966 <enricoturri@seznam.cz>2022-01-06 13:43:05 +0300
committerenricoturri1966 <enricoturri@seznam.cz>2022-01-06 13:43:05 +0300
commit7ed80e0a8d354ea30d67e8e5cef156b22643f92f (patch)
treeba7479e6e541f1c3d82385fc0142e7aa71a9a8fc /src/slic3r/GUI
parent934611206d8ab360ccabe9f27c7d6d72f3fb807e (diff)
Tech ENABLE_SPIRAL_VASE_LAYERS - 1st installment - Per-layer preview for spiral vase mode
Diffstat (limited to 'src/slic3r/GUI')
-rw-r--r--src/slic3r/GUI/GCodeViewer.cpp10
-rw-r--r--src/slic3r/GUI/GCodeViewer.hpp8
2 files changed, 13 insertions, 5 deletions
diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp
index 06370de6e..52c1bf929 100644
--- a/src/slic3r/GUI/GCodeViewer.cpp
+++ b/src/slic3r/GUI/GCodeViewer.cpp
@@ -2040,6 +2040,16 @@ void GCodeViewer::load_toolpaths(const GCodeProcessorResult& gcode_result)
sort_remove_duplicates(m_extruder_ids);
m_extruder_ids.shrink_to_fit();
+#if ENABLE_SPIRAL_VASE_LAYERS
+ // replace layers for spiral vase mode
+ if (!gcode_result.spiral_vase_layers.empty()) {
+ m_layers.reset();
+ for (const auto& layer : gcode_result.spiral_vase_layers) {
+ m_layers.append(layer.first, { layer.second.first, layer.second.second });
+ }
+ }
+#endif // ENABLE_SPIRAL_VASE_LAYERS
+
// set layers z range
if (!m_layers.empty())
m_layers_z_range = { 0, static_cast<unsigned int>(m_layers.size() - 1) };
diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp
index c56e88c88..a67208f10 100644
--- a/src/slic3r/GUI/GCodeViewer.hpp
+++ b/src/slic3r/GUI/GCodeViewer.hpp
@@ -448,9 +448,8 @@ class GCodeViewer
size_t first{ 0 };
size_t last{ 0 };
- bool operator == (const Endpoints& other) const {
- return first == other.first && last == other.last;
- }
+ bool operator == (const Endpoints& other) const { return first == other.first && last == other.last; }
+ bool operator != (const Endpoints& other) const { return !operator==(other); }
};
private:
@@ -479,9 +478,8 @@ class GCodeViewer
bool operator != (const Layers& other) const {
if (m_zs != other.m_zs)
return true;
- if (!(m_endpoints == other.m_endpoints))
+ if (m_endpoints != other.m_endpoints)
return true;
-
return false;
}
};