mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-03 02:22:46 +00:00
Scale gizmo rendering
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
#include "../../slic3r/GUI/GLTexture.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class BoundingBoxf3;
|
||||
class Pointf3;
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class GLGizmoBase
|
||||
@@ -35,10 +39,11 @@ public:
|
||||
unsigned int get_textures_id() const;
|
||||
int get_textures_size() const;
|
||||
|
||||
virtual void render() const = 0;
|
||||
void render(const BoundingBoxf3& box) const;
|
||||
|
||||
protected:
|
||||
virtual bool on_init() = 0;
|
||||
virtual void on_render(const BoundingBoxf3& box) const = 0;
|
||||
};
|
||||
|
||||
class GLGizmoRotate : public GLGizmoBase
|
||||
@@ -50,14 +55,16 @@ class GLGizmoRotate : public GLGizmoBase
|
||||
public:
|
||||
GLGizmoRotate();
|
||||
|
||||
void render() const;
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual void on_render(const BoundingBoxf3& box) const;
|
||||
};
|
||||
|
||||
class GLGizmoScale : public GLGizmoBase
|
||||
{
|
||||
static const float Offset;
|
||||
static const float SquareHalfSize;
|
||||
|
||||
float m_scale_x;
|
||||
float m_scale_y;
|
||||
float m_scale_z;
|
||||
@@ -65,10 +72,12 @@ class GLGizmoScale : public GLGizmoBase
|
||||
public:
|
||||
GLGizmoScale();
|
||||
|
||||
void render() const;
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual void on_render(const BoundingBoxf3& box) const;
|
||||
|
||||
private:
|
||||
void _render_square(const Pointf3& center) const;
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
|
||||
Reference in New Issue
Block a user