Sync most of the gizmos with latest PrusaSlicer

This commit is contained in:
enricoturri1966 2023-10-30 23:10:05 +08:00 committed by Noisyfox
parent 049dfd3e08
commit 1561d65712
33 changed files with 843 additions and 760 deletions

View file

@ -1,3 +1,7 @@
///|/ Copyright (c) Prusa Research 2019 - 2023 Oleksandra Iushchenko @YuSanka, Lukáš Matěna @lukasmatena, Enrico Turri @enricoturri1966, Filip Sykala @Jony01
///|/
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/
#ifndef slic3r_GLGizmoFlatten_hpp_
#define slic3r_GLGizmoFlatten_hpp_
@ -35,9 +39,8 @@ private:
std::vector<PlaneData> m_planes;
std::vector<std::shared_ptr<SceneRaycasterItem>> m_planes_casters;
bool m_mouse_left_down = false; // for detection left_up of this gizmo
const ModelObject* m_old_model_object = nullptr;
std::vector<const Transform3d*> instances_matrices;
int m_old_instance_id{ -1 };
void update_planes();
bool is_plane_update_necessary() const;
@ -45,7 +48,7 @@ private:
public:
GLGizmoFlatten(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id);
void set_flattening_data(const ModelObject* model_object);
void set_flattening_data(const ModelObject* model_object, int instance_id);
/// <summary>
/// Apply rotation on select plane
@ -54,7 +57,7 @@ public:
/// <returns>Return True when use the information otherwise False.</returns>
bool on_mouse(const wxMouseEvent &mouse_event) override;
void data_changed() override;
void data_changed(bool is_serializing) override;
protected:
bool on_init() override;
std::string on_get_name() const override;