diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2018-07-27 09:49:58 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2018-07-27 09:49:58 +0300 |
commit | c2ab8c2ae3af6bd5489a7f1525b65fb51862b724 (patch) | |
tree | 820636b3e6e4628000941cf4fbb5cbc41394e129 | |
parent | b5b7894a6f6ac57b3a3f2b2546fc1c98b77f4935 (diff) |
Out of print volume detection for extrusion toolpaths only
-rw-r--r-- | xs/src/slic3r/GUI/3DScene.cpp | 1 | ||||
-rw-r--r-- | xs/src/slic3r/GUI/3DScene.hpp | 2 | ||||
-rw-r--r-- | xs/src/slic3r/GUI/GLCanvas3D.cpp | 13 |
3 files changed, 14 insertions, 2 deletions
diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp index 2d405e54a..601d10aaa 100644 --- a/xs/src/slic3r/GUI/3DScene.cpp +++ b/xs/src/slic3r/GUI/3DScene.cpp @@ -215,6 +215,7 @@ GLVolume::GLVolume(float r, float g, float b, float a) , hover(false) , is_modifier(false) , is_wipe_tower(false) + , is_extrusion_path(false) , tverts_range(0, size_t(-1)) , qverts_range(0, size_t(-1)) { diff --git a/xs/src/slic3r/GUI/3DScene.hpp b/xs/src/slic3r/GUI/3DScene.hpp index 242487195..a1227d8dd 100644 --- a/xs/src/slic3r/GUI/3DScene.hpp +++ b/xs/src/slic3r/GUI/3DScene.hpp @@ -299,6 +299,8 @@ public: bool is_modifier; // Wheter or not this volume has been generated from the wipe tower bool is_wipe_tower; + // Wheter or not this volume has been generated from an extrusion path + bool is_extrusion_path; // Interleaved triangles & normals with indexed triangles & quads. GLIndexedVertexArray indexed_vertex_array; diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index 6bca17375..bcd4e65ba 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -1828,7 +1828,6 @@ unsigned int GLCanvas3D::get_volumes_count() const void GLCanvas3D::reset_volumes() { - if (!m_volumes.empty()) { // ensures this canvas is current @@ -1839,6 +1838,9 @@ void GLCanvas3D::reset_volumes() m_volumes.clear(); m_dirty = true; } + + enable_warning_texture(false); + _reset_warning_texture(); } void GLCanvas3D::deselect_volumes() @@ -2377,6 +2379,12 @@ void GLCanvas3D::load_preview(const std::vector<std::string>& str_tool_colors) if (object != nullptr) _load_print_object_toolpaths(*object, str_tool_colors); } + + for (GLVolume* volume : m_volumes.volumes) + { + volume->is_extrusion_path = true; + } + _update_toolpath_volumes_outside_state(); _show_warning_texture_if_needed(); reset_legend_texture(); @@ -4276,6 +4284,7 @@ void GLCanvas3D::_load_gcode_extrusion_paths(const GCodePreviewData& preview_dat if (volume != nullptr) { filter.volume = volume; + volume->is_extrusion_path = true; m_volumes.volumes.emplace_back(volume); } else @@ -4757,7 +4766,7 @@ void GLCanvas3D::_update_toolpath_volumes_outside_state() for (GLVolume* volume : m_volumes.volumes) { - volume->is_outside = (print_volume.radius() > 0.0) ? !print_volume.contains(volume->transformed_bounding_box()) : false; + volume->is_outside = ((print_volume.radius() > 0.0) && volume->is_extrusion_path) ? !print_volume.contains(volume->bounding_box) : false; } } |