Separate GizmoManager on_move into gizmo itself

(cherry picked from commit prusa3d/PrusaSlicer@c751d6327d)
This commit is contained in:
Filip Sykala 2023-10-29 22:08:21 +08:00 committed by Noisyfox
parent 005b83912d
commit 30af274d44
24 changed files with 559 additions and 533 deletions

View file

@ -129,24 +129,10 @@ private:
GizmoObjectManipulation m_object_manipulation;
std::vector<size_t> get_selectable_idxs() const;
size_t get_gizmo_idx_from_mouse(const Vec2d& mouse_pos) const;
EType get_gizmo_from_mouse(const Vec2d &mouse_pos) const;
bool activate_gizmo(EType type);
struct MouseCapture
{
bool left;
bool middle;
bool right;
GLCanvas3D* parent;
MouseCapture() { reset(); }
bool any() const { return left || middle || right; }
void reset() { left = middle = right = false; parent = nullptr; }
};
MouseCapture m_mouse_capture;
std::string m_tooltip;
bool m_serializing;
std::unique_ptr<CommonGizmosDataPool> m_common_gizmos_data;
@ -155,6 +141,15 @@ private:
std::map<int, void*> icon_list;
bool m_is_dark = false;
/// <summary>
/// Process mouse event on gizmo toolbar
/// </summary>
/// <param name="mouse_event">Event descriptor</param>
/// <returns>TRUE when take responsibility for event otherwise FALSE.
/// On true, event should not be process by others.
/// On false, event should be process by others.</returns>
bool gizmos_toolbar_on_mouse(const wxMouseEvent &mouse_event);
public:
std::unique_ptr<AssembleViewDataPool> m_assemble_view_data;
@ -232,7 +227,6 @@ public:
void set_hover_id(int id);
void enable_grabber(EType type, unsigned int id, bool enable);
void update(const Linef3& mouse_ray, const Point& mouse_pos);
void update_data();
void update_assemble_view_data();
@ -248,13 +242,9 @@ public:
void start_dragging();
void stop_dragging();
Vec3d get_displacement() const;
Vec3d get_scale() const;
void set_scale(const Vec3d& scale);
Vec3d get_scale_offset() const;
Vec3d get_rotation() const;
void set_rotation(const Vec3d& rotation);
@ -275,8 +265,6 @@ public:
return nullptr;
}
Vec3d get_flattening_normal() const;
void set_flattening_data(const ModelObject* model_object);
//void set_sla_support_data(ModelObject* model_object);
@ -302,8 +290,8 @@ public:
std::string get_tooltip() const;
bool on_mouse(wxMouseEvent& evt);
bool on_mouse_wheel(wxMouseEvent& evt);
bool on_mouse(const wxMouseEvent &mouse_event);
bool on_mouse_wheel(const wxMouseEvent &evt);
bool on_char(wxKeyEvent& evt);
bool on_key(wxKeyEvent& evt);
@ -329,8 +317,7 @@ private:
bool generate_icons_texture();
void update_on_off_state(const Vec2d& mouse_pos);
std::string update_hover_state(const Vec2d& mouse_pos);
void update_hover_state(const EType &type);
bool grabber_contains_mouse() const;
};