mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-20 06:01:16 +00:00
Add texture displacement gizmo and UV editor
This commit is contained in:
1 parent
a393b21642
commit
05083bb6ab
15 files changed
+5405
-102
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#include "TextureDisplacementPreviewJob.hpp"
|
||||
|
||||
#include "slic3r/GUI/I18N.hpp"
|
||||
|
||||
namespace Slic3r::GUI {
|
||||
|
||||
TextureDisplacementPreviewJob::TextureDisplacementPreviewJob(TextureDisplacementPreviewInput &&input, uint64_t generation,
|
||||
std::function<void(indexed_triangle_set, uint64_t)> on_finished)
|
||||
: m_input(std::move(input)), m_generation(generation), m_on_finished(std::move(on_finished))
|
||||
{
|
||||
}
|
||||
|
||||
void TextureDisplacementPreviewJob::process(Ctl &ctl)
|
||||
{
|
||||
ctl.update_status(0, _u8L("Computing texture displacement preview"));
|
||||
|
||||
// Only ever touches m_input (captured by value before this job was queued) and local state --
|
||||
// never the live Model -- so this is safe to run concurrently with the UI thread.
|
||||
m_result = build_texture_displacement(m_input.base_mesh, m_input.layers, m_input.facets_data);
|
||||
}
|
||||
|
||||
void TextureDisplacementPreviewJob::finalize(bool canceled, std::exception_ptr &eptr)
|
||||
{
|
||||
if (canceled || eptr || !m_on_finished)
|
||||
return;
|
||||
m_on_finished(std::move(m_result), m_generation);
|
||||
}
|
||||
|
||||
} // namespace Slic3r::GUI
|
||||
Reference in new issue
Block a user