mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 17:58:03 -06:00
NEW: add text gizmo tool
Signed-off-by: yifan.wu <yifan.wu@bambulab.com> Change-Id: I77fdf64340f580e6baa3260101fa1c6db7a4ab2d (cherry picked from commit 2147c55134b4d9d1018d7e9f4f8d1a4d50c065f6)
This commit is contained in:
parent
65ba9cafb3
commit
b068389d4c
11 changed files with 448 additions and 1 deletions
43
src/slic3r/GUI/Gizmos/GLGizmoText.hpp
Normal file
43
src/slic3r/GUI/Gizmos/GLGizmoText.hpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#ifndef slic3r_GLGizmoText_hpp_
|
||||
#define slic3r_GLGizmoText_hpp_
|
||||
|
||||
#include "GLGizmoBase.hpp"
|
||||
#include "slic3r/GUI/3DScene.hpp"
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
enum class ModelVolumeType : int;
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class GLGizmoText : public GLGizmoBase
|
||||
{
|
||||
private:
|
||||
std::vector<std::string> m_avail_font_names;
|
||||
char m_text[256] = { 0 };
|
||||
std::string m_font_name;
|
||||
float m_font_size = 16.f;
|
||||
int m_curr_font_idx = 0;
|
||||
bool m_bold = true;
|
||||
bool m_italic = false;
|
||||
float m_thickness = 2.f;
|
||||
|
||||
public:
|
||||
GLGizmoText(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id);
|
||||
|
||||
protected:
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_render() override;
|
||||
virtual void on_render_for_picking() override;
|
||||
virtual void on_set_state() override;
|
||||
virtual CommonGizmosDataID on_get_requirements() const override;
|
||||
virtual void on_render_input_window(float x, float y, float bottom_limit);
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
#endif // slic3r_GLGizmoText_hpp_
|
Loading…
Add table
Add a link
Reference in a new issue