TriangleSelector: Separated frontend/backend, support of multiple volumes, etc.

This commit is contained in:
Lukas Matena 2020-07-09 16:25:34 +02:00
parent b250c08ec9
commit 6baff45759
7 changed files with 856 additions and 855 deletions

View file

@ -2,6 +2,7 @@
#include "ModelArrange.hpp"
#include "Geometry.hpp"
#include "MTUtils.hpp"
#include "TriangleSelector.hpp"
#include "Format/AMF.hpp"
#include "Format/OBJ.hpp"
@ -1833,25 +1834,21 @@ arrangement::ArrangePolygon ModelInstance::get_arrange_polygon() const
std::vector<int> FacetsAnnotation::get_facets(FacetSupportType type) const
{
std::vector<int> out;
for (auto& [facet_idx, this_type] : m_data)
/*for (auto& [facet_idx, this_type] : m_data)
if (this_type == type)
out.push_back(facet_idx);
return out;
*/return out;
}
void FacetsAnnotation::set_facet(int idx, FacetSupportType type)
void FacetsAnnotation::set(const TriangleSelector& selector)
{
bool changed = true;
if (type == FacetSupportType::NONE)
changed = m_data.erase(idx) != 0;
else
m_data[idx] = type;
if (changed)
std::map<int, std::vector<bool>> sel_map = selector.serialize();
if (sel_map != m_data) {
m_data = sel_map;
update_timestamp();
}
}