2018-11-08 20:18:40 +01:00
|
|
|
#include "SLAPrint.hpp"
|
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
|
|
|
|
void SLAPrint::clear()
|
|
|
|
{
|
2018-11-09 12:02:42 +01:00
|
|
|
tbb::mutex::scoped_lock lock(this->cancel_mutex());
|
|
|
|
// The following call should stop background processing if it is running.
|
|
|
|
this->invalidate_all_steps();
|
|
|
|
for (SLAPrintObject *object : m_objects)
|
|
|
|
delete object;
|
|
|
|
m_objects.clear();
|
2018-11-08 20:18:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConfig &config)
|
|
|
|
{
|
2018-11-09 12:02:42 +01:00
|
|
|
if (m_objects.empty())
|
|
|
|
return APPLY_STATUS_UNCHANGED;
|
|
|
|
|
|
|
|
// Grab the lock for the Print / PrintObject milestones.
|
|
|
|
tbb::mutex::scoped_lock lock(this->cancel_mutex());
|
|
|
|
|
|
|
|
// Temporary quick fix, just invalidate everything.
|
|
|
|
{
|
|
|
|
for (SLAPrintObject *print_object : m_objects) {
|
|
|
|
print_object->invalidate_all_steps();
|
|
|
|
delete print_object;
|
|
|
|
}
|
|
|
|
m_objects.clear();
|
|
|
|
this->invalidate_all_steps();
|
|
|
|
// Copy the model by value (deep copy), keep the Model / ModelObject / ModelInstance / ModelVolume IDs.
|
|
|
|
m_model.assign_copy(model);
|
|
|
|
// Generate new SLAPrintObjects.
|
|
|
|
for (const ModelObject *model_object : m_model.objects) {
|
|
|
|
//TODO
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-08 20:18:40 +01:00
|
|
|
return APPLY_STATUS_INVALIDATED;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SLAPrint::process()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-11-09 12:02:42 +01:00
|
|
|
} // namespace Slic3r
|