TriangleSelector: Schedule restarting background process after edit
This commit is contained in:
parent
3b91d11ddf
commit
afb5d929c4
3 changed files with 9 additions and 3 deletions
|
@ -1841,13 +1841,15 @@ indexed_triangle_set FacetsAnnotation::get_facets(const ModelVolume& mv, FacetSu
|
|||
|
||||
|
||||
|
||||
void FacetsAnnotation::set(const TriangleSelector& selector)
|
||||
bool FacetsAnnotation::set(const TriangleSelector& selector)
|
||||
{
|
||||
std::map<int, std::vector<bool>> sel_map = selector.serialize();
|
||||
if (sel_map != m_data) {
|
||||
m_data = sel_map;
|
||||
update_timestamp();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -406,7 +406,7 @@ public:
|
|||
using ClockType = std::chrono::steady_clock;
|
||||
|
||||
const std::map<int, std::vector<bool>>& get_data() const { return m_data; }
|
||||
void set(const TriangleSelector& selector);
|
||||
bool set(const TriangleSelector& selector);
|
||||
indexed_triangle_set get_facets(const ModelVolume& mv, FacetSupportType type) const;
|
||||
void clear();
|
||||
|
||||
|
|
|
@ -204,14 +204,18 @@ void GLGizmoFdmSupports::render_cursor_circle() const
|
|||
|
||||
void GLGizmoFdmSupports::update_model_object() const
|
||||
{
|
||||
bool updated = false;
|
||||
ModelObject* mo = m_c->selection_info()->model_object();
|
||||
int idx = -1;
|
||||
for (ModelVolume* mv : mo->volumes) {
|
||||
if (! mv->is_model_part())
|
||||
continue;
|
||||
++idx;
|
||||
mv->m_supported_facets.set(*m_triangle_selectors[idx].get());
|
||||
updated |= mv->m_supported_facets.set(*m_triangle_selectors[idx].get());
|
||||
}
|
||||
|
||||
if (updated)
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue