OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::FillBedJob Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/FillBedJob.hpp>

Inheritance diagram for Slic3r::GUI::FillBedJob:
Collaboration diagram for Slic3r::GUI::FillBedJob:

Public Types

enum  JobPrepareState { PREPARE_STATE_DEFAULT = 0 , PREPARE_STATE_MENU = 1 }

Public Member Functions

void prepare ()
void process (Ctl &ctl) override
 FillBedJob (bool instances=false)
int status_range () const
void finalize (bool canceled, std::exception_ptr &e) override

Private Types

using ArrangePolygon = arrangement::ArrangePolygon
using ArrangePolygons = arrangement::ArrangePolygons

Private Attributes

int m_object_idx = -1
ArrangePolygons m_selected
ArrangePolygons m_unselected
ArrangePolygons m_locked
Points m_bedpts
arrangement::ArrangeParams params
int m_status_range = 0
Plater * m_plater
bool m_instances

Detailed Description

Member Typedef Documentation

◆ ArrangePolygon

◆ ArrangePolygons

Member Enumeration Documentation

◆ JobPrepareState

Enumerator
PREPARE_STATE_DEFAULT 
PREPARE_STATE_MENU 
22 {
25 };
@ PREPARE_STATE_MENU
Definition Job.hpp:24
@ PREPARE_STATE_DEFAULT
Definition Job.hpp:23

Constructor & Destructor Documentation

◆ FillBedJob()

Slic3r::GUI::FillBedJob::FillBedJob ( bool instances = false)
340: m_plater{wxGetApp().plater()}, m_instances{instances} {}
bool m_instances
Definition FillBedJob.hpp:33
Plater * m_plater
Definition FillBedJob.hpp:31

References m_instances, m_plater, and Slic3r::GUI::plater().

Here is the call graph for this function:

Member Function Documentation

◆ finalize()

void Slic3r::GUI::FillBedJob::finalize ( bool canceled,
std::exception_ptr & e )
overridevirtual

Reimplemented from Slic3r::GUI::Job.

343{
344 // Ignore the arrange result if aborted.
345 if (canceled || eptr)
346 return;
347
348 if (m_object_idx == -1) return;
349
350 ModelObject *model_object = m_plater->model().objects[m_object_idx];
351 if (model_object->instances.empty()) return;
352
353 //BBS: partplate
354 PartPlateList& plate_list = m_plater->get_partplate_list();
355 int plate_cols = plate_list.get_plate_cols();
356 int cur_plate = plate_list.get_curr_plate_index();
357
358 size_t inst_cnt = model_object->instances.size();
359
360 int added_cnt = std::accumulate(m_selected.begin(), m_selected.end(), 0, [](int s, auto &ap) {
361 return s + int(ap.priority == 0 && ap.bed_idx == 0);
362 });
363
364 int oldSize = m_plater->model().objects.size();
365
366 if (added_cnt > 0) {
367 //BBS: adjust the selected instances
368 for (ArrangePolygon& ap : m_selected) {
369 if (ap.bed_idx != 0) {
370 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":skipped: bed_id %1%, trans {%2%,%3%}") % ap.bed_idx % unscale<double>(ap.translation(X)) % unscale<double>(ap.translation(Y));
371 /*if (ap.itemid == -1)*/
372 continue;
373 ap.bed_idx = plate_list.get_plate_count();
374 }
375 else
376 ap.bed_idx = cur_plate;
377
378 if (m_selected.size() <= 100) {
379 ap.row = ap.bed_idx / plate_cols;
380 ap.col = ap.bed_idx % plate_cols;
381 ap.translation(X) += bed_stride_x(m_plater) * ap.col;
382 ap.translation(Y) -= bed_stride_y(m_plater) * ap.row;
383 }
384
385 ap.apply();
386
387 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":selected: bed_id %1%, trans {%2%,%3%}") % ap.bed_idx % unscale<double>(ap.translation(X)) % unscale<double>(ap.translation(Y));
388 }
389
390 int newSize = m_plater->model().objects.size();
391 auto obj_list = m_plater->sidebar().obj_list();
392 for (size_t i = oldSize; i < newSize; i++) {
393 obj_list->add_object_to_list(i, true, true, false);
395 }
396
397 if (m_instances && model_object->instances.size() > inst_cnt) {
398 const size_t new_instance_count = model_object->instances.size() - inst_cnt;
399 // Match the normal add-instance flow: update the scene before the
400 // object tree starts referring to the newly created instances.
401 m_plater->update();
402 // A single-instance object has no instance children in the object
403 // tree yet, so the first refresh must add the original as well.
405 m_object_idx, inst_cnt == 1 ? new_instance_count + 1 : new_instance_count);
406 }
407
408 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ": paste_objects_into_list";
409
410 /*for (ArrangePolygon& ap : m_selected) {
411 if (ap.bed_idx != arrangement::UNARRANGED && (ap.priority != 0 || ap.bed_idx == 0))
412 ap.apply();
413 }*/
414
415 //model_object->ensure_on_bed();
416 //BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ": model_object->ensure_on_bed()";
417
418 // FillBedJob has already computed and validated the final positions.
419 // The instance tree is synchronized above, so rerunning the general
420 // arranger here would only risk discarding a valid fill result.
421 m_plater->update();
422
423 {
424 Slic3r::LifecycleEventContext ctx;
426 ctx.msg = "arranged";
428 }
429 }
430
431 m_plater->mark_plate_toolbar_image_dirty();
432}
arrangement::ArrangePolygon ArrangePolygon
Definition FillBedJob.hpp:18
int m_object_idx
Definition FillBedJob.hpp:16
ArrangePolygons m_selected
Definition FillBedJob.hpp:21
void add_object_to_list(size_t obj_idx, bool call_selection_changed=true, bool notify_partplate=true, bool do_info_update=true)
Definition GUI_ObjectList.cpp:4214
void increase_object_instances(const size_t obj_idx, const size_t num)
Definition GUI_ObjectList.cpp:4493
void update_printable_state(int obj_idx, int instance_idx)
Definition GUI_ObjectList.cpp:7013
static ObjectList * obj_list()
Definition GUI_Factories.cpp:405
double bed_stride_y(const Plater *plater)
Definition ArrangeJob.cpp:983
double bed_stride_x(const Plater *plater)
Definition ArrangeJob.cpp:978
std::string msg
Definition LifecycleEvents.hpp:83
@ ObjectTransformed
Definition LifecycleEvents.hpp:38
@ Ok
Definition LifecycleEvents.hpp:68
T unscale(Q v)
Definition libslic3r.h:138
LifecycleEvtCode code
Definition LifecycleEvents.hpp:79
@ Y
Definition libslic3r.h:142
@ X
Definition libslic3r.h:141
void fire_lifecycle_event(LifecycleEvent event, const LifecycleEventContext &ctx)
Definition LifecycleEvents.hpp:234

References Slic3r::GUI::bed_stride_x(), Slic3r::GUI::bed_stride_y(), Slic3r::LifecycleEventContext::code, Slic3r::fire_lifecycle_event(), Slic3r::GUI::PartPlateList::get_curr_plate_index(), Slic3r::GUI::PartPlateList::get_plate_cols(), Slic3r::GUI::PartPlateList::get_plate_count(), Slic3r::ModelObject::instances, m_instances, m_object_idx, m_plater, m_selected, Slic3r::LifecycleEventContext::msg, Slic3r::GUI::obj_list(), Slic3r::ObjectTransformed, Slic3r::Ok, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Here is the call graph for this function:

◆ prepare()

void Slic3r::GUI::FillBedJob::prepare ( )
42{
43 PartPlateList& plate_list = m_plater->get_partplate_list();
44
45 m_locked.clear();
46 m_selected.clear();
47 m_unselected.clear();
48 m_bedpts.clear();
49
51
52 m_object_idx = m_plater->get_selected_object_idx();
53 if (m_object_idx == -1)
54 return;
55
56 //select current plate at first
57 int sel_id = m_plater->get_selection().get_instance_idx();
58 sel_id = std::max(sel_id, 0);
59
60 int sel_ret = plate_list.select_plate_by_obj(m_object_idx, sel_id);
61 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":select plate obj_id %1%, ins_id %2%, ret %3%}") % m_object_idx % sel_id % sel_ret;
62
63 PartPlate* plate = plate_list.get_curr_plate();
64 Model& model = m_plater->model();
65 BoundingBox plate_bb = plate->get_bounding_box_crd();
66 int plate_cols = plate_list.get_plate_cols();
67 int cur_plate_index = plate->get_index();
68
69 ModelObject *model_object = m_plater->model().objects[m_object_idx];
70 if (model_object->instances.empty()) return;
71
72 const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config();
73 m_selected.reserve(model_object->instances.size());
74 for (size_t oidx = 0; oidx < model.objects.size(); ++oidx)
75 {
76 ModelObject* mo = model.objects[oidx];
77 for (size_t inst_idx = 0; inst_idx < mo->instances.size(); ++inst_idx)
78 {
79 bool selected = (oidx == m_object_idx);
80
81 ArrangePolygon ap = get_instance_arrange_poly(mo->instances[inst_idx], global_config);
82 set_arrange_polygon_bed_exclusion_extruders(ap, *mo, *plate, global_config);
83 BoundingBox ap_bb = ap.transformed_poly().contour.bounding_box();
84 ap.name = mo->name;
85
86 if (selected)
87 {
88 if (mo->instances[inst_idx]->printable)
89 {
90 ++ap.priority;
91 ap.itemid = m_selected.size();
92 m_selected.emplace_back(ap);
93 }
94 else
95 {
96 if (plate_bb.contains(ap_bb))
97 {
98 ap.bed_idx = 0;
99 ap.itemid = m_unselected.size();
100 ap.row = cur_plate_index / plate_cols;
101 ap.col = cur_plate_index % plate_cols;
102 ap.translation(X) -= bed_stride_x(m_plater) * ap.col;
103 ap.translation(Y) += bed_stride_y(m_plater) * ap.row;
104 m_unselected.emplace_back(ap);
105 }
106 else
107 {
109 ap.itemid = m_locked.size();
110 m_locked.emplace_back(ap);
111 }
112 }
113 }
114 else
115 {
116 if (plate_bb.contains(ap_bb))
117 {
118 ap.bed_idx = 0;
119 ap.itemid = m_unselected.size();
120 ap.row = cur_plate_index / plate_cols;
121 ap.col = cur_plate_index % plate_cols;
122 ap.translation(X) -= bed_stride_x(m_plater) * ap.col;
123 ap.translation(Y) += bed_stride_y(m_plater) * ap.row;
124 m_unselected.emplace_back(ap);
125 }
126 else
127 {
129 ap.itemid = m_locked.size();
130 m_locked.emplace_back(ap);
131 }
132 }
133 }
134 }
135 /*
136 for (ModelInstance *inst : model_object->instances)
137 if (inst->printable) {
138 ArrangePolygon ap = get_arrange_poly(inst);
139 // Existing objects need to be included in the result. Only
140 // the needed amount of object will be added, no more.
141 ++ap.priority;
142 m_selected.emplace_back(ap);
143 }*/
144
145 if (m_selected.empty()) return;
146
147 bool enable_wrapping = global_config.option<ConfigOptionBool>("enable_wrapping_detection")->value;
148 //add the virtual object into unselect list if has
149 double scaled_exclusion_gap = scale_(1);
150 plate_list.preprocess_exclude_areas(params.excluded_regions, global_config, enable_wrapping, 1, scaled_exclusion_gap);
151 plate_list.preprocess_exclude_areas(m_unselected, global_config, enable_wrapping);
152
153 m_bedpts = get_bed_shape(*m_plater->config());
154
155 auto &objects = m_plater->model().objects;
156 /*BoundingBox bedbb = get_extents(m_bedpts);
157
158 for (size_t idx = 0; idx < objects.size(); ++idx)
159 if (int(idx) != m_object_idx)
160 for (ModelInstance *mi : objects[idx]->instances) {
161 ArrangePolygon ap = get_arrange_poly(mi);
162 auto ap_bb = ap.transformed_poly().contour.bounding_box();
163
164 if (ap.bed_idx == 0 && !bedbb.contains(ap_bb))
165 ap.bed_idx = arrangement::UNARRANGED;
166
167 m_unselected.emplace_back(ap);
168 }*/
169 if (auto wt = get_wipe_tower_arrangepoly(*m_plater))
170 m_unselected.emplace_back(std::move(*wt));
171
172 double sc = scaled<double>(1.) * scaled(1.);
173
174 auto polys = offset_ex(m_selected.front().poly, params.min_obj_distance / 2);
175 ExPolygon poly = polys.empty() ? m_selected.front().poly : polys.front();
176 double poly_area = poly.area() / sc;
177 const ArrangePolygon &fill_template = m_selected.front();
178 double unsel_area = std::accumulate(m_unselected.begin(),
179 m_unselected.end(), 0.,
180 [cur_plate_index, &fill_template](double s, const auto &ap) {
181 //BBS: m_unselected instance is in the same partplate
182 const bool exclusion_applies = !ap.is_bed_exclusion ||
183 bed_exclusion_applies(fill_template, ap);
184 return s + (ap.bed_idx == cur_plate_index && exclusion_applies) * ap.poly.area();
185 //return s + (ap.bed_idx == 0) * ap.poly.area();
186 }) / sc;
187
188 double fixed_area = unsel_area + m_selected.size() * poly_area;
189 double bed_area = Polygon{m_bedpts}.area() / sc;
190
191 // This is the maximum number of items, the real number will always be close but less.
192 int needed_items = (bed_area - fixed_area) / poly_area;
193
194 //int sel_id = m_plater->get_selection().get_instance_idx();
195 // if the selection is not a single instance, choose the first as template
196 //sel_id = std::max(sel_id, 0);
197 ModelInstance *mi = model_object->instances[sel_id];
198 ArrangePolygon template_ap = get_instance_arrange_poly(mi, global_config);
199 set_arrange_polygon_bed_exclusion_extruders(template_ap, *model_object, *plate, global_config);
200
201 for (int i = 0; i < needed_items; ++i) {
202 ArrangePolygon ap = template_ap;
203 ap.poly = m_selected.front().poly;
205 ap.itemid = -1;
206 ap.setter = [this, mi](const ArrangePolygon &p) {
207 ModelObject *mo = m_plater->model().objects[m_object_idx];
208 if (m_instances) {
209 ModelInstance *new_instance = mo->add_instance(*mi);
210 new_instance->apply_arrange_result(p.translation.cast<double>(), p.rotation);
211 } else {
212 ModelObject* newObj = m_plater->model().add_object(*mo);
213 newObj->name = mo->name +" "+ std::to_string(p.itemid);
214 for (ModelInstance *new_instance : newObj->instances)
215 new_instance->apply_arrange_result(p.translation.cast<double>(), p.rotation);
216 }
217 //m_plater->sidebar().obj_list()->paste_objects_into_list({m_plater->model().objects.size()-1});
218 };
219 m_selected.emplace_back(ap);
220 }
221
222 m_status_range = m_selected.size();
223
224 // The strides have to be removed from the fixed items. For the
225 // arrangeable (selected) items bed_idx is ignored and the
226 // translation is irrelevant.
227 //BBS: remove logic for unselected object
228 /*double stride = bed_stride(m_plater);
229 for (auto &p : m_unselected)
230 if (p.bed_idx > 0)
231 p.translation(X) -= p.bed_idx * stride;*/
232}
ConfigOption * option(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2768
Points m_bedpts
Definition FillBedJob.hpp:26
int m_status_range
Definition FillBedJob.hpp:30
ArrangePolygons m_locked
Definition FillBedJob.hpp:24
ArrangePolygons m_unselected
Definition FillBedJob.hpp:22
arrangement::ArrangeParams params
Definition FillBedJob.hpp:28
static constexpr unsigned int MAX_PLATES_COUNT
Definition PartPlate.hpp:893
static double area(const Points &pts)
Definition Polygon.cpp:65
#define scale_(val)
Definition libslic3r.h:106
void poly(std::vector< std::pair< Vec2d, Vec2d > > &out, std::initializer_list< Vec2d > p)
Definition DesignSketchTool.cpp:7751
std::optional< arrangement::ArrangePolygon > get_wipe_tower_arrangepoly(const Plater &plater)
Definition ArrangeJob.cpp:968
void set_arrange_polygon_bed_exclusion_extruders(ArrangePolygon &polygon, const ModelObject &object, const PartPlate &plate, const DynamicPrintConfig &config)
Definition ArrangeJob.cpp:53
arrangement::ArrangeParams init_arrange_params(Plater *p)
Definition ArrangeJob.cpp:989
double poly_area(const Points &pts)
Definition Arrange.cpp:1187
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:284
ArrangePolygon get_instance_arrange_poly(ModelInstance *instance, const Slic3r::DynamicPrintConfig &config)
Definition ModelArrange.cpp:135
Slic3r::ExPolygons offset_ex(const Slic3r::Polygons &polygons, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:605
Points get_bed_shape(const DynamicPrintConfig &config, bool use_share)
Definition PrintConfig.cpp:13837
Slic3r::Polygon Polygon
Definition Emboss.cpp:101

References Slic3r::ModelObject::add_instance(), Slic3r::ModelInstance::apply_arrange_result(), Slic3r::Polygon::area(), Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::GUI::bed_stride_x(), Slic3r::GUI::bed_stride_y(), Slic3r::MultiPoint::bounding_box(), Slic3r::arrangement::ArrangePolygon::col, Slic3r::BoundingBoxBase< PointType, APointsType >::contains(), Slic3r::ExPolygon::contour, Slic3r::get_bed_shape(), Slic3r::GUI::PartPlate::get_bounding_box_crd(), Slic3r::GUI::PartPlateList::get_curr_plate(), Slic3r::GUI::PartPlate::get_index(), Slic3r::get_instance_arrange_poly(), Slic3r::GUI::PartPlateList::get_plate_cols(), Slic3r::GUI::get_wipe_tower_arrangepoly(), Slic3r::GUI::init_arrange_params(), Slic3r::ModelObject::instances, Slic3r::arrangement::ArrangePolygon::itemid, m_bedpts, m_instances, m_locked, m_object_idx, m_plater, m_selected, m_status_range, m_unselected, Slic3r::GUI::PartPlateList::MAX_PLATES_COUNT, Slic3r::arrangement::ArrangePolygon::name, Slic3r::ModelObject::name, Slic3r::Model::objects, Slic3r::offset_ex(), Slic3r::ConfigBase::option(), params, Slic3r::arrangement::ArrangePolygon::poly, Slic3r::GUI::PartPlateList::preprocess_exclude_areas(), Slic3r::arrangement::ArrangePolygon::priority, Slic3r::arrangement::ArrangePolygon::row, scale_, Slic3r::scaled(), Slic3r::GUI::PartPlateList::select_plate_by_obj(), Slic3r::GUI::set_arrange_polygon_bed_exclusion_extruders(), Slic3r::arrangement::ArrangePolygon::setter, Slic3r::arrangement::ArrangePolygon::transformed_poly(), Slic3r::arrangement::ArrangePolygon::translation, Slic3r::X, and Slic3r::Y.

Referenced by process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process()

void Slic3r::GUI::FillBedJob::process ( Ctl & ctl)
overridevirtual

Implements Slic3r::GUI::Job.

235{
236 auto statustxt = _u8L("Filling");
237 ctl.call_on_main_thread([this] { prepare(); }).wait();
238 ctl.update_status(0, statustxt);
239
240 if (m_object_idx == -1 || m_selected.empty()) return;
241
243
244 auto &partplate_list = m_plater->get_partplate_list();
245 auto &print = wxGetApp().plater()->get_partplate_list().get_current_fff_print();
246 const Slic3r::DynamicPrintConfig& global_config = wxGetApp().preset_bundle->full_config();
247 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
248 const bool is_bbl = wxGetApp().preset_bundle->is_bbl_vendor();
249 if (is_bbl && params.avoid_extrusion_cali_region && global_config.opt_bool("scan_first_layer"))
250 partplate_list.preprocess_nonprefered_areas(m_unselected, MAX_NUM_PLATES);
251
254 // After the inflation, which may give back part of the bed margin.
256
257 bool do_stop = false;
258 params.stopcondition = [&ctl, &do_stop]() {
259 return ctl.was_canceled() || do_stop;
260 };
261
262 params.progressind = [this, &ctl](unsigned st,std::string str="") {
263 if (st > 0)
264 // TRN Progress status of Fill bed. %1% is the name of the object being copied.
265 ctl.update_status(st * 100 / status_range(), GUI::format(_u8L("Filling %1%"), str));
266 };
267
268 params.on_packed = [&do_stop] (const ArrangePolygon &ap) {
269 do_stop = ap.bed_idx > 0 && ap.priority == 0;
270 };
271 // final align用的是凸包,在有fixed item的情况下可能找到的参考点位置是错的,这里就不做了。见STUDIO-3265
272 params.do_final_align = !is_bbl;
273
274 if (m_selected.size() > 100) {
275 // too many items, just find grid empty cells to put them
276 std::vector<BoundingBoxf> occupied_boxes;
277 for (const ArrangePolygon &fixed : m_unselected) {
278 if (fixed.bed_idx != 0 || fixed.is_extrusion_cali_object)
279 continue;
280
281 if (fixed.is_bed_exclusion) {
282 const bool relevant = std::any_of(
283 m_selected.begin(), m_selected.end(), [&fixed](const ArrangePolygon &item) {
284 return bed_exclusion_applies(item, fixed);
285 });
286 if (!relevant)
287 continue;
288 }
289
290 BoundingBox bbox = get_extents(fixed.transformed_poly());
291 bbox.offset(std::max<coord_t>(0, fixed.inflation));
292 occupied_boxes.emplace_back(unscale(bbox.min), unscale(bbox.max));
293 }
294
295 // Fill the remaining space without disturbing instances which are
296 // already placed. Besides matching the meaning of "Fill bed", this
297 // also prevents candidates rejected by the grid from remaining under
298 // newly placed copies at their old positions.
299 const Vec3d plate_origin = partplate_list.get_curr_plate()->get_origin();
300 for (const ArrangePolygon &existing : m_selected) {
301 if (existing.priority == 0 || existing.bed_idx != 0)
302 continue;
303
304 BoundingBox bbox = get_extents(existing.transformed_poly());
305 bbox.offset(std::max<coord_t>(0, existing.inflation));
306 BoundingBoxf local_box(unscale(bbox.min), unscale(bbox.max));
307 local_box.translate(Vec2d(-plate_origin.x(), -plate_origin.y()));
308 occupied_boxes.emplace_back(std::move(local_box));
309 }
310
311 const Vec2f step = unscaled<float>(get_extents(m_selected.front().poly).size()) +
312 Vec2f(m_selected.front().brim_width, m_selected.front().brim_width);
313 const bool has_conditional_exclusions = has_bed_exclusion_regions(m_unselected);
314 const std::vector<Vec2f> empty_cells =
315 Plater::get_empty_cells(step, occupied_boxes, !has_conditional_exclusions);
316
317 size_t cell_index = 0;
318 for (ArrangePolygon &item : m_selected) {
319 if (item.priority != 0)
320 continue;
321
322 if (cell_index < empty_cells.size()) {
323 item.translation = scaled<coord_t>(empty_cells[cell_index++]);
324 item.bed_idx = 0;
325 } else {
326 item.bed_idx = arrangement::UNARRANGED;
327 }
328 }
329
330 } else {
332 }
333
334 // finalize just here.
335 ctl.update_status(100, ctl.was_canceled() ?
336 _u8L("Bed filling canceled.") :
337 _u8L("Bed filling done."));
338}
PointType size() const
Definition BoundingBox.cpp:178
bool opt_bool(const t_config_option_key &opt_key) const
Definition Config.hpp:3072
int status_range() const
Definition FillBedJob.hpp:42
void prepare()
Definition FillBedJob.cpp:41
static std::vector< Vec2f > get_empty_cells(const Vec2f step, const std::vector< BoundingBoxf > &local_exclude_boxes={}, bool include_plate_exclude_areas=true)
Definition Plater.cpp:22462
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:36
void update_arrange_params(ArrangeParams &params, const DynamicPrintConfig *print_cfg, const ArrangePolygons &selected)
Definition Arrange.cpp:148
void update_selected_items_inflation(ArrangePolygons &selected, const DynamicPrintConfig *print_cfg, ArrangeParams &params)
Definition Arrange.cpp:163
Points get_shrink_bedpts(const DynamicPrintConfig *print_cfg, const ArrangeParams &params)
Definition Arrange.cpp:339
void arrange(ArrangePolygons &items, const ArrangePolygons &excludes, const Points &bed, const ArrangeParams &params)
Definition Arrange.cpp:1280
void update_unselected_items_inflation(ArrangePolygons &unselected, const DynamicPrintConfig *print_cfg, const ArrangeParams &params)
Definition Arrange.cpp:213
bool has_bed_exclusion_regions(const ArrangePolygons &polygons)
Definition Arrange.cpp:136
static const constexpr int UNARRANGED
A logical bed representing an object not being arranged. Either the arrange has not yet successfully ...
Definition Arrange.hpp:47
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
BoundingBox get_extents(const ExPolygonsWithIds &e)
Definition Emboss.cpp:1374
constexpr Eigen::Matrix< Tout, 2, EigenArgs... > unscaled(const Slic3r::Point &v) noexcept
Definition Arrange.cpp:81
Eigen::Matrix< float, 2, 1, Eigen::DontAlign > Vec2f
Definition Point.hpp:64
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67
void step(Coord &crd, const Dir d, const long n=1)
Definition MarchingSquares.hpp:213
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::arrangement::arrange(), Slic3r::GUI::Job::Ctl::call_on_main_thread(), Slic3r::GUI::format(), Slic3r::GUI::Plater::get_empty_cells(), Slic3r::get_extents(), Slic3r::PresetBundle::is_bbl_vendor(), m_bedpts, m_object_idx, m_plater, m_selected, m_unselected, Slic3r::BoundingBoxBase< PointType, APointsType >::max, Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::BoundingBoxBase< PointType, APointsType >::offset(), Slic3r::DynamicConfig::opt_bool(), params, prepare(), Slic3r::scaled(), Slic3r::BoundingBoxBase< PointType, APointsType >::size(), status_range(), Slic3r::BoundingBoxBase< PointType, APointsType >::translate(), Slic3r::arrangement::UNARRANGED, Slic3r::unscale(), Slic3r::unscaled(), Slic3r::GUI::Job::Ctl::update_status(), and Slic3r::GUI::Job::Ctl::was_canceled().

Here is the call graph for this function:

◆ status_range()

int Slic3r::GUI::FillBedJob::status_range ( ) const
inline
43 {
44 return m_status_range;
45 }

References m_status_range.

Referenced by process().

Here is the caller graph for this function:

Member Data Documentation

◆ m_bedpts

Points Slic3r::GUI::FillBedJob::m_bedpts
private

Referenced by prepare(), and process().

◆ m_instances

bool Slic3r::GUI::FillBedJob::m_instances
private

Referenced by FillBedJob(), finalize(), and prepare().

◆ m_locked

ArrangePolygons Slic3r::GUI::FillBedJob::m_locked
private

Referenced by prepare().

◆ m_object_idx

int Slic3r::GUI::FillBedJob::m_object_idx = -1
private

Referenced by finalize(), prepare(), and process().

◆ m_plater

Plater* Slic3r::GUI::FillBedJob::m_plater
private

Referenced by FillBedJob(), finalize(), prepare(), and process().

◆ m_selected

ArrangePolygons Slic3r::GUI::FillBedJob::m_selected
private

Referenced by finalize(), prepare(), and process().

◆ m_status_range

int Slic3r::GUI::FillBedJob::m_status_range = 0
private

Referenced by prepare(), and status_range().

◆ m_unselected

ArrangePolygons Slic3r::GUI::FillBedJob::m_unselected
private

Referenced by prepare(), and process().

◆ params

arrangement::ArrangeParams Slic3r::GUI::FillBedJob::params
private

Referenced by prepare(), and process().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/FillBedJob.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/FillBedJob.cpp