mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
imgui: Refactor, use in cut gizmo
This commit is contained in:
parent
763b443459
commit
c29493a41b
15 changed files with 315 additions and 157 deletions
|
@ -4,9 +4,13 @@
|
|||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include <imgui/imgui.h>
|
||||
|
||||
#include "libslic3r/Point.hpp"
|
||||
|
||||
class wxString;
|
||||
class wxMouseEvent;
|
||||
class ImFont;
|
||||
class ImDrawData;
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
@ -30,14 +34,16 @@ class ImGuiWrapper
|
|||
FontsMap m_fonts;
|
||||
unsigned int m_font_texture;
|
||||
|
||||
unsigned m_mouse_buttons;
|
||||
|
||||
public:
|
||||
ImGuiWrapper();
|
||||
~ImGuiWrapper();
|
||||
|
||||
bool init();
|
||||
void shutdown();
|
||||
|
||||
void set_display_size(float w, float h);
|
||||
void update_mouse_data(wxMouseEvent& evt);
|
||||
bool update_mouse_data(wxMouseEvent &evt);
|
||||
|
||||
void new_frame();
|
||||
void render();
|
||||
|
@ -45,19 +51,25 @@ public:
|
|||
void set_next_window_pos(float x, float y, int flag);
|
||||
void set_next_window_bg_alpha(float alpha);
|
||||
|
||||
bool begin(const std::string& name, int flags = 0);
|
||||
bool begin(const std::string &name, int flags = 0);
|
||||
bool begin(const wxString &name, int flags = 0);
|
||||
void end();
|
||||
|
||||
bool input_double(const std::string& label, double& value, const std::string& format = "%.3f");
|
||||
|
||||
bool input_vec3(const std::string& label, Vec3d& value, float width, const std::string& format = "%.3f");
|
||||
bool button(const wxString &label);
|
||||
bool input_double(const std::string &label, const double &value, const std::string &format = "%.3f");
|
||||
bool input_vec3(const std::string &label, const Vec3d &value, float width, const std::string &format = "%.3f");
|
||||
bool checkbox(const wxString &label, bool &value);
|
||||
|
||||
bool want_mouse() const;
|
||||
bool want_keyboard() const;
|
||||
bool want_text_input() const;
|
||||
bool want_any_input() const;
|
||||
private:
|
||||
void create_device_objects();
|
||||
void create_fonts_texture();
|
||||
bool check_program(unsigned int handle, const char* desc);
|
||||
bool check_shader(unsigned int handle, const char* desc);
|
||||
void render_draw_data(ImDrawData* draw_data);
|
||||
bool check_program(unsigned int handle, const char *desc);
|
||||
bool check_shader(unsigned int handle, const char *desc);
|
||||
void render_draw_data(ImDrawData *draw_data);
|
||||
void destroy_device_objects();
|
||||
void destroy_fonts_texture();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue