mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 08:41:11 -06:00
Polishing of NotificationManager:
Fixed pairing of PrintObjects with slicing warning notifications. Removed or commented out dead code. Added documentation.
This commit is contained in:
parent
c47d4cdc03
commit
447f4b8303
9 changed files with 89 additions and 68 deletions
|
@ -577,6 +577,16 @@ void Print::config_diffs(
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<ObjectID> Print::print_object_ids() const
|
||||
{
|
||||
std::vector<ObjectID> out;
|
||||
// Reserve one more for the caller to append the ID of the Print itself.
|
||||
out.reserve(m_objects.size() + 1);
|
||||
for (const PrintObject *print_object : m_objects)
|
||||
out.emplace_back(print_object->id());
|
||||
return out;
|
||||
}
|
||||
|
||||
Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_config)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
|
|
@ -370,6 +370,8 @@ public:
|
|||
// a cancellation callback is executed to stop the background processing before the operation.
|
||||
void clear() override;
|
||||
bool empty() const override { return m_objects.empty(); }
|
||||
// List of existing PrintObject IDs, to remove notifications for non-existent IDs.
|
||||
std::vector<ObjectID> print_object_ids() const override;
|
||||
|
||||
ApplyStatus apply(const Model &model, DynamicPrintConfig config) override;
|
||||
|
||||
|
|
|
@ -348,6 +348,8 @@ public:
|
|||
// The Print is empty either after clear() or after apply() over an empty model,
|
||||
// or after apply() over a model, where no object is printable (all outside the print volume).
|
||||
virtual bool empty() const = 0;
|
||||
// List of existing PrintObject IDs, to remove notifications for non-existent IDs.
|
||||
virtual std::vector<ObjectID> print_object_ids() const = 0;
|
||||
|
||||
// Validate the print, return empty string if valid, return error if process() cannot (or should not) be started.
|
||||
virtual std::string validate() const { return std::string(); }
|
||||
|
|
|
@ -175,6 +175,16 @@ static std::vector<SLAPrintObject::Instance> sla_instances(const ModelObject &mo
|
|||
return instances;
|
||||
}
|
||||
|
||||
std::vector<ObjectID> SLAPrint::print_object_ids() const
|
||||
{
|
||||
std::vector<ObjectID> out;
|
||||
// Reserve one more for the caller to append the ID of the Print itself.
|
||||
out.reserve(m_objects.size() + 1);
|
||||
for (const SLAPrintObject *print_object : m_objects)
|
||||
out.emplace_back(print_object->id());
|
||||
return out;
|
||||
}
|
||||
|
||||
SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, DynamicPrintConfig config)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
|
|
@ -420,6 +420,8 @@ public:
|
|||
|
||||
void clear() override;
|
||||
bool empty() const override { return m_objects.empty(); }
|
||||
// List of existing PrintObject IDs, to remove notifications for non-existent IDs.
|
||||
std::vector<ObjectID> print_object_ids() const;
|
||||
ApplyStatus apply(const Model &model, DynamicPrintConfig config) override;
|
||||
void set_task(const TaskParams ¶ms) override;
|
||||
void process() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue