mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-09-01 06:21:48 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
76
src/slic3r/GUI/Jobs/RotoptimizeJob.hpp
Normal file
76
src/slic3r/GUI/Jobs/RotoptimizeJob.hpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#ifndef ROTOPTIMIZEJOB_HPP
|
||||
#define ROTOPTIMIZEJOB_HPP
|
||||
|
||||
#include "PlaterJob.hpp"
|
||||
|
||||
#include "libslic3r/SLA/Rotfinder.hpp"
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class RotoptimizeJob : public PlaterJob
|
||||
{
|
||||
using FindFn = std::function<Vec2d(const ModelObject & mo,
|
||||
const sla::RotOptimizeParams ¶ms)>;
|
||||
|
||||
struct FindMethod { std::string name; FindFn findfn; std::string descr; };
|
||||
|
||||
static inline const FindMethod Methods[]
|
||||
= {{L("Best surface quality"),
|
||||
sla::find_best_misalignment_rotation,
|
||||
L("Optimize object rotation for best surface quality.")},
|
||||
{L("Reduced overhang slopes"),
|
||||
sla::find_least_supports_rotation,
|
||||
L("Optimize object rotation to have minimum amount of overhangs needing support "
|
||||
"structures.\nNote that this method will try to find the best surface of the object "
|
||||
"for touching the print bed if no elevation is set.")},
|
||||
// Just a min area bounding box that is done for all methods anyway.
|
||||
{L("Lowest Z height"),
|
||||
sla::find_min_z_height_rotation,
|
||||
L("Rotate the model to have the lowest z height for faster print time.")}};
|
||||
|
||||
size_t m_method_id = 0;
|
||||
float m_accuracy = 0.75;
|
||||
|
||||
DynamicPrintConfig m_default_print_cfg;
|
||||
|
||||
struct ObjRot
|
||||
{
|
||||
size_t idx;
|
||||
std::optional<Vec2d> rot;
|
||||
ObjRot(size_t id): idx{id}, rot{} {}
|
||||
};
|
||||
|
||||
std::vector<ObjRot> m_selected_object_ids;
|
||||
|
||||
protected:
|
||||
|
||||
void prepare() override;
|
||||
void process() override;
|
||||
|
||||
public:
|
||||
|
||||
RotoptimizeJob(std::shared_ptr<ProgressIndicator> pri, Plater *plater)
|
||||
: PlaterJob{std::move(pri), plater}
|
||||
{}
|
||||
|
||||
void finalize() override;
|
||||
|
||||
static constexpr size_t get_methods_count() { return std::size(Methods); }
|
||||
|
||||
static std::string get_method_name(size_t i)
|
||||
{
|
||||
return _utf8(Methods[i].name);
|
||||
}
|
||||
|
||||
static std::string get_method_description(size_t i)
|
||||
{
|
||||
return _utf8(Methods[i].descr);
|
||||
}
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
#endif // ROTOPTIMIZEJOB_HPP
|
Loading…
Add table
Add a link
Reference in a new issue