mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-31 12:41:20 -06:00
Scale gizmo rendering
This commit is contained in:
parent
099d59ad27
commit
3a19b81cef
4 changed files with 132 additions and 52 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue