Various gizmos refactoring

This commit is contained in:
Filip Sykala 2023-10-29 23:11:10 +08:00 committed by Noisyfox
parent 30af274d44
commit 9dbb2dfe0d
22 changed files with 292 additions and 451 deletions

View file

@ -225,8 +225,11 @@ public:
bool check_gizmos_closed_except(EType) const;
void set_hover_id(int id);
void enable_grabber(EType type, unsigned int id, bool enable);
/// <summary>
/// Distribute information about different data into active gizmo
/// Should be called when selection changed
/// </summary>
void update_data();
void update_assemble_view_data();
@ -239,17 +242,6 @@ public:
bool handle_shortcut(int key);
bool is_dragging() const;
void start_dragging();
void stop_dragging();
Vec3d get_scale() const;
void set_scale(const Vec3d& scale);
Vec3d get_rotation() const;
void set_rotation(const Vec3d& rotation);
// BBS
void finish_cut_rotation();
//BBS
void* get_icon_texture_id(MENU_ICON_NAME icon) {
@ -265,13 +257,6 @@ public:
return nullptr;
}
void set_flattening_data(const ModelObject* model_object);
//void set_sla_support_data(ModelObject* model_object);
void set_painter_gizmo_data();
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position = Vec2d::Zero(), bool shift_down = false, bool alt_down = false, bool control_down = false);
ClippingPlane get_clipping_plane() const;
ClippingPlane get_assemble_view_clipping_plane() const;
bool wants_reslice_supports_on_undo() const;
@ -298,7 +283,6 @@ public:
void update_after_undo_redo(const UndoRedo::Snapshot& snapshot);
int get_selectable_icons_cnt() const { return get_selectable_idxs().size(); }
int get_shortcut_key(GLGizmosManager::EType) const;
// To end highlight set gizmo = undefined
void set_highlight(EType gizmo, bool highlight_shown) { m_highlight = std::pair<EType, bool>(gizmo, highlight_shown); }
@ -311,6 +295,12 @@ public:
bool get_uniform_scaling() const { return m_object_manipulation.get_uniform_scaling();}
private:
bool gizmo_event(SLAGizmoEventType action,
const Vec2d & mouse_position = Vec2d::Zero(),
bool shift_down = false,
bool alt_down = false,
bool control_down = false);
void render_background(float left, float top, float right, float bottom, float border_w, float border_h) const;
void do_render_overlay() const;