diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2019-11-18 19:27:15 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2019-11-18 19:50:56 +0300 |
commit | 7011c58faa24a9f62ca033231111982651419889 (patch) | |
tree | fab48a6f82bb16c0c524467328de6a2fdbc47c19 /src/slic3r/GUI/GLCanvas3D.hpp | |
parent | 673549d6085a06199c30ad3e6655392695d40437 (diff) | |
parent | 54357f846f695d9879fb023e8cb8de7804ca0dca (diff) |
Merge branch 'master' into lm_tm_hollowing
Diffstat (limited to 'src/slic3r/GUI/GLCanvas3D.hpp')
-rw-r--r-- | src/slic3r/GUI/GLCanvas3D.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index dc25f77d8..3430c3692 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -36,6 +36,9 @@ class GLShader; class ExPolygon; class BackgroundSlicingProcess; class GCodePreviewData; +#if ENABLE_THUMBNAIL_GENERATOR +struct ThumbnailData; +#endif // ENABLE_THUMBNAIL_GENERATOR struct SlicingParameters; enum LayerHeightEditActionType : unsigned int; @@ -104,6 +107,10 @@ wxDECLARE_EVENT(EVT_GLCANVAS_REDO, SimpleEvent); class GLCanvas3D { +#if ENABLE_THUMBNAIL_GENERATOR + static const double DefaultCameraZoomToBoxMarginFactor; +#endif // ENABLE_THUMBNAIL_GENERATOR + public: struct GCodePreviewVolumeIndex { @@ -520,6 +527,11 @@ public: bool is_dragging() const { return m_gizmos.is_dragging() || m_moving; } void render(); +#if ENABLE_THUMBNAIL_GENERATOR + // printable_only == false -> render also non printable volumes as grayed + // parts_only == false -> render also sla support and pad + void render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool transparent_background); +#endif // ENABLE_THUMBNAIL_GENERATOR void select_all(); void deselect_all(); @@ -639,7 +651,11 @@ private: BoundingBoxf3 _max_bounding_box(bool include_gizmos, bool include_bed_model) const; +#if ENABLE_THUMBNAIL_GENERATOR + void _zoom_to_box(const BoundingBoxf3& box, double margin_factor = DefaultCameraZoomToBoxMarginFactor); +#else void _zoom_to_box(const BoundingBoxf3& box); +#endif // ENABLE_THUMBNAIL_GENERATOR void _refresh_if_shown_on_screen(); @@ -667,6 +683,14 @@ private: void _render_sla_slices() const; void _render_selection_sidebar_hints() const; void _render_undo_redo_stack(const bool is_undo, float pos_x); +#if ENABLE_THUMBNAIL_GENERATOR + // render thumbnail using an off-screen framebuffer + void _render_thumbnail_framebuffer(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool transparent_background); + // render thumbnail using an off-screen framebuffer when GLEW_EXT_framebuffer_object is supported + void _render_thumbnail_framebuffer_ext(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool transparent_background); + // render thumbnail using the default framebuffer + void _render_thumbnail_legacy(ThumbnailData& thumbnail_data, unsigned int w, unsigned int h, bool printable_only, bool parts_only, bool transparent_background); +#endif // ENABLE_THUMBNAIL_GENERATOR void _update_volumes_hover_state() const; |