Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Layers editing profile's background texture rendering

Tech ENABLE_GLBEGIN_GLEND_REMOVAL - A few fixes in layers editing profile rendering

(cherry picked from commit prusa3d/PrusaSlicer@a939d8e4c0)
(cherry picked from commit prusa3d/PrusaSlicer@8c807dbcc4)
This commit is contained in:
enricoturri1966 2023-10-21 17:05:16 +08:00 committed by Noisyfox
parent 354f8e20fb
commit 35899b96ba
6 changed files with 89 additions and 97 deletions

View file

@ -62,25 +62,24 @@ class RetinaHelper;
class Size
{
int m_width;
int m_height;
float m_scale_factor;
int m_width{ 0 };
int m_height{ 0 };
float m_scale_factor{ 1.0f };
public:
Size();
Size(int width, int height, float scale_factor = 1.0);
Size() = default;
Size(int width, int height, float scale_factor = 1.0f) : m_width(width), m_height(height), m_scale_factor(scale_factor) {}
int get_width() const;
void set_width(int width);
int get_width() const { return m_width; }
void set_width(int width) { m_width = width; }
int get_height() const;
void set_height(int height);
int get_height() const { return m_height; }
void set_height(int height) { m_height = height; }
int get_scale_factor() const;
void set_scale_factor(int height);
float get_scale_factor() const { return m_scale_factor; }
void set_scale_factor(float factor) { m_scale_factor = factor; }
};
class RenderTimerEvent : public wxEvent
{
public:
@ -261,8 +260,10 @@ class GLCanvas3D
{
GLModel baseline;
GLModel profile;
GLModel background;
Rect old_bar_rect;
std::vector<double> old_layer_height_profile;
bool dirty{ false };
};
Profile m_profile;
@ -303,10 +304,8 @@ class GLCanvas3D
private:
bool is_initialized() const;
void generate_layer_height_texture();
void render_background_texture(const GLCanvas3D& canvas, const Rect& bar_rect);
void render_curve(const Rect& bar_rect);
void render_active_object_annotations(const GLCanvas3D& canvas, const Rect& bar_rect);
void render_profile(const Rect& bar_rect);
void update_slicing_parameters();
static float thickness_bar_width(const GLCanvas3D& canvas);