mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00: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:
@@ -31,6 +31,9 @@ namespace Slic3r {
|
||||
template class PrintState<PrintStep, psCount>;
|
||||
template class PrintState<PrintObjectStep, posCount>;
|
||||
|
||||
PrintRegion::PrintRegion(const PrintRegionConfig &config) : PrintRegion(config, config.hash()) {}
|
||||
PrintRegion::PrintRegion(PrintRegionConfig &&config) : PrintRegion(std::move(config), config.hash()) {}
|
||||
|
||||
void Print::clear()
|
||||
{
|
||||
tbb::mutex::scoped_lock lock(this->state_mutex());
|
||||
@@ -39,24 +42,10 @@ void Print::clear()
|
||||
for (PrintObject *object : m_objects)
|
||||
delete object;
|
||||
m_objects.clear();
|
||||
for (PrintRegion *region : m_print_regions)
|
||||
delete region;
|
||||
m_print_regions.clear();
|
||||
m_model.clear_objects();
|
||||
}
|
||||
|
||||
PrintRegion* Print::add_print_region()
|
||||
{
|
||||
m_print_regions.emplace_back(new PrintRegion());
|
||||
return m_print_regions.back();
|
||||
}
|
||||
|
||||
PrintRegion* Print::add_print_region(const PrintRegionConfig &config)
|
||||
{
|
||||
m_print_regions.emplace_back(new PrintRegion(config));
|
||||
return m_print_regions.back();
|
||||
}
|
||||
|
||||
// Called by Print::apply().
|
||||
// This method only accepts PrintConfig option keys.
|
||||
bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* new_config */, const std::vector<t_config_option_key> &opt_keys)
|
||||
|
||||
Reference in New Issue
Block a user