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

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-11-22 16:40:59 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-11-22 16:40:59 +0300
commit599403ba9468f9faf720b70e2a4be1dc20b32c70 (patch)
tree103ea4b788949a3c6ac09fa3945cd01820c9499f /src/slic3r/GUI/GLCanvas3D.hpp
parent4fceff6ae37889aee40f6a21d8da8e8cdc318f05 (diff)
parent62e69d986a48a211ed21ac43212f0608f339e413 (diff)
Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_3dconnexion
Diffstat (limited to 'src/slic3r/GUI/GLCanvas3D.hpp')
-rw-r--r--src/slic3r/GUI/GLCanvas3D.hpp42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp
index c72b935d0..c673bc39b 100644
--- a/src/slic3r/GUI/GLCanvas3D.hpp
+++ b/src/slic3r/GUI/GLCanvas3D.hpp
@@ -81,6 +81,8 @@ template <size_t N> using Vec2dsEvent = ArrayEvent<Vec2d, N>;
using Vec3dEvent = Event<Vec3d>;
template <size_t N> using Vec3dsEvent = ArrayEvent<Vec3d, N>;
+using HeightProfileSmoothEvent = Event<HeightProfileSmoothingParams>;
+
wxDECLARE_EVENT(EVT_GLCANVAS_INIT, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_RIGHT_CLICK, RBtnEvent);
@@ -104,6 +106,11 @@ wxDECLARE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_EDIT_COLOR_CHANGE, wxKeyEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_UNDO, SimpleEvent);
wxDECLARE_EVENT(EVT_GLCANVAS_REDO, SimpleEvent);
+#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+wxDECLARE_EVENT(EVT_GLCANVAS_RESET_LAYER_HEIGHT_PROFILE, SimpleEvent);
+wxDECLARE_EVENT(EVT_GLCANVAS_ADAPTIVE_LAYER_HEIGHT_PROFILE, Event<float>);
+wxDECLARE_EVENT(EVT_GLCANVAS_SMOOTH_LAYER_HEIGHT_PROFILE, HeightProfileSmoothEvent);
+#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
class GLCanvas3D
{
@@ -153,13 +160,17 @@ private:
private:
static const float THICKNESS_BAR_WIDTH;
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static const float THICKNESS_RESET_BUTTON_HEIGHT;
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
bool m_enabled;
Shader m_shader;
unsigned int m_z_texture_id;
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
mutable GLTexture m_tooltip_texture;
mutable GLTexture m_reset_texture;
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
// Not owned by LayersEditing.
const DynamicPrintConfig *m_config;
// ModelObject for the currently selected object (Model::objects[last_object_id]).
@@ -171,6 +182,11 @@ private:
std::vector<coordf_t> m_layer_height_profile;
bool m_layer_height_profile_modified;
+#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+ mutable float m_adaptive_cusp;
+ mutable HeightProfileSmoothingParams m_smooth_params;
+#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+
class LayersTexture
{
public:
@@ -217,28 +233,42 @@ private:
void adjust_layer_height_profile();
void accept_changes(GLCanvas3D& canvas);
void reset_layer_height_profile(GLCanvas3D& canvas);
+#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+ void adaptive_layer_height_profile(GLCanvas3D& canvas, float cusp);
+ void smooth_layer_height_profile(GLCanvas3D& canvas, const HeightProfileSmoothingParams& smoothing_paramsn);
+#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static float get_cursor_z_relative(const GLCanvas3D& canvas);
static bool bar_rect_contains(const GLCanvas3D& canvas, float x, float y);
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static bool reset_rect_contains(const GLCanvas3D& canvas, float x, float y);
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static Rect get_bar_rect_screen(const GLCanvas3D& canvas);
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static Rect get_reset_rect_screen(const GLCanvas3D& canvas);
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static Rect get_bar_rect_viewport(const GLCanvas3D& canvas);
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static Rect get_reset_rect_viewport(const GLCanvas3D& canvas);
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
float object_max_z() const { return m_object_max_z; }
private:
- bool _is_initialized() const;
+ bool is_initialized() const;
void generate_layer_height_texture();
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
void _render_tooltip_texture(const GLCanvas3D& canvas, const Rect& bar_rect, const Rect& reset_rect) const;
void _render_reset_texture(const Rect& reset_rect) const;
- void _render_active_object_annotations(const GLCanvas3D& canvas, const Rect& bar_rect) const;
- void _render_profile(const Rect& bar_rect) const;
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+ void render_active_object_annotations(const GLCanvas3D& canvas, const Rect& bar_rect) const;
+ void render_profile(const Rect& bar_rect) const;
void update_slicing_parameters();
static float thickness_bar_width(const GLCanvas3D &canvas);
+#if !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
static float reset_button_height(const GLCanvas3D &canvas);
+#endif // !ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
};
struct Mouse
@@ -501,6 +531,12 @@ public:
bool is_layers_editing_enabled() const;
bool is_layers_editing_allowed() const;
+#if ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+ void reset_layer_height_profile();
+ void adaptive_layer_height_profile(float cusp);
+ void smooth_layer_height_profile(const HeightProfileSmoothingParams& smoothing_params);
+#endif // ENABLE_ADAPTIVE_LAYER_HEIGHT_PROFILE
+
bool is_reload_delayed() const;
void enable_layers_editing(bool enable);