SLA gizmos: make sure that the clipping plane is properly reset to zero when the shown meshes are exchanged
This commit is contained in:
parent
f902fc3445
commit
3c23917e9e
3 changed files with 17 additions and 6 deletions
|
@ -43,6 +43,7 @@ public:
|
||||||
void update_hollowed_mesh(std::unique_ptr<TriangleMesh> &&mesh);
|
void update_hollowed_mesh(std::unique_ptr<TriangleMesh> &&mesh);
|
||||||
|
|
||||||
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
||||||
|
void update_clipping_plane(bool keep_normal = false) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_init() override;
|
bool on_init() override;
|
||||||
|
@ -96,7 +97,6 @@ private:
|
||||||
void select_point(int i);
|
void select_point(int i);
|
||||||
void unselect_point(int i);
|
void unselect_point(int i);
|
||||||
void reload_cache();
|
void reload_cache();
|
||||||
void update_clipping_plane(bool keep_normal = false) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_set_state() override;
|
void on_set_state() override;
|
||||||
|
|
|
@ -80,6 +80,7 @@ public:
|
||||||
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
bool is_selection_rectangle_dragging() const { return m_selection_rectangle.is_dragging(); }
|
||||||
bool has_backend_supports() const;
|
bool has_backend_supports() const;
|
||||||
void reslice_SLA_supports(bool postpone_error_messages = false) const;
|
void reslice_SLA_supports(bool postpone_error_messages = false) const;
|
||||||
|
void update_clipping_plane(bool keep_normal = false) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool on_init() override;
|
bool on_init() override;
|
||||||
|
@ -139,7 +140,6 @@ private:
|
||||||
void switch_to_editing_mode();
|
void switch_to_editing_mode();
|
||||||
void disable_editing_mode();
|
void disable_editing_mode();
|
||||||
void reset_clipping_plane_normal() const;
|
void reset_clipping_plane_normal() const;
|
||||||
void update_clipping_plane(bool keep_normal = false) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_set_state() override;
|
void on_set_state() override;
|
||||||
|
|
|
@ -348,11 +348,22 @@ void GLGizmosManager::set_sla_support_data(ModelObject* model_object)
|
||||||
if (!m_enabled || m_gizmos.empty())
|
if (!m_enabled || m_gizmos.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Update common data for hollowing and sla support gizmos.
|
auto* gizmo_supports = dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports].get());
|
||||||
m_common_gizmos_data->update_from_backend(m_parent, model_object);
|
auto* gizmo_hollow = dynamic_cast<GLGizmoHollow*>(m_gizmos[Hollow].get());
|
||||||
|
|
||||||
dynamic_cast<GLGizmoSlaSupports*>(m_gizmos[SlaSupports].get())->set_sla_support_data(model_object, m_parent.get_selection());
|
|
||||||
dynamic_cast<GLGizmoHollow*>(m_gizmos[Hollow].get())->set_sla_support_data(model_object, m_parent.get_selection());
|
// Update common data for hollowing and sla support gizmos.
|
||||||
|
if (m_common_gizmos_data->update_from_backend(m_parent, model_object)) {
|
||||||
|
// FIXME: this is a hack to make that the clipping plane is
|
||||||
|
// updated when the update set its position to zero. The clipping
|
||||||
|
// plane itself should be common, including the update_function.
|
||||||
|
// Then update_from_backend could do it itself.
|
||||||
|
gizmo_supports->update_clipping_plane();
|
||||||
|
gizmo_hollow->update_clipping_plane();
|
||||||
|
}
|
||||||
|
|
||||||
|
gizmo_supports->set_sla_support_data(model_object, m_parent.get_selection());
|
||||||
|
gizmo_hollow->set_sla_support_data(model_object, m_parent.get_selection());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the gizmo used the event to do something, false otherwise.
|
// Returns true if the gizmo used the event to do something, false otherwise.
|
||||||
|
|
Loading…
Reference in a new issue