remove GLModel from base class

- only 2 gizmo use cone
This commit is contained in:
Filip Sykala 2021-12-10 15:51:07 +01:00
parent 123903f317
commit 3c7390e34e
6 changed files with 12 additions and 10 deletions

View File

@ -89,9 +89,6 @@ GLGizmoBase::GLGizmoBase(GLCanvas3D& parent, const std::string& icon_filename, u
, m_first_input_window_render(true) , m_first_input_window_render(true)
, m_dirty(false) , m_dirty(false)
{ {
m_cone.init_from(its_make_cone(1., 1., 2 * PI / 24));
m_sphere.init_from(its_make_sphere(1., (2 * M_PI) / 24.));
m_cylinder.init_from(its_make_cylinder(1., 1., 2 * PI / 24.));
} }
void GLGizmoBase::set_hover_id(int id) void GLGizmoBase::set_hover_id(int id)

View File

@ -99,10 +99,6 @@ protected:
ImGuiWrapper* m_imgui; ImGuiWrapper* m_imgui;
bool m_first_input_window_render; bool m_first_input_window_render;
CommonGizmosDataPool* m_c; CommonGizmosDataPool* m_c;
GLModel m_cone;
GLModel m_cylinder;
GLModel m_sphere;
public: public:
GLGizmoBase(GLCanvas3D& parent, GLGizmoBase(GLCanvas3D& parent,
const std::string& icon_filename, const std::string& icon_filename,

View File

@ -91,6 +91,7 @@ void GLGizmoRotate::disable_grabber() { m_grabbers[0].enabled = false; }
bool GLGizmoRotate::on_init() bool GLGizmoRotate::on_init()
{ {
m_cone.init_from(its_make_cone(1., 1., 2 * PI / 24));
m_grabbers.push_back(Grabber()); m_grabbers.push_back(Grabber());
return true; return true;
} }

View File

@ -42,6 +42,8 @@ private:
std::array<float, 4> m_drag_color; std::array<float, 4> m_drag_color;
std::array<float, 4> m_highlight_color; std::array<float, 4> m_highlight_color;
GLModel m_cone;
public: public:
GLGizmoRotate(GLCanvas3D& parent, Axis axis); GLGizmoRotate(GLCanvas3D& parent, Axis axis);
virtual ~GLGizmoRotate() = default; virtual ~GLGizmoRotate() = default;

View File

@ -28,9 +28,7 @@ namespace GUI {
GLGizmoSlaSupports::GLGizmoSlaSupports(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id) GLGizmoSlaSupports::GLGizmoSlaSupports(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id)
: GLGizmoBase(parent, icon_filename, sprite_id) : GLGizmoBase(parent, icon_filename, sprite_id)
{ {}
}
bool GLGizmoSlaSupports::on_init() bool GLGizmoSlaSupports::on_init()
{ {
@ -48,6 +46,10 @@ bool GLGizmoSlaSupports::on_init()
m_desc["manual_editing"] = _L("Manual editing"); m_desc["manual_editing"] = _L("Manual editing");
m_desc["clipping_of_view"] = _L("Clipping of view")+ ": "; m_desc["clipping_of_view"] = _L("Clipping of view")+ ": ";
m_desc["reset_direction"] = _L("Reset direction"); m_desc["reset_direction"] = _L("Reset direction");
m_cone.init_from(its_make_cone(1., 1., 2 * PI / 24));
m_cylinder.init_from(its_make_cylinder(1., 1., 2 * PI / 24.));
m_sphere.init_from(its_make_sphere(1., (2 * M_PI) / 24.));
return true; return true;
} }

View File

@ -85,6 +85,10 @@ private:
void render_points(const Selection& selection, bool picking = false) const; void render_points(const Selection& selection, bool picking = false) const;
bool unsaved_changes() const; bool unsaved_changes() const;
GLModel m_cone;
GLModel m_cylinder;
GLModel m_sphere;
bool m_lock_unique_islands = false; bool m_lock_unique_islands = false;
bool m_editing_mode = false; // Is editing mode active? bool m_editing_mode = false; // Is editing mode active?
float m_new_point_head_diameter; // Size of a new point. float m_new_point_head_diameter; // Size of a new point.