Painting gizmos: show painted triangles inside modifier meshes

This commit is contained in:
Lukas Matena 2020-10-05 16:27:16 +02:00
parent 8bcdbb7a60
commit b155e58a9d
8 changed files with 42 additions and 6 deletions

View file

@ -59,6 +59,8 @@ class GLGizmoPainterBase : public GLGizmoBase
private:
ObjectID m_old_mo_id;
size_t m_old_volumes_size = 0;
virtual void on_render() const {}
virtual void on_render_for_picking() const {}
public:
GLGizmoPainterBase(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id);
@ -66,6 +68,12 @@ public:
void set_painter_gizmo_data(const Selection& selection);
bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down);
// Following function renders the triangles and cursor. Having this separated
// from usual on_render method allows to render them before transparent objects,
// so they can be seen inside them. The usual on_render is called after all
// volumes (including transparent ones) are rendered.
virtual void render_painter_gizmo() const = 0;
protected:
void render_triangles(const Selection& selection) const;
void render_cursor() const;