mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 21:27:52 -06:00
Print/PrintObject/PrintRegion refactoring:
Newly the PrintObjects own PrintRegions and Print contains references to PrintRegions owned by PrintObjects, so that a PrintRegion of the same content is referenced by Print only once. The refactoring is a WIP to support multi-material painting.
This commit is contained in:
parent
123c5af347
commit
0ca6b12da1
5 changed files with 122 additions and 149 deletions
|
@ -97,18 +97,12 @@ PrintBase::ApplyStatus PrintObject::set_instances(PrintInstances &&instances)
|
|||
return status;
|
||||
}
|
||||
|
||||
const PrintRegion& PrintObject::printing_region(size_t idx) const throw()
|
||||
{
|
||||
return m_print->get_print_region(idx);
|
||||
}
|
||||
|
||||
std::vector<std::reference_wrapper<const PrintRegion>> PrintObject::all_regions() const
|
||||
{
|
||||
std::vector<std::reference_wrapper<const PrintRegion>> out;
|
||||
out.reserve(m_region_volumes.size());
|
||||
for (size_t i = 0; i < m_region_volumes.size(); ++ i)
|
||||
if (! m_region_volumes[i].empty())
|
||||
out.emplace_back(m_print->get_print_region(i));
|
||||
out.reserve(m_all_regions.size());
|
||||
for (size_t i = 0; i < m_all_regions.size(); ++ i)
|
||||
out.emplace_back(*m_all_regions[i]);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue