mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-31 12:41:20 -06:00
Created a new gizmo for flattening an object
This commit is contained in:
parent
a06b6716ea
commit
25a6c7e30e
5 changed files with 211 additions and 3 deletions
|
|
@ -149,6 +149,38 @@ protected:
|
|||
virtual void on_render_for_picking(const BoundingBoxf3& box) const;
|
||||
};
|
||||
|
||||
|
||||
class GLGizmoFlatten : public GLGizmoBase
|
||||
{
|
||||
// This gizmo does not use grabbers. The m_hover_id relates to polygon managed by the class itself.
|
||||
|
||||
private:
|
||||
mutable Pointf3 m_normal;
|
||||
|
||||
struct PlaneData {
|
||||
std::vector<Pointf3> vertices;
|
||||
Pointf3 normal;
|
||||
float color[3];
|
||||
};
|
||||
|
||||
std::vector<PlaneData> m_planes;
|
||||
|
||||
public:
|
||||
GLGizmoFlatten();
|
||||
|
||||
void set_flattening_data(std::vector<Pointf3s> vertices_list);
|
||||
Pointf3 get_flattening_normal() const;
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual void on_start_dragging();
|
||||
virtual void on_update(const Pointf& mouse_pos);
|
||||
virtual void on_render(const BoundingBoxf3& box) const;
|
||||
virtual void on_render_for_picking(const BoundingBoxf3& box) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace GUI
|
||||
} // namespace Slic3r
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue