mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-03 02:22:46 +00:00
Rotate gizmo rendering
This commit is contained in:
@@ -12,6 +12,11 @@ namespace GUI {
|
||||
|
||||
class GLGizmoBase
|
||||
{
|
||||
protected:
|
||||
static const float BaseColor[3];
|
||||
static const float HighlightColor[3];
|
||||
static const float GrabberHalfSize;
|
||||
|
||||
public:
|
||||
enum EState
|
||||
{
|
||||
@@ -44,10 +49,22 @@ public:
|
||||
protected:
|
||||
virtual bool on_init() = 0;
|
||||
virtual void on_render(const BoundingBoxf3& box) const = 0;
|
||||
|
||||
void _render_square(const Pointf3& center) const;
|
||||
};
|
||||
|
||||
class GLGizmoRotate : public GLGizmoBase
|
||||
{
|
||||
static const float Offset;
|
||||
static const unsigned int CircleResolution;
|
||||
static const unsigned int ScaleStepsCount;
|
||||
static const float ScaleStepRad;
|
||||
static const unsigned int ScaleLongEvery;
|
||||
static const float ScaleLongTooth;
|
||||
static const float ScaleShortTooth;
|
||||
static const unsigned int SnapRegionsCount;
|
||||
static const float GrabberOffset;
|
||||
|
||||
float m_angle_x;
|
||||
float m_angle_y;
|
||||
float m_angle_z;
|
||||
@@ -58,12 +75,18 @@ public:
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual void on_render(const BoundingBoxf3& box) const;
|
||||
|
||||
private:
|
||||
void _render_circle(const Pointf3& center, float radius) const;
|
||||
void _render_scale(const Pointf3& center, float radius) const;
|
||||
void _render_snap_radii(const Pointf3& center, float radius) const;
|
||||
void _render_reference_radius(const Pointf3& center, float radius) const;
|
||||
void _render_grabber(const Pointf3& center, float radius) const;
|
||||
};
|
||||
|
||||
class GLGizmoScale : public GLGizmoBase
|
||||
{
|
||||
static const float Offset;
|
||||
static const float SquareHalfSize;
|
||||
|
||||
float m_scale_x;
|
||||
float m_scale_y;
|
||||
@@ -75,9 +98,6 @@ public:
|
||||
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