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

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

Inheritance diagram for Slic3r::GUI::PartPlateList:
Collaboration diagram for Slic3r::GUI::PartPlateList:

Classes

class  BedTextureInfo
struct  Rect

Public Types

using Timestamp = uint64_t

Public Member Functions

void set_default_wipe_tower_pos_for_plate (int plate_idx, bool init_pos=false)
 PartPlateList (int width, int depth, double height, Plater *platerObj, Model *modelObj, PrinterTechnology tech=ptFFF)
 PartPlateList (Plater *platerObj, Model *modelObj, PrinterTechnology tech=ptFFF)
 ~PartPlateList ()
void reset_size (int width, int depth, double height, bool reload_objects=true, bool update_shapes=false)
void clear (bool delete_plates=false, bool release_print_list=false, bool except_locked=false, int plate_index=-1)
void reset (bool do_init)
Vec3d compute_origin_using_new_size (int i, int new_width, int new_depth)
void reinit ()
double plate_stride_x ()
double plate_stride_y ()
void get_plate_size (int &width, int &depth, double &height)
void update_plates ()
void invalidate_exclusion_volume_previews ()
void render_exclusion_volume_intersections (const Transform3d &view_matrix, const Transform3d &projection_matrix)
int create_plate (bool adjust_position=true)
int duplicate_plate (int index)
int destroy_print (int print_index)
int delete_plate (int index)
void delete_selected_plate ()
bool check_all_plate_local_bed_type (const std::vector< BedType > &cur_bed_types)
PartPlate * get_plate (int index)
void get_height_limits (float &height_to_lid, float &height_to_rod)
void set_height_limits_mode (PartPlate::HeightLimitMode mode)
int get_curr_plate_index () const
PartPlate * get_curr_plate ()
const PartPlate * get_curr_plate () const
std::vector< PartPlate * > & get_plate_list ()
PartPlate * get_selected_plate ()
std::vector< PartPlate * > get_nonempty_plate_list ()
std::vector< const GCodeProcessorResult * > get_nonempty_plates_slice_results ()
Vec3d get_current_plate_origin ()
Vec2d get_current_shape_position ()
Pointfs get_exclude_area ()
Pointfs get_wrapping_exclude_area () const
std::set< int > get_extruders (bool conside_custom_gcode=false) const
int select_plate (int index)
int get_plate_count () const
void invalidate_all_imex_ghosts ()
void update_plate_cols ()
void update_all_plates_pos_and_size (bool adjust_position=true, bool with_unprintable_move=true, bool switch_plate_type=false, bool do_clear=true)
int get_plate_cols ()
int move_plate_to_index (int old_index, int new_index)
int lock_plate (int index, bool state)
bool is_locked (int index)
int find_plate_by_print_index (int index)
int find_instance (int obj_id, int instance_id)
int find_instance (BoundingBoxf3 &bounding_box)
int find_instance_belongs (int obj_id, int instance_id)
int notify_instance_update (int obj_id, int instance_id, bool is_new=false)
int notify_instance_removed (int obj_id, int instance_id)
int add_to_plate (int obj_id, int instance_id, int plate_id)
int reload_all_objects (bool except_locked=false, int plate_index=-1)
int construct_objects_list_for_new_plate (int plate_index)
int compute_plate_index (arrangement::ArrangePolygon &arrange_polygon)
bool preprocess_arrange_polygon (int obj_index, int instance_index, arrangement::ArrangePolygon &arrange_polygon, bool selected)
bool preprocess_arrange_polygon_other_locked (int obj_index, int instance_index, arrangement::ArrangePolygon &arrange_polygon, bool selected)
bool preprocess_exclude_areas (arrangement::ArrangePolygons &unselected, const DynamicPrintConfig &config, bool enable_wrapping_detect, int num_plates=16, float inflation=0)
bool preprocess_nonprefered_areas (arrangement::ArrangePolygons &regions, int num_plates=1, float inflation=0)
void postprocess_bed_index_for_selected (arrangement::ArrangePolygon &arrange_polygon)
void postprocess_bed_index_for_unselected (arrangement::ArrangePolygon &arrange_polygon)
void postprocess_bed_index_for_current_plate (arrangement::ArrangePolygon &arrange_polygon)
void postprocess_arrange_polygon (arrangement::ArrangePolygon &arrange_polygon, bool selected)
void on_change_color_mode (bool is_dark)
void render (const Transform3d &view_matrix, const Transform3d &projection_matrix, bool bottom, bool only_current=false, bool only_body=false, int hover_id=-1, bool render_cali=false, bool show_grid=true, bool hide_chrome=false, bool hide_inactive=false)
void set_render_option (bool bedtype_texture, bool plate_settings)
void set_render_cali (bool value=true)
void render_hover_tooltip () const
void clear_hover_tooltip ()
void register_raycasters_for_picking (GLCanvas3D &canvas)
BoundingBoxf3 & get_bounding_box ()
int select_plate_by_obj (int obj_index, int instance_index)
void calc_bounding_boxes ()
void select_plate_view ()
bool set_shapes (const Pointfs &shape, const Pointfs &exclude_areas, const Pointfs &wrapping_exclude_areas, const std::vector< Pointfs > &extruder_areas, const std::vector< double > &extruder_heights, const std::string &custom_texture, float height_to_lid, float height_to_rod)
void set_hover_id (int id)
void reset_hover_id ()
bool intersects (const BoundingBoxf3 &bb)
bool contains (const BoundingBoxf3 &bb)
const std::string & get_logo_texture_filename ()
void update_logo_texture_filename (const std::string &texture_filename)
void update_slice_context_to_current_plate (BackgroundSlicingProcess &process)
Print & get_current_fff_print () const
GCodeProcessorResult * get_current_slice_result () const
int create_plate_from_gcode_file (const std::string &filename)
void invalid_all_slice_result ()
void update_current_slice_result_state (bool valid)
bool is_all_slice_results_valid () const
bool is_all_slice_results_ready_for_print () const
bool is_all_plates_ready_for_slice () const
bool is_all_slice_result_ready_for_export () const
void print () const
void get_sliced_result (std::vector< bool > &sliced_result, std::vector< std::string > &gcode_paths)
int rebuild_plates_after_deserialize (std::vector< bool > &previous_sliced_result, std::vector< std::string > &previous_gcode_paths)
int rebuild_plates_after_arrangement (bool recycle_plates=true, bool except_locked=false, int plate_index=-1)
int store_to_3mf_structure (PlateDataPtrs &plate_data_list, bool with_slice_info=true, int plate_idx=-1, bool with_statistics=false)
int load_from_3mf_structure (PlateDataPtrs &plate_data_list, int filament_count=1)
int load_gcode_files ()
template<class Archive>
void serialize (Archive &ar)
bool calc_extruder_only_area (Rect &left_only_rect, Rect &right_only_rect)
void init_bed_type_info ()
bool init_extruder_only_area_info ()
void load_bedtype_textures ()
bool load_next_bedtype_texture ()
void load_extruder_only_area_textures ()
bool load_next_extruder_only_area_texture ()
bool load_logo_texture ()
void show_cali_texture (bool show=true)
void init_cali_texture_info ()
void load_cali_textures ()
bool load_next_cali_texture ()
bool icon_textures_loaded () const
void load_icon_textures ()
bool load_next_plate_texture ()
void on_extruder_count_changed (int extruder_count)
void refresh_imex_icons ()
void set_filament_count (int filament_count)
void on_filament_deleted (int filament_count, int filament_id)
void on_filament_added (int filament_count)
ObjectID id () const
virtual Timestamp timestamp () const

Public Attributes

std::map< int, bool > m_allow_bed_type_in_double_nozzle
BedTextureInfo bed_texture_info [btCount]
BedTextureInfo cali_texture_info
BedTextureInfo extruder_only_area_info [(unsigned char) Slic3r::ExtruderOnlyAreaType::btAreaCount]

Static Public Attributes

static constexpr unsigned int MAX_PLATES_COUNT = MAX_PLATE_COUNT
static GLTexture bed_textures [(unsigned int) btCount]
static bool is_load_bedtype_textures = false
static bool is_load_cali_texture = false
static bool is_load_extruder_only_area_textures = false

Protected Member Functions

void set_new_unique_id ()
void set_invalid_id ()
void copy_id (const ObjectBase &rhs)
virtual void assign_new_unique_ids_recursive ()

Private Member Functions

void init ()
Vec3d compute_origin (int index, int column_count)
Vec3d compute_origin_for_unprintable ()
Vec2d compute_shape_position (int index, int cols)
void generate_icon_textures ()
void release_icon_textures ()

Static Private Member Functions

static ObjectID generate_new_id ()
template<class Archive>
static void load_and_construct (Archive &ar, cereal::construct< ObjectBase > &construct)

Private Attributes

Plater * m_plater
Model * m_model
PrinterTechnology printer_technology
std::vector< PartPlate * > m_plate_list
std::map< int, PrintBase * > m_print_list
std::map< int, GCodeResult * > m_gcode_result_list
std::mutex m_plates_mutex
int m_plate_count
int m_plate_cols
int m_current_plate
int m_print_index
int m_plate_width
int m_plate_depth
double m_plate_height
float m_height_to_lid
float m_height_to_rod
PartPlate::HeightLimitMode m_height_limit_mode {PartPlate::HEIGHT_LIMIT_BOTH}
PartPlate unprintable_plate
Pointfs m_shape
Pointfs m_exclude_areas
Pointfs m_wrapping_exclude_areas
std::vector< Pointfs > m_extruder_areas
std::vector< double > m_extruder_heights
BoundingBoxf3 m_bounding_box
bool m_intialized
std::string m_logo_texture_filename
GLTexture m_logo_texture
GLTexture m_del_texture
GLTexture m_del_hovered_texture
GLTexture m_move_front_hovered_texture
GLTexture m_move_front_texture
GLTexture m_arrange_texture
GLTexture m_arrange_hovered_texture
GLTexture m_orient_texture
GLTexture m_orient_hovered_texture
GLTexture m_locked_texture
GLTexture m_locked_hovered_texture
GLTexture m_lockopen_texture
GLTexture m_lockopen_hovered_texture
GLTexture m_plate_settings_texture
GLTexture m_plate_settings_changed_texture
GLTexture m_plate_settings_hovered_texture
GLTexture m_plate_settings_changed_hovered_texture
GLTexture m_plate_set_filament_map_texture
GLTexture m_plate_set_filament_map_hovered_texture
GLTexture m_plate_name_edit_texture
GLTexture m_plate_name_edit_hovered_texture
std::array< GLTexture, 4 > m_imex_mode_textures
std::array< GLTexture, 4 > m_imex_mode_hovered_textures
GLTexture m_imex_warn_texture
GLTexture m_idx_textures [MAX_PLATE_COUNT]
bool render_bedtype_logo = true
bool render_plate_settings = true
bool render_cali_logo = true
std::string m_hover_tooltip
bool m_is_dark = false
bool m_icon_textures_dark = false
int m_filament_count = 1
size_t m_next_bedtype_texture { 0 }
size_t m_next_cali_texture { 0 }
size_t m_next_extruder_only_area_texture { 0 }
ObjectID m_id

Static Private Attributes

static size_t s_last_id = 0

Friends

class cereal::access
class UndoRedo::StackImpl
class PartPlate

Detailed Description


Class Documentation

◆ Slic3r::GUI::PartPlateList::Rect

struct Slic3r::GUI::PartPlateList::Rect
Class Members
int h
int w
int x
int y

Member Typedef Documentation

◆ Timestamp

using Slic3r::ObjectBase::Timestamp = uint64_t
inherited

Constructor & Destructor Documentation

◆ PartPlateList() [1/2]

Slic3r::GUI::PartPlateList::PartPlateList ( int width,
int depth,
double height,
Plater * platerObj,
Model * modelObj,
PrinterTechnology tech = ptFFF )
5943 :m_plate_width(width), m_plate_depth(depth), m_plate_height(height), m_plater(platerObj), m_model(modelObj), printer_technology(tech),
5944 unprintable_plate(this, Vec3d(0.0 + width * (1. + LOGICAL_PART_PLATE_GAP), 0.0, 0.0), width, depth, height, platerObj, modelObj, false, tech)
5945{
5946 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":plate_width %1%, plate_depth %2%, plate_height %3%") % width % depth % height;
5947
5948 init();
5949}
static const double LOGICAL_PART_PLATE_GAP
Definition PartPlate.cpp:131
int m_plate_width
Definition PartPlate.hpp:783
Model * m_model
Definition PartPlate.hpp:771
Plater * m_plater
Definition PartPlate.hpp:770
int m_plate_depth
Definition PartPlate.hpp:784
void init()
Definition PartPlate.cpp:5963
PrinterTechnology printer_technology
Definition PartPlate.hpp:772
double m_plate_height
Definition PartPlate.hpp:785
PartPlate unprintable_plate
Definition PartPlate.hpp:791
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68

References init(), LOGICAL_PART_PLATE_GAP, m_model, m_plate_depth, m_plate_height, m_plate_width, m_plater, printer_technology, and unprintable_plate.

Here is the call graph for this function:

◆ PartPlateList() [2/2]

Slic3r::GUI::PartPlateList::PartPlateList ( Plater * platerObj,
Model * modelObj,
PrinterTechnology tech = ptFFF )
5951 :m_plate_width(0), m_plate_depth(0), m_plate_height(0), m_plater(platerObj), m_model(modelObj), printer_technology(tech),
5952 unprintable_plate(this, Vec3d(0.0, 0.0, 0.0), m_plate_width, m_plate_depth, m_plate_height, platerObj, modelObj, false, tech)
5953{
5954 init();
5955}

References init(), m_model, m_plate_depth, m_plate_height, m_plate_width, m_plater, printer_technology, and unprintable_plate.

Here is the call graph for this function:

◆ ~PartPlateList()

Slic3r::GUI::PartPlateList::~PartPlateList ( )
5958{
5959 clear(true, true);
5961}
void clear(bool delete_plates=false, bool release_print_list=false, bool except_locked=false, int plate_index=-1)
Definition PartPlate.cpp:6430
void release_icon_textures()
Definition PartPlate.cpp:6257

References clear(), and release_icon_textures().

Here is the call graph for this function:

Member Function Documentation

◆ add_to_plate()

int Slic3r::GUI::PartPlateList::add_to_plate ( int obj_id,
int instance_id,
int plate_id )
7423{
7424 int ret = 0, index;
7425 PartPlate* plate = NULL;
7426
7427 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": plate_id %1%, found obj_id %2%, instance_id %3%") % plate_id % obj_id % instance_id;
7428 index = find_instance(obj_id, instance_id);
7429 if (index != -1)
7430 {
7431 //found it added before
7432 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in previous plate %1%") % index;
7433 if (index != plate_id)
7434 {
7435 //remove it from original plate first
7436 plate = m_plate_list[index];
7437 plate->remove_instance(obj_id, instance_id);
7438 }
7439 else
7440 {
7441 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": already in this plate, no need to be added");
7442 return 0;
7443 }
7444 }
7445 else
7446 {
7447 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": not added to plate before, add it to center");
7448 }
7449 plate = get_plate(plate_id);
7450 if (!plate)
7451 {
7452 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":can not get plate for index %1%, size %2%") % index % m_plate_list.size();
7453 return -1;
7454 }
7455 ret = plate->add_instance(obj_id, instance_id, true);
7456
7457 return ret;
7458}
std::vector< PartPlate * > m_plate_list
Definition PartPlate.hpp:774
PartPlate * get_plate(int index)
Definition PartPlate.cpp:6874
friend class PartPlate
Definition PartPlate.hpp:850
int find_instance(int obj_id, int instance_id)
Definition PartPlate.cpp:7176

References Slic3r::GUI::PartPlate::add_instance(), find_instance(), get_plate(), m_plate_list, PartPlate, and Slic3r::GUI::PartPlate::remove_instance().

Referenced by Slic3r::GUI::Plater::_calib_pa_pattern().

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

◆ assign_new_unique_ids_recursive()

virtual void Slic3r::ObjectBase::assign_new_unique_ids_recursive ( )
inlineprotectedvirtualinherited

Reimplemented in Slic3r::Model, Slic3r::ModelObject, and Slic3r::ModelVolume.

95{ this->set_new_unique_id(); }
void set_new_unique_id()
Definition ObjectID.hpp:89

References set_new_unique_id().

Here is the call graph for this function:

◆ calc_bounding_boxes()

void Slic3r::GUI::PartPlateList::calc_bounding_boxes ( )
8021{
8022 m_bounding_box.reset();
8023 std::vector<PartPlate*>::iterator it = m_plate_list.begin();
8024 for (it = m_plate_list.begin(); it != m_plate_list.end(); it++) {
8025 m_bounding_box.merge((*it)->get_bounding_box(true));
8026 }
8027}
BoundingBoxf3 m_bounding_box
Definition PartPlate.hpp:797

References m_bounding_box, and m_plate_list.

Referenced by create_plate(), delete_plate(), reinit(), and set_shapes().

Here is the caller graph for this function:

◆ calc_extruder_only_area()

bool Slic3r::GUI::PartPlateList::calc_extruder_only_area ( Rect & left_only_rect,
Rect & right_only_rect )
8928{
8929 auto convert_to_rect = [](const Pointfs &pts, Rect &rect) {
8930 rect.x = pts[0].x();
8931 rect.y = pts[0].y();
8932 rect.w = pts[1].x() - pts[0].x();
8933 rect.h = pts[2].y() - pts[1].y();
8934 };
8935 auto is_single_extruder = wxGetApp().preset_bundle->get_printer_extruder_count() ==1;
8936 if (is_single_extruder) {
8937 return false;
8938 }
8939 if (m_extruder_areas.size() == 2) {
8940 Rect printable_rect, left_extruder_printable_area, right_extruder_printable_area;
8941 convert_to_rect(m_shape, printable_rect);
8942 convert_to_rect(m_extruder_areas[0], left_extruder_printable_area);
8943 convert_to_rect(m_extruder_areas[1], right_extruder_printable_area);
8944 left_only_rect.x = left_extruder_printable_area.x;
8945 left_only_rect.y = left_extruder_printable_area.y;
8946 left_only_rect.w = printable_rect.w - right_extruder_printable_area.w;
8947 left_only_rect.h = left_extruder_printable_area.h;
8948
8949 right_only_rect.x = left_extruder_printable_area.x + left_extruder_printable_area.w;
8950 right_only_rect.y = right_extruder_printable_area.y;
8951 right_only_rect.w = printable_rect.w - left_extruder_printable_area.w;
8952 right_only_rect.h = right_extruder_printable_area.h;
8953 if (left_only_rect.w < 0 || right_only_rect.w < 0) {
8954 return false;
8955 }
8956 return true;
8957 }
8958 return false;
8959}
std::vector< Pointfs > m_extruder_areas
Definition PartPlate.hpp:795
Pointfs m_shape
Definition PartPlate.hpp:792
Definition PartPlate.hpp:1132
std::vector< Vec2d > Pointfs
Definition Point.hpp:77

References Slic3r::GUI::PartPlateList::Rect::h, m_extruder_areas, m_shape, Slic3r::GUI::PartPlateList::Rect::w, Slic3r::GUI::PartPlateList::Rect::x, and Slic3r::GUI::PartPlateList::Rect::y.

Referenced by init_extruder_only_area_info().

Here is the caller graph for this function:

◆ check_all_plate_local_bed_type()

bool Slic3r::GUI::PartPlateList::check_all_plate_local_bed_type ( const std::vector< BedType > & cur_bed_types)
6848{
6849 std::string bed_type_key = "curr_bed_type";
6850 bool is_ok = true;
6851 for (int i = 0; i < m_plate_list.size(); i++) {
6852 PartPlate *plate = m_plate_list[i];
6853 if (plate->config() && plate->config()->has(bed_type_key)) {
6854 BedType bed_type = plate->config()->opt_enum<BedType>(bed_type_key);
6855 if (bed_type == BedType::btDefault)
6856 continue;
6857 bool find = false;
6858 for (auto tmp_type : cur_bed_types) {
6859 if (bed_type == tmp_type) {
6860 find = true;
6861 break;
6862 }
6863 }
6864 if (!find) {
6865 plate->set_bed_type(BedType::btDefault);
6866 is_ok = false;
6867 }
6868 }
6869 }
6870 return is_ok;
6871}
BedType
Definition PrintConfig.hpp:507
@ btDefault
Definition PrintConfig.hpp:508
RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key)
Definition RaycastManager.cpp:298

References Slic3r::btDefault, Slic3r::GUI::PartPlate::config(), Slic3r::ConfigOptionResolver::has(), m_plate_list, Slic3r::DynamicConfig::opt_enum(), PartPlate, and Slic3r::GUI::PartPlate::set_bed_type().

Here is the call graph for this function:

◆ clear()

void Slic3r::GUI::PartPlateList::clear ( bool delete_plates = false,
bool release_print_list = false,
bool except_locked = false,
int plate_index = -1 )
6431{
6432 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
6433 {
6434 PartPlate* plate = m_plate_list[i];
6435 assert(plate != NULL);
6436
6437 if (except_locked && plate->is_locked())
6438 plate->clear(false);
6439 else if ((plate_index != -1) && (plate_index != i))
6440 plate->clear(false);
6441 else
6442 plate->clear();
6443 if (delete_plates)
6444 delete plate;
6445 }
6446
6447 if (delete_plates)
6448 {
6449 //also delete print related to the plate
6450 m_plate_list.clear();
6451 m_current_plate = 0;
6452 }
6453
6454 if (release_print_list)
6455 {
6456 for (std::map<int, PrintBase*>::iterator it = m_print_list.begin(); it != m_print_list.end(); ++it)
6457 {
6458 PrintBase* print = it->second;
6459 assert(print != NULL);
6460
6461 delete print;
6462 }
6463 m_print_list.clear();
6464 for (std::map<int, GCodeResult*>::iterator it = m_gcode_result_list.begin(); it != m_gcode_result_list.end(); ++it)
6465 {
6466 GCodeResult* gcode = it->second;
6467 assert(gcode != NULL);
6468
6469 delete gcode;
6470 }
6471 m_gcode_result_list.clear();
6472 }
6473
6474 unprintable_plate.clear();
6475}
std::map< int, PrintBase * > m_print_list
Definition PartPlate.hpp:775
void print() const
Definition PartPlate.cpp:8695
std::map< int, GCodeResult * > m_gcode_result_list
Definition PartPlate.hpp:776
int m_current_plate
Definition PartPlate.hpp:780
static std::string gcode(Type type)
Definition IMSlider.cpp:111
GCodeProcessorResult GCodeResult
Definition PartPlate.hpp:98

References Slic3r::GUI::PartPlate::clear(), Slic3r::GUI::gcode(), Slic3r::GUI::PartPlate::is_locked(), m_current_plate, m_gcode_result_list, m_plate_list, m_print_list, PartPlate, print(), and unprintable_plate.

Referenced by ~PartPlateList(), Slic3r::GUI::ArrangeJob::finalize(), load_from_3mf_structure(), reinit(), reload_all_objects(), reset(), reset_size(), and Slic3r::CLI::run().

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

◆ clear_hover_tooltip()

void Slic3r::GUI::PartPlateList::clear_hover_tooltip ( )
inline
1061{ m_hover_tooltip.clear(); }
std::string m_hover_tooltip
Definition PartPlate.hpp:830

References m_hover_tooltip.

◆ compute_origin()

Vec3d Slic3r::GUI::PartPlateList::compute_origin ( int index,
int column_count )
private
5995{
5996 Vec3d origin;
5997 Vec2d pos = compute_shape_position(i, cols);
5998 origin = Vec3d(pos.x(), pos.y(), 0);
5999
6000 return origin;
6001}
Vec2d compute_shape_position(int index, int cols)
Definition PartPlate.cpp:6031
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67

References compute_shape_position().

Referenced by compute_origin_for_unprintable(), create_plate(), delete_plate(), get_current_plate_origin(), move_plate_to_index(), and update_all_plates_pos_and_size().

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

◆ compute_origin_for_unprintable()

Vec3d Slic3r::GUI::PartPlateList::compute_origin_for_unprintable ( )
private
6022{
6023 int max_count = m_plate_cols * m_plate_cols;
6024 if (m_plate_count == max_count)
6025 return compute_origin(max_count + m_plate_cols - 1, m_plate_cols + 1);
6026 else
6028}
Vec3d compute_origin(int index, int column_count)
Definition PartPlate.cpp:5994
int m_plate_count
Definition PartPlate.hpp:778
int m_plate_cols
Definition PartPlate.hpp:779

References compute_origin(), m_plate_cols, and m_plate_count.

Referenced by create_plate(), delete_plate(), reinit(), and update_all_plates_pos_and_size().

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

◆ compute_origin_using_new_size()

Vec3d Slic3r::GUI::PartPlateList::compute_origin_using_new_size ( int i,
int new_width,
int new_depth )
6005{
6006 Vec3d origin;
6007 int row, col;
6008
6009 row = i / m_plate_cols;
6010 col = i % m_plate_cols;
6011
6012 origin(0) = col * (new_width * (1. + LOGICAL_PART_PLATE_GAP));
6013 origin(1) = -row * (new_depth * (1. + LOGICAL_PART_PLATE_GAP));
6014 origin(2) = 0;
6015
6016 return origin;
6017}

References LOGICAL_PART_PLATE_GAP, and m_plate_cols.

◆ compute_plate_index()

int Slic3r::GUI::PartPlateList::compute_plate_index ( arrangement::ArrangePolygon & arrange_polygon)
7567{
7568 int row, col;
7569
7570 float col_value = (unscale<double>(arrange_polygon.translation(X))) / plate_stride_x();
7571 float row_value = (plate_stride_y() - unscale<double>(arrange_polygon.translation(Y))) / plate_stride_y();
7572
7573 row = round(row_value);
7574 col = round(col_value);
7575
7576 return row * m_plate_cols + col;
7577}
double plate_stride_x()
Definition PartPlate.cpp:7025
double plate_stride_y()
Definition PartPlate.cpp:7033
T unscale(Q v)
Definition libslic3r.h:138
@ Y
Definition libslic3r.h:142
@ X
Definition libslic3r.h:141

References m_plate_cols, plate_stride_x(), plate_stride_y(), Slic3r::arrangement::ArrangePolygon::translation, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Here is the call graph for this function:

◆ compute_shape_position()

Vec2d Slic3r::GUI::PartPlateList::compute_shape_position ( int index,
int cols )
private
6032{
6033 Vec2d pos;
6034 int row, col;
6035
6036 row = index / cols;
6037 col = index % cols;
6038
6039 pos(0) = col * plate_stride_x();
6040 pos(1) = -row * plate_stride_y();
6041
6042 return pos;
6043}
size_t cols(const T &raster)
Definition MarchingSquares.hpp:173

References plate_stride_x(), and plate_stride_y().

Referenced by compute_origin(), create_plate(), delete_plate(), get_current_shape_position(), rebuild_plates_after_deserialize(), reinit(), select_plate(), and set_shapes().

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

◆ construct_objects_list_for_new_plate()

int Slic3r::GUI::PartPlateList::construct_objects_list_for_new_plate ( int plate_index)
7512{
7513 int ret = 0;
7514 unsigned int i, j, k;
7515 PartPlate* new_plate = m_plate_list[plate_index];
7516 bool already_included;
7517
7518 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": m_model->objects.size() is %1%") % m_model->objects.size();
7519 unprintable_plate.clear();
7520 //try to find a new plate
7521 for (i = 0; i < (unsigned int)m_model->objects.size(); ++i)
7522 {
7523 ModelObject* object = m_model->objects[i];
7524 for (j = 0; j < (unsigned int)object->instances.size(); ++j)
7525 {
7526 ModelInstance* instance = object->instances[j];
7527 already_included = false;
7528
7529 for (k = 0; k < (unsigned int)plate_index; ++k)
7530 {
7531 PartPlate* plate = m_plate_list[k];
7532 if (plate->contain_instance(i, j))
7533 {
7534 already_included = true;
7535 break;
7536 }
7537 }
7538
7539 if (already_included)
7540 continue;
7541
7542 BoundingBoxf3 boundingbox = object->instance_convex_hull_bounding_box(j);
7543 if (new_plate->intersect_instance(i, j, &boundingbox))
7544 {
7545 //found a new plate, add it to plate
7546 ret |= new_plate->add_instance(i, j, false, &boundingbox);
7547 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": added to plate_id %1%, for obj_id %2%, instance_id %3%") % plate_index % i % j;
7548
7549 continue;
7550 }
7551
7552 if ( (unprintable_plate.intersect_instance(i, j, &boundingbox)))
7553 {
7554 //found in unprintable plate, add it to plate
7555 unprintable_plate.add_instance(i, j, false, &boundingbox);
7556 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found in unprintable plate, obj_id %1%, instance_id %2%") % i % j;
7557 }
7558 }
7559 }
7560
7561 return ret;
7562}

References Slic3r::GUI::PartPlate::add_instance(), Slic3r::GUI::PartPlate::contain_instance(), Slic3r::GUI::PartPlate::intersect_instance(), m_model, m_plate_list, PartPlate, and unprintable_plate.

Referenced by create_plate().

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

◆ contains()

bool Slic3r::GUI::PartPlateList::contains ( const BoundingBoxf3 & bb)
7014{
7015 bool result = false;
7016 std::vector<PartPlate*>::iterator it = m_plate_list.begin();
7017 for (it = m_plate_list.begin(); it != m_plate_list.end(); it++) {
7018 if ((*it)->contains(bb)) {
7019 result = true;
7020 }
7021 }
7022 return result;
7023}

References m_plate_list.

◆ copy_id()

void Slic3r::ObjectBase::copy_id ( const ObjectBase & rhs)
inlineprotectedinherited
92{ m_id = rhs.id(); }
ObjectID m_id
Definition ObjectID.hpp:98

References ObjectBase(), id(), and m_id.

Referenced by Slic3r::CutObjectBase::copy().

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

◆ create_plate()

int Slic3r::GUI::PartPlateList::create_plate ( bool adjust_position = true)
6562{
6563 PartPlate* plate = NULL;
6564 Vec3d origin;
6565 int new_index;
6566
6567 new_index = m_plate_list.size();
6568 if (new_index >= MAX_PLATES_COUNT)
6569 return -1;
6570 int cols = compute_colum_count(new_index + 1);
6571 int old_cols = compute_colum_count(new_index);
6572 // Orca: Rebuild plate membership before moving instances during a grid reflow.
6573 if (adjust_position && old_cols != cols)
6575
6576 origin = compute_origin(new_index, cols);
6578 assert(plate != NULL);
6579
6581 {
6582 Print* print = new Print();
6583 GCodeResult* gcode = new GCodeResult();
6586 plate->set_print(print, gcode, m_print_index);
6587 m_print_index++;
6588 }
6589
6590 plate->set_filament_count(m_filament_count);
6591
6592 plate->set_index(new_index);
6593 Vec2d pos = compute_shape_position(new_index, cols);
6595 m_plate_list.emplace_back(plate);
6597 if (old_cols != cols)
6598 {
6599 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":old_cols %1% -> new_cols %2%") % old_cols % cols;
6600 //update the origin of each plate
6601 update_all_plates_pos_and_size(adjust_position, false);
6603
6604 if (m_plater) {
6606 m_plater->set_bed_position(pos);
6607 }
6608 }
6609 else
6610 {
6611 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": the same cols %1%") % old_cols;
6613 unprintable_plate.set_pos_and_size(origin2, m_plate_width, m_plate_depth, m_plate_height, false);
6614
6615 //update bounding_boxes
6617 }
6618
6619 // update wipe tower config
6620 if (m_plater) {
6621 // In GUI mode
6622 set_default_wipe_tower_pos_for_plate(new_index, true);
6623 }
6624
6625 unprintable_plate.set_index(new_index+1);
6626
6627 //reload all objects here
6628 if (adjust_position)
6630
6631 if (m_plater) {
6632 // In GUI mode
6633 wxGetApp().obj_list()->on_plate_added(plate);
6634 }
6635
6636 if (m_plater != nullptr && m_intialized && !m_plater->is_loading_project()) {
6637 LifecycleEventContext ctx;
6638 ctx.name = plate->get_plate_name();
6639 ctx.index = new_index;
6641 }
6642
6643 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":created a new plate %1%") % new_index;
6644 return new_index;
6645}
int compute_colum_count(int count)
Definition PartPlate.hpp:61
void update_all_plates_pos_and_size(bool adjust_position=true, bool with_unprintable_move=true, bool switch_plate_type=false, bool do_clear=true)
Definition PartPlate.cpp:7067
Pointfs m_exclude_areas
Definition PartPlate.hpp:793
void calc_bounding_boxes()
Definition PartPlate.cpp:8020
std::vector< double > m_extruder_heights
Definition PartPlate.hpp:796
Pointfs m_wrapping_exclude_areas
Definition PartPlate.hpp:794
std::string m_logo_texture_filename
Definition PartPlate.hpp:799
int m_filament_count
Definition PartPlate.hpp:835
float m_height_to_rod
Definition PartPlate.hpp:788
void set_default_wipe_tower_pos_for_plate(int plate_idx, bool init_pos=false)
Definition PartPlate.cpp:6315
bool m_intialized
Definition PartPlate.hpp:798
static constexpr unsigned int MAX_PLATES_COUNT
Definition PartPlate.hpp:893
int construct_objects_list_for_new_plate(int plate_index)
Definition PartPlate.cpp:7511
float m_height_to_lid
Definition PartPlate.hpp:787
int reload_all_objects(bool except_locked=false, int plate_index=-1)
Definition PartPlate.cpp:7461
Vec3d compute_origin_for_unprintable()
Definition PartPlate.cpp:6021
bool set_shapes(const Pointfs &shape, const Pointfs &exclude_areas, const Pointfs &wrapping_exclude_areas, const std::vector< Pointfs > &extruder_areas, const std::vector< double > &extruder_heights, const std::string &custom_texture, float height_to_lid, float height_to_rod)
Definition PartPlate.cpp:8039
int m_print_index
Definition PartPlate.hpp:781
void update_plate_cols()
Definition PartPlate.cpp:7058
@ ptFFF
Definition Config.hpp:231
@ PlateCreated
Definition LifecycleEvents.hpp:41
void fire_lifecycle_event(LifecycleEvent event, const LifecycleEventContext &ctx)
Definition LifecycleEvents.hpp:234

References calc_bounding_boxes(), compute_colum_count(), compute_origin(), compute_origin_for_unprintable(), compute_shape_position(), construct_objects_list_for_new_plate(), Slic3r::fire_lifecycle_event(), Slic3r::GUI::gcode(), Slic3r::GUI::PartPlate::get_plate_name(), Slic3r::LifecycleEventContext::index, m_current_plate, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_filament_count, m_gcode_result_list, m_height_to_lid, m_height_to_rod, m_intialized, m_logo_texture_filename, m_model, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, m_plater, m_print_index, m_print_list, m_shape, m_wrapping_exclude_areas, MAX_PLATES_COUNT, Slic3r::LifecycleEventContext::name, PartPlate, Slic3r::PlateCreated, print(), printer_technology, Slic3r::ptFFF, reload_all_objects(), set_default_wipe_tower_pos_for_plate(), Slic3r::GUI::PartPlate::set_filament_count(), Slic3r::GUI::PartPlate::set_index(), Slic3r::GUI::PartPlate::set_print(), Slic3r::GUI::PartPlate::set_shape(), set_shapes(), unprintable_plate, update_all_plates_pos_and_size(), and update_plate_cols().

Referenced by Slic3r::GUI::Plater::_calib_pa_pattern(), duplicate_plate(), load_from_3mf_structure(), and postprocess_bed_index_for_selected().

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

◆ create_plate_from_gcode_file()

int Slic3r::GUI::PartPlateList::create_plate_from_gcode_file ( const std::string & filename)
8219{
8220 int ret = 0;
8221
8222 return ret;
8223}

◆ delete_plate()

int Slic3r::GUI::PartPlateList::delete_plate ( int index)
6720{
6721 int ret = 0;
6722 PartPlate* plate = NULL;
6723
6724 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":delete plate %1%, count %2%") % index % m_plate_list.size();
6725 if (index >= m_plate_list.size())
6726 {
6727 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":can not find plate");
6728 return -1;
6729 }
6730 if (m_plate_list.size() <= 1)
6731 {
6732 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":only one plate left, can not delete");
6733 return -1;
6734 }
6735
6736 plate = m_plate_list[index];
6737 if (index != plate->get_index())
6738 {
6739 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":plate %1%, has an invalid index %2%") % index % plate->get_index();
6740 return -1;
6741 }
6742 const std::string plate_name = plate->get_plate_name();
6743
6744 if (m_plater) {
6745 // In GUI mode
6746 // BBS: add wipe tower logic
6747 DynamicConfig& proj_cfg = wxGetApp().preset_bundle->project_config;
6748 ConfigOptionFloats* wipe_tower_x = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_x");
6749 ConfigOptionFloats* wipe_tower_y = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_y");
6750 // wipe_tower_x and wip_tower_y may be less than plate count in the following case:
6751 // 1. wipe_tower is enabled after creating new plates
6752 // 2. wipe tower is not enabled
6753 if (index < wipe_tower_x->values.size())
6754 wipe_tower_x->values.erase(wipe_tower_x->values.begin() + index);
6755 if (index < wipe_tower_y->values.size())
6756 wipe_tower_y->values.erase(wipe_tower_y->values.begin() + index);
6757 }
6758
6759 int cols = compute_colum_count(m_plate_list.size() - 1);
6760 int old_cols = compute_colum_count(m_plate_list.size());
6761
6762 m_plate_list.erase(m_plate_list.begin() + index);
6764 //update this plate
6765 //move this plate's instance to the end
6766 Vec3d current_origin;
6767 current_origin = compute_origin_for_unprintable();
6768 plate->set_pos_and_size(current_origin, m_plate_width, m_plate_depth, m_plate_height, true);
6769
6770 //update the plates after it
6771 for (unsigned int i = index; i < (unsigned int)m_plate_list.size(); ++i)
6772 {
6773 PartPlate* plate = m_plate_list[i];
6774 assert(plate != NULL);
6775
6776 plate->set_index(i);
6777 Vec3d origin = compute_origin(i, m_plate_cols);
6778 plate->set_pos_and_size(origin, m_plate_width, m_plate_depth, m_plate_height, true);
6779
6780 //update render shapes
6783 }
6784
6785 //update current_plate if delete current
6786 if (m_current_plate == index && index == 0) {
6787 select_plate(0);
6788 }
6789 else if (m_current_plate >= index) {
6791 }
6792 else {
6793 //delete the plate behind current, just need to update the position of Bed3D
6795 if (m_plater)
6796 m_plater->set_bed_position(pos);
6797 }
6798
6799 unprintable_plate.set_index(m_plate_list.size());
6800
6801 if (old_cols != cols)
6802 {
6803 //update the origin of each plate
6806 }
6807 else
6808 {
6809 //update the position of the unprintable plate
6811 unprintable_plate.set_pos_and_size(origin2, m_plate_width, m_plate_depth, m_plate_height, true);
6812
6813 //update bounding_boxes
6815 }
6816
6817 plate->move_instances_to(*(m_plate_list[m_plate_list.size()-1]), unprintable_plate);
6818 //destroy the print object
6819 int print_index;
6820 plate->get_print(nullptr, nullptr, &print_index);
6821 destroy_print(print_index);
6822
6823 delete plate;
6824
6825 if (m_plater != nullptr && m_intialized && !m_plater->is_loading_project()) {
6826 LifecycleEventContext ctx;
6827 ctx.name = plate_name;
6828 ctx.index = index;
6830 }
6831
6832 // FIX: context of BackgroundSliceProcess and gcode preview need to be updated before ObjectList::reload_all_plates().
6833#if 0
6834 if (m_plater != nullptr) {
6835 // In GUI mode
6836 wxGetApp().obj_list()->reload_all_plates();
6837 }
6838#endif
6839 return ret;
6840}
std::vector< double > values
Definition Config.hpp:418
int select_plate(int index)
Definition PartPlate.cpp:6934
int destroy_print(int print_index)
Definition PartPlate.cpp:6681
@ PlateDeleted
Definition LifecycleEvents.hpp:42
zaa_minimize_perimeter_height wipe_tower_y((ConfigOptionFloat, prime_tower_width))((ConfigOptionFloat
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:1015

References calc_bounding_boxes(), compute_colum_count(), compute_origin(), compute_origin_for_unprintable(), compute_shape_position(), destroy_print(), Slic3r::fire_lifecycle_event(), Slic3r::GUI::PartPlate::get_index(), Slic3r::GUI::PartPlate::get_plate_name(), Slic3r::GUI::PartPlate::get_print(), Slic3r::LifecycleEventContext::index, m_current_plate, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_height_to_lid, m_height_to_rod, m_intialized, m_logo_texture_filename, m_plate_cols, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, m_plater, m_shape, m_wrapping_exclude_areas, Slic3r::GUI::PartPlate::move_instances_to(), Slic3r::LifecycleEventContext::name, Slic3r::DynamicConfig::opt(), PartPlate, Slic3r::PlateDeleted, select_plate(), Slic3r::GUI::PartPlate::set_index(), Slic3r::GUI::PartPlate::set_pos_and_size(), Slic3r::GUI::PartPlate::set_shape(), set_shapes(), unprintable_plate, update_all_plates_pos_and_size(), update_plate_cols(), Slic3r::ConfigOptionVector< double >::values, and Slic3r::wipe_tower_y().

Referenced by delete_selected_plate(), and rebuild_plates_after_arrangement().

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

◆ delete_selected_plate()

void Slic3r::GUI::PartPlateList::delete_selected_plate ( )
6843{
6845}
int delete_plate(int index)
Definition PartPlate.cpp:6719

References delete_plate(), and m_current_plate.

Here is the call graph for this function:

◆ destroy_print()

int Slic3r::GUI::PartPlateList::destroy_print ( int print_index)
6682{
6683 int result = 0;
6684
6685 if (print_index >= 0)
6686 {
6687 std::map<int, PrintBase*>::iterator it = m_print_list.find(print_index);
6688 if (it != m_print_list.end())
6689 {
6690 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":delete Print %1% for print_index %2%") % it->second % print_index;
6691 delete it->second;
6692 m_print_list.erase(it);
6693 }
6694 else
6695 {
6696 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":can not find Print for print_index %1%") % print_index;
6697 result = -1;
6698 }
6699 std::map<int, GCodeResult*>::iterator it2 = m_gcode_result_list.find(print_index);
6700 if (it2 != m_gcode_result_list.end())
6701 {
6702 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":delete GCodeResult %1% for print_index %2%") % it2->second % print_index;
6703 delete it2->second;
6704 m_gcode_result_list.erase(it2);
6705 }
6706 else
6707 {
6708 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":can not find GCodeResult for print_index %1%") % print_index;
6709 result = -1;
6710 }
6711 }
6712
6713 return result;
6714}

References m_gcode_result_list, and m_print_list.

Referenced by delete_plate(), and rebuild_plates_after_deserialize().

Here is the caller graph for this function:

◆ duplicate_plate()

int Slic3r::GUI::PartPlateList::duplicate_plate ( int index)
6649{
6650 // create a new plate
6651 int new_plate_index = create_plate(true);
6652 PartPlate* old_plate = NULL;
6653 PartPlate* new_plate = NULL;
6654 old_plate = get_plate(index);
6655 new_plate = get_plate(new_plate_index);
6656
6657 // get the offset between plate centers
6658 Vec3d plate_to_plate_offset = new_plate->m_origin - old_plate->m_origin;
6659
6660 // iterate over all the objects in this plate
6661 ModelObjectPtrs obj_ptrs = old_plate->get_objects_on_this_plate();
6662 for (ModelObject* object : obj_ptrs){
6663 // copy and move the object to the same relative position in the new plate
6664 ModelObject* object_copy = m_model->add_object(*object);
6665 int new_obj_id = new_plate->m_model->objects.size() - 1;
6666 // go over the instances and pair with the object
6667 for (size_t new_instance_id = 0; new_instance_id < object_copy->instances.size(); new_instance_id++){
6668 new_plate->obj_to_instance_set.emplace(std::pair(new_obj_id, new_instance_id));
6669 new_plate->invalidate_exclusion_volume_preview();
6670 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": duplicate object into plate: index_pair [%1%,%2%], obj_id %3%") % new_obj_id % new_instance_id % object_copy->id().id;
6671 }
6672 }
6673 new_plate->translate_all_instance(plate_to_plate_offset);
6674 // update the plates
6675 wxGetApp().obj_list()->reload_all_plates();
6676 return new_plate_index;
6677}
int create_plate(bool adjust_position=true)
Definition PartPlate.cpp:6561
std::vector< ModelObject * > ModelObjectPtrs
Definition CutUtils.hpp:13

References create_plate(), Slic3r::GUI::PartPlate::get_objects_on_this_plate(), get_plate(), Slic3r::ObjectBase::id(), Slic3r::ObjectID::id, Slic3r::ModelObject::instances, Slic3r::GUI::PartPlate::invalidate_exclusion_volume_preview(), Slic3r::GUI::PartPlate::m_model, m_model, Slic3r::GUI::PartPlate::m_origin, Slic3r::GUI::PartPlate::obj_to_instance_set, Slic3r::Model::objects, PartPlate, and Slic3r::GUI::PartPlate::translate_all_instance().

Here is the call graph for this function:

◆ find_instance() [1/2]

int Slic3r::GUI::PartPlateList::find_instance ( BoundingBoxf3 & bounding_box)
7198{
7199 int ret = -1;
7200
7201 //update the plates after it
7202 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7203 {
7204 PartPlate* plate = m_plate_list[i];
7205 assert(plate != NULL);
7206
7207 if (plate->intersects(bounding_box))
7208 return i;
7209 }
7210
7211 //return -1 for not found
7212 return ret;
7213}
BoundingBoxf3 bounding_box(const TriangleMesh &m)
Definition TriangleMesh.hpp:391

References Slic3r::bounding_box(), Slic3r::GUI::PartPlate::intersects(), m_plate_list, and PartPlate.

Here is the call graph for this function:

◆ find_instance() [2/2]

int Slic3r::GUI::PartPlateList::find_instance ( int obj_id,
int instance_id )
7177{
7178 int ret = -1;
7179
7180 //update the plates after it
7181 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7182 {
7183 PartPlate* plate = m_plate_list[i];
7184 assert(plate != NULL);
7185
7186 if (plate->contain_instance(obj_id, instance_id))
7187 return i;
7188 }
7189
7190 //return -1 for not found
7191 return ret;
7192}

References Slic3r::GUI::PartPlate::contain_instance(), m_plate_list, and PartPlate.

Referenced by add_to_plate(), Slic3r::GUI::ObjectList::can_drop(), Slic3r::GUI::ensure_belt_purge_tower(), Slic3r::GUI::GLGizmoAlignment::get_items_count(), Slic3r::GUI::GLGizmoAlignment::get_parent_box(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), notify_instance_removed(), notify_instance_update(), Slic3r::GUI::OrientJob::prepare_selection(), and select_plate_by_obj().

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

◆ find_instance_belongs()

int Slic3r::GUI::PartPlateList::find_instance_belongs ( int obj_id,
int instance_id )
7218{
7219 int ret = -1;
7220
7221 //update the plates after it
7222 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7223 {
7224 PartPlate* plate = m_plate_list[i];
7225 assert(plate != NULL);
7226
7227 if (plate->contain_instance_totally(obj_id, instance_id))
7228 return i;
7229 }
7230
7231 //return -1 for not found
7232 return ret;
7233}

References Slic3r::GUI::PartPlate::contain_instance_totally(), m_plate_list, and PartPlate.

Referenced by Slic3r::GUI::ObjectList::add_object_to_list(), Slic3r::GUI::ObjectGridTable::construct_object_configs(), and Slic3r::GUI::ObjectList::update_plate_values_for_items().

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

◆ find_plate_by_print_index()

int Slic3r::GUI::PartPlateList::find_plate_by_print_index ( int index)
7156{
7157 int plate_index = -1;
7158
7159 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7160 {
7161 PartPlate* plate = m_plate_list[i];
7162
7163 if (plate->m_print_index == print_index)
7164 {
7165 plate_index = i;
7166 break;
7167 }
7168 }
7169
7170 return plate_index;
7171}

References m_plate_list, Slic3r::GUI::PartPlate::m_print_index, and PartPlate.

Referenced by rebuild_plates_after_deserialize().

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

◆ generate_icon_textures()

void Slic3r::GUI::PartPlateList::generate_icon_textures ( )
private
6047{
6049 // use higher resolution images if graphic card and opengl version allow
6050 GLint max_tex_size = OpenGLManager::get_gl_info().get_max_tex_size(), icon_size = max_tex_size / 8;
6051 std::string path = resources_dir() + "/images/";
6052 std::string file_name;
6053
6054 if (icon_size > 256)
6055 icon_size = 256;
6056 //if (m_del_texture.get_id() == 0)
6057 {
6058 file_name = path + (m_is_dark ? "plate_close_dark.svg" : "plate_close.svg");
6059 if (!m_del_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6060 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6061 }
6062 }
6063
6064 //if (m_del_hovered_texture.get_id() == 0)
6065 {
6066 file_name = path + (m_is_dark ? "plate_close_hover_dark.svg" : "plate_close_hover.svg");
6067 if (!m_del_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6068 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6069 }
6070 }
6071
6072
6073 // if (m_move_front_texture.get_id() == 0)
6074 {
6075 file_name = path + (m_is_dark ? "plate_move_front_dark.svg" : "plate_move_front.svg");
6076 if (!m_move_front_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6077 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6078 }
6079 }
6080
6081 // if (m_move_front_hovered_texture.get_id() == 0)
6082 {
6083 file_name = path + (m_is_dark ? "plate_move_front_hover_dark.svg" : "plate_move_front_hover.svg");
6084 if (!m_move_front_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6085 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6086 }
6087 }
6088
6089 //if (m_arrange_texture.get_id() == 0)
6090 {
6091 file_name = path + (m_is_dark ? "plate_arrange_dark.svg" : "plate_arrange.svg");
6092 if (!m_arrange_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6093 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6094 }
6095 }
6096
6097 //if (m_arrange_hovered_texture.get_id() == 0)
6098 {
6099 file_name = path + (m_is_dark ? "plate_arrange_hover_dark.svg" : "plate_arrange_hover.svg");
6100 if (!m_arrange_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6101 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6102 }
6103 }
6104
6105 //if (m_orient_texture.get_id() == 0)
6106 {
6107 file_name = path + (m_is_dark ? "plate_orient_dark.svg" : "plate_orient.svg");
6108 if (!m_orient_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6109 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6110 }
6111 }
6112
6113 //if (m_orient_hovered_texture.get_id() == 0)
6114 {
6115 file_name = path + (m_is_dark ? "plate_orient_hover_dark.svg" : "plate_orient_hover.svg");
6116 if (!m_orient_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6117 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6118 }
6119 }
6120
6121 //if (m_locked_texture.get_id() == 0)
6122 {
6123 file_name = path + (m_is_dark ? "plate_locked_dark.svg" : "plate_locked.svg");
6124 if (!m_locked_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6125 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6126 }
6127 }
6128
6129 //if (m_locked_hovered_texture.get_id() == 0)
6130 {
6131 file_name = path + (m_is_dark ? "plate_locked_hover_dark.svg" : "plate_locked_hover.svg");
6132 if (!m_locked_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6133 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6134 }
6135 }
6136
6137 //if (m_lockopen_texture.get_id() == 0)
6138 {
6139 file_name = path + (m_is_dark ? "plate_unlocked_dark.svg" : "plate_unlocked.svg");
6140 if (!m_lockopen_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6141 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6142 }
6143 }
6144
6145 //if (m_lockopen_hovered_texture.get_id() == 0)
6146 {
6147 file_name = path + (m_is_dark ? "plate_unlocked_hover_dark.svg" : "plate_unlocked_hover.svg");
6148 if (!m_lockopen_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6149 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6150 }
6151 }
6152
6153 //if (m_bedtype_texture.get_id() == 0)
6154 {
6155 file_name = path + (m_is_dark ? "plate_settings_dark.svg" : "plate_settings.svg");
6156 if (!m_plate_settings_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6157 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6158 }
6159 }
6160
6161 {
6162 file_name = path + (m_is_dark ? "plate_set_filament_map_dark.svg" : "plate_set_filament_map.svg");
6163 if (!m_plate_set_filament_map_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6164 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6165 }
6166 }
6167
6168 {
6169 file_name = path + (m_is_dark ? "plate_set_filament_map_hover_dark.svg" : "plate_set_filament_map_hover.svg");
6170 if (!m_plate_set_filament_map_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6171 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6172 }
6173 }
6174
6175 //if (m_bedtype_changed_texture.get_id() == 0)
6176 {
6177 file_name = path + (m_is_dark ? "plate_settings_changed_dark.svg" : "plate_settings_changed.svg");
6178 if (!m_plate_settings_changed_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6179 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6180 }
6181 }
6182
6183 //if (m_bedtype_hovered_texture.get_id() == 0)
6184 {
6185 file_name = path + (m_is_dark ? "plate_settings_hover_dark.svg" : "plate_settings_hover.svg");
6186 if (!m_plate_settings_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6187 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6188 }
6189 }
6190
6191 //if (m_bedtype_changed_hovered_texture.get_id() == 0)
6192 {
6193 file_name = path + (m_is_dark ? "plate_settings_changed_hover_dark.svg" : "plate_settings_changed_hover.svg");
6194 if (!m_plate_settings_changed_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6195 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6196 }
6197 }
6198
6199 // if (m_plate_name_edit_texture.get_id() == 0)
6200 {
6201 file_name = path + (m_is_dark ? "plate_name_edit_dark.svg" : "plate_name_edit.svg");
6202 if (!m_plate_name_edit_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6203 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6204 }
6205 }
6206 // if (m_plate_name_edit_hovered_texture.get_id() == 0)
6207 {
6208 file_name = path + (m_is_dark ? "plate_name_edit_hover_dark.svg" : "plate_name_edit_hover.svg");
6209 if (!m_plate_name_edit_hovered_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6210 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6211 }
6212 }
6213
6214 // IMEX multi-material conflict warning badge
6215 {
6216 file_name = path + "obj_warning.svg";
6217 if (!m_imex_warn_texture.load_from_svg_file(file_name, true, false, false, icon_size)) {
6218 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":load file %1% failed (IMEX warn badge)") % file_name;
6219 }
6220 }
6221
6222 // IDEX/IQEX mode icon textures, one per ImexModeKind (fall back gracefully if an SVG is missing)
6223 {
6224 static const char* kind_names[] = { "normal", "copy", "mirror", "custom" }; // the Primary kind shows "normal"
6225 static_assert(std::size(kind_names) == kImexModeKindCount && std::tuple_size_v<decltype(m_imex_mode_textures)> == kImexModeKindCount);
6226 for (size_t kind = 0; kind < kImexModeKindCount; ++kind)
6227 for (const bool hovered : { false, true }) {
6228 file_name = path + "plate_imex_" + kind_names[kind] + "_mode" + (hovered ? "_hover" : "") + (m_is_dark ? "_dark.svg" : ".svg");
6229 GLTexture& texture = hovered ? m_imex_mode_hovered_textures[kind] : m_imex_mode_textures[kind];
6230 if (!texture.load_from_svg_file(file_name, true, false, false, icon_size))
6231 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":load file %1% failed (IDEX/IQEX mode icon)") % file_name;
6232 }
6233 }
6234
6235 std::string text_str = "01";
6236 // ORCA also scale font size to prevent low res texture
6237 int size = wxGetApp().em_unit() * PARTPLATE_ICON_SIZE;
6238 auto l = Label::sysFont(int(size), true);
6239 wxFont* font = &l;
6240
6241 for (int i = 0; i < MAX_PLATE_COUNT; i++) {
6242 if (m_idx_textures[i].get_id() == 0) {
6243 //file_name = path + (boost::format("plate_%1%.svg") % (i + 1)).str();
6244 if ( i < 9 )
6245 file_name = std::string("0") + std::to_string(i+1);
6246 else
6247 file_name = std::to_string(i+1);
6248
6249 wxColour foreground(0xf2, 0x75, 0x4e, 0xff);
6250 if (!m_idx_textures[i].generate_from_text_string(file_name, *font, *wxBLACK, foreground)) {
6251 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
6252 }
6253 }
6254 }
6255}
static const int PARTPLATE_ICON_SIZE
Definition PartPlate.cpp:132
#define MAX_PLATE_COUNT
Definition PartPlate.hpp:59
static wxFont sysFont(int size, bool bold=false)
Definition Label.cpp:28
int get_max_tex_size() const
Definition OpenGLManager.cpp:95
static const GLInfo & get_gl_info()
Definition OpenGLManager.hpp:106
std::array< GLTexture, 4 > m_imex_mode_textures
Definition PartPlate.hpp:821
GLTexture m_plate_settings_changed_hovered_texture
Definition PartPlate.hpp:816
GLTexture m_orient_hovered_texture
Definition PartPlate.hpp:808
GLTexture m_arrange_hovered_texture
Definition PartPlate.hpp:806
GLTexture m_plate_set_filament_map_hovered_texture
Definition PartPlate.hpp:818
GLTexture m_plate_name_edit_texture
Definition PartPlate.hpp:819
GLTexture m_arrange_texture
Definition PartPlate.hpp:805
GLTexture m_plate_name_edit_hovered_texture
Definition PartPlate.hpp:820
GLTexture m_locked_texture
Definition PartPlate.hpp:809
GLTexture m_plate_set_filament_map_texture
Definition PartPlate.hpp:817
GLTexture m_plate_settings_hovered_texture
Definition PartPlate.hpp:815
GLTexture m_orient_texture
Definition PartPlate.hpp:807
GLTexture m_move_front_hovered_texture
Definition PartPlate.hpp:803
GLTexture m_lockopen_hovered_texture
Definition PartPlate.hpp:812
GLTexture m_idx_textures[MAX_PLATE_COUNT]
Definition PartPlate.hpp:824
GLTexture m_imex_warn_texture
Definition PartPlate.hpp:823
GLTexture m_locked_hovered_texture
Definition PartPlate.hpp:810
std::array< GLTexture, 4 > m_imex_mode_hovered_textures
Definition PartPlate.hpp:822
GLTexture m_move_front_texture
Definition PartPlate.hpp:804
GLTexture m_del_texture
Definition PartPlate.hpp:801
GLTexture m_lockopen_texture
Definition PartPlate.hpp:811
GLTexture m_plate_settings_changed_texture
Definition PartPlate.hpp:814
bool m_is_dark
Definition PartPlate.hpp:832
GLTexture m_plate_settings_texture
Definition PartPlate.hpp:813
GLTexture m_del_hovered_texture
Definition PartPlate.hpp:802
bool m_icon_textures_dark
Definition PartPlate.hpp:833
int GLint
Definition gl.h:2062
constexpr size_t kImexModeKindCount
Definition IMEXHelpers.hpp:457
const std::string & resources_dir()
Definition utils.cpp:296
@ hovered
Definition GLGizmoEmboss.cpp:223

References Slic3r::GUI::OpenGLManager::get_gl_info(), Slic3r::GUI::OpenGLManager::GLInfo::get_max_tex_size(), Slic3r::kImexModeKindCount, Slic3r::GUI::GLTexture::load_from_svg_file(), m_arrange_hovered_texture, m_arrange_texture, m_del_hovered_texture, m_del_texture, m_icon_textures_dark, m_idx_textures, m_imex_mode_hovered_textures, m_imex_mode_textures, m_imex_warn_texture, m_is_dark, m_locked_hovered_texture, m_locked_texture, m_lockopen_hovered_texture, m_lockopen_texture, m_move_front_hovered_texture, m_move_front_texture, m_orient_hovered_texture, m_orient_texture, m_plate_name_edit_hovered_texture, m_plate_name_edit_texture, m_plate_set_filament_map_hovered_texture, m_plate_set_filament_map_texture, m_plate_settings_changed_hovered_texture, m_plate_settings_changed_texture, m_plate_settings_hovered_texture, m_plate_settings_texture, MAX_PLATE_COUNT, PARTPLATE_ICON_SIZE, Slic3r::resources_dir(), and Label::sysFont().

Referenced by load_icon_textures().

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

◆ generate_new_id()

ObjectID Slic3r::ObjectBase::generate_new_id ( )
inlinestaticprivateinherited
100{ return ObjectID(++ s_last_id); }
static size_t s_last_id
Definition ObjectID.hpp:101

References s_last_id.

Referenced by ObjectBase(), and set_new_unique_id().

Here is the caller graph for this function:

◆ get_bounding_box()

BoundingBoxf3 & Slic3r::GUI::PartPlateList::get_bounding_box ( )
inline
1067{ return m_bounding_box; }

References m_bounding_box.

Referenced by Slic3r::GUI::GLCanvas3D::scene_bounding_box(), and select_plate().

Here is the caller graph for this function:

◆ get_curr_plate() [1/2]

PartPlate * Slic3r::GUI::PartPlateList::get_curr_plate ( )
inline
962{ return m_plate_list[m_current_plate]; }

References m_current_plate, m_plate_list, and PartPlate.

Referenced by Slic3r::GUI::Plater::_calib_pa_pattern_gen_gcode(), Slic3r::GUI::GLCanvas3D::_picking_pass_imex_ghosts(), Slic3r::GUI::GLCanvas3D::_render_imex_ghosts(), Slic3r::GUI::GLCanvas3D::_render_platelist(), Slic3r::GUI::GLCanvas3D::_update_inactive_plates_visibility(), Slic3r::GUI::MainFrame::can_export_gcode(), Slic3r::GUI::Plater::export_config_3mf(), Slic3r::GUI::Plater::priv::generate_first_layer_bbox(), Slic3r::GUI::MainFrame::get_enable_print_status(), Slic3r::GUI::MainFrame::get_enable_slice_status(), Slic3r::GUI::init_arrange_params(), Slic3r::GUI::GLCanvas3D::load_gcode_preview(), Slic3r::GUI::Plater::priv::on_process_completed(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::Plater::priv::on_slicing_update(), Slic3r::GUI::FillBedJob::prepare(), Slic3r::GUI::ArrangeJob::prepare_imex_zones(), Slic3r::GUI::ArrangeJob::prepare_partplate(), Slic3r::GUI::OrientJob::prepare_partplate(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::GUI::GCodeViewer::render_legend_color_arr_recommen(), Slic3r::GUI::GCodeViewer::render_markers(), Slic3r::CLI::run(), Slic3r::GUI::Plater::priv::scale_selection_to_fit_print_volume(), Slic3r::GUI::Plater::send_gcode(), Slic3r::GUI::Plater::priv::set_current_panel(), Slic3r::GUI::Plater::priv::trigger_auto_reslice_now(), Slic3r::GUI::Plater::priv::update_background_process(), and Slic3r::GUI::GLCanvas3D::update_compacted_wipe_tower_clearance().

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

◆ get_curr_plate() [2/2]

const PartPlate * Slic3r::GUI::PartPlateList::get_curr_plate ( ) const
inline
963{ return m_plate_list[m_current_plate]; }

References m_current_plate, m_plate_list, and PartPlate.

Here is the call graph for this function:

◆ get_curr_plate_index()

◆ get_current_fff_print()

Print & Slic3r::GUI::PartPlateList::get_current_fff_print ( ) const
8111{
8112 PartPlate* current_plate;
8113 Print* print;
8114
8115 current_plate = m_plate_list[m_current_plate];
8116 //BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":m_current_plate %1%, current_plate %2%") % m_current_plate % current_plate;
8117 assert(current_plate != NULL);
8118
8119 current_plate->get_print((PrintBase **)&print, nullptr, nullptr);
8120
8121 return *print;
8122}

References Slic3r::GUI::PartPlate::get_print(), m_current_plate, m_plate_list, PartPlate, and print().

Here is the call graph for this function:

◆ get_current_plate_origin()

Vec3d Slic3r::GUI::PartPlateList::get_current_plate_origin ( )
inline

References compute_origin(), m_current_plate, and m_plate_cols.

Here is the call graph for this function:

◆ get_current_shape_position()

Vec2d Slic3r::GUI::PartPlateList::get_current_shape_position ( )
inline

References compute_shape_position(), m_current_plate, and m_plate_cols.

Here is the call graph for this function:

◆ get_current_slice_result()

GCodeProcessorResult * Slic3r::GUI::PartPlateList::get_current_slice_result ( ) const
8126{
8127 PartPlate* current_plate;
8128
8129 current_plate = m_plate_list[m_current_plate];
8130 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":m_current_plate %1%, current_plate %2%") % m_current_plate % current_plate;
8131 assert(current_plate != NULL);
8132
8133 return current_plate->get_slice_result();
8134}

References Slic3r::GUI::PartPlate::get_slice_result(), m_current_plate, m_plate_list, and PartPlate.

Referenced by Slic3r::GUI::Plater::priv::undo_redo_to().

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

◆ get_exclude_area()

Pointfs Slic3r::GUI::PartPlateList::get_exclude_area ( )
inline
976{ return m_exclude_areas; }

References m_exclude_areas.

◆ get_extruders()

std::set< int > Slic3r::GUI::PartPlateList::get_extruders ( bool conside_custom_gcode = false) const
6920{
6921 int plate_count = get_plate_count();
6922 std::set<int> extruder_ids;
6923
6924 for (size_t i = 0; i < plate_count; i++) {
6925 auto plate_extruders = m_plate_list[i]->get_extruders(conside_custom_gcode);
6926 extruder_ids.insert(plate_extruders.begin(), plate_extruders.end());
6927 }
6928
6929 return extruder_ids;
6930}
int get_plate_count() const
Definition PartPlate.cpp:7042

References get_plate_count(), and m_plate_list.

Referenced by Slic3r::GUI::ArrangeJob::prepare_wipe_tower().

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

◆ get_height_limits()

void Slic3r::GUI::PartPlateList::get_height_limits ( float & height_to_lid,
float & height_to_rod )
inline
951 {
952 height_to_lid = m_height_to_lid;
953 height_to_rod = m_height_to_rod;
954 }

References m_height_to_lid, and m_height_to_rod.

◆ get_logo_texture_filename()

const std::string & Slic3r::GUI::PartPlateList::get_logo_texture_filename ( )
inline
1085{ return m_logo_texture_filename; }

References m_logo_texture_filename.

◆ get_nonempty_plate_list()

std::vector< PartPlate * > Slic3r::GUI::PartPlateList::get_nonempty_plate_list ( )
6900{
6901 std::vector<PartPlate*> nonempty_plate_list;
6902 for (auto plate : m_plate_list){
6903 //if (plate->get_extruders().size() != 0) {
6904 if (!plate->empty()) { // ORCA counts failed slices as non empty because they have model and should be calculated on total count
6905 nonempty_plate_list.push_back(plate);
6906 }
6907 }
6908 return nonempty_plate_list;
6909}

References m_plate_list.

Referenced by Slic3r::GUI::GLCanvas3D::_render_imgui_select_plate_toolbar(), Slic3r::GUI::GLCanvas3D::_update_select_plate_toolbar_stats_item(), get_nonempty_plates_slice_results(), and Slic3r::GUI::GCodeViewer::render_all_plates_stats().

Here is the caller graph for this function:

◆ get_nonempty_plates_slice_results()

std::vector< const GCodeProcessorResult * > Slic3r::GUI::PartPlateList::get_nonempty_plates_slice_results ( )
6911 {
6912 std::vector<const GCodeProcessorResult*> nonempty_plates_slice_result;
6913 for (auto plate : get_nonempty_plate_list()) {
6914 nonempty_plates_slice_result.push_back(plate->get_slice_result());
6915 }
6916 return nonempty_plates_slice_result;
6917}
std::vector< PartPlate * > get_nonempty_plate_list()
Definition PartPlate.cpp:6899

References get_nonempty_plate_list().

Referenced by Slic3r::GUI::GLCanvas3D::_render_imgui_select_plate_toolbar().

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

◆ get_plate()

PartPlate * Slic3r::GUI::PartPlateList::get_plate ( int index)
6875{
6876 PartPlate* plate = NULL;
6877
6878 if (index >= m_plate_list.size() || index < 0)
6879 {
6880 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":can not find index %1%, size %2%") % index % m_plate_list.size();
6881 return NULL;
6882 }
6883
6884 plate = m_plate_list[index];
6885 assert(plate != NULL);
6886
6887 return plate;
6888}

References m_plate_list, and PartPlate.

Referenced by Slic3r::GUI::Plater::_calib_pa_pattern(), Slic3r::GUI::GLCanvas3D::_render_imgui_select_plate_toolbar(), Slic3r::GUI::GLCanvas3D::_render_plate_switcher(), Slic3r::GUI::GLCanvas3D::_update_imgui_select_plate_toolbar(), add_to_plate(), Slic3r::GUI::TabPrinter::build_unregular_pages(), Slic3r::GUI::GLCanvas3D::do_move(), duplicate_plate(), Slic3r::GUI::ensure_belt_purge_tower(), Slic3r::GUI::estimate_wipe_tower_info(), Slic3r::GUI::ArrangeJob::finalize(), Slic3r::GUI::GLGizmoAlignment::get_parent_box(), Slic3r::GUI::ObjectDataViewModel::Init(), Slic3r::GUI::Plater::invalid_all_plate_thumbnails(), Slic3r::GLVolumeCollection::load_real_wipe_tower_preview(), Slic3r::GLVolumeCollection::load_wipe_tower_preview(), lock_plate(), Slic3r::GUI::Plater::on_filament_count_change(), Slic3r::GUI::Plater::priv::on_select_preset(), Slic3r::GUI::ArrangeJob::prepare_all(), Slic3r::GUI::ArrangeJob::prepare_imex_zones(), Slic3r::GUI::ArrangeJob::prepare_wipe_tower(), Slic3r::GUI::CalibUtils::process_and_store_3mf(), Slic3r::GUI::ObjectList::reload_all_plates(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::GUI::GLCanvas3D::render_thumbnail_internal(), Slic3r::GUI::Plater::priv::replace_all_with_stl(), Slic3r::CLI::run(), Slic3r::GUI::set_arrange_polygon_bed_exclusion_extruders_for_all_plates(), set_default_wipe_tower_pos_for_plate(), Slic3r::GUI::Plater::update_filament_volume_map(), Slic3r::GUI::Plater::update_obj_preview_thumbnail(), and Slic3r::GUI::Plater::update_plate_thumbnails().

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

◆ get_plate_cols()

int Slic3r::GUI::PartPlateList::get_plate_cols ( )
inline
998{ return m_plate_cols; }

References m_plate_cols.

Referenced by Slic3r::GUI::FillBedJob::finalize(), and Slic3r::GUI::FillBedJob::prepare().

Here is the caller graph for this function:

◆ get_plate_count()

◆ get_plate_list()

std::vector< PartPlate * > & Slic3r::GUI::PartPlateList::get_plate_list ( )
inline
965{ return m_plate_list; };

References m_plate_list.

Referenced by Slic3r::GUI::Plater::priv::on_process_completed(), Slic3r::GUI::try_pop_up_before_slice(), and Slic3r::GUI::Plater::priv::update_objects_position_when_select_preset().

Here is the caller graph for this function:

◆ get_plate_size()

void Slic3r::GUI::PartPlateList::get_plate_size ( int & width,
int & depth,
double & height )
inline
918 {
920 depth = m_plate_depth;
922 }

References m_plate_depth, m_plate_height, and m_plate_width.

Referenced by Slic3r::CLI::run().

Here is the caller graph for this function:

◆ get_selected_plate()

PartPlate * Slic3r::GUI::PartPlateList::get_selected_plate ( )
6891{
6893 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":can not find m_current_plate %1%, size %2%") % m_current_plate % m_plate_list.size();
6894 return NULL;
6895 }
6897}

References m_current_plate, m_plate_list, and PartPlate.

Referenced by Slic3r::GUI::Plater::priv::on_select_preset().

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

◆ get_sliced_result()

void Slic3r::GUI::PartPlateList::get_sliced_result ( std::vector< bool > & sliced_result,
std::vector< std::string > & gcode_paths )
8226{
8227 sliced_result.resize(m_plate_list.size());
8228 gcode_paths.resize(m_plate_list.size());
8229
8230 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8231 {
8232 sliced_result[i] = m_plate_list[i]->m_slice_result_valid;
8233 gcode_paths[i] = m_plate_list[i]->m_tmp_gcode_path;
8234 }
8235}

References m_plate_list.

Referenced by Slic3r::UndoRedo::StackImpl::load_snapshot().

Here is the caller graph for this function:

◆ get_wrapping_exclude_area()

Pointfs Slic3r::GUI::PartPlateList::get_wrapping_exclude_area ( ) const
inline

◆ icon_textures_loaded()

bool Slic3r::GUI::PartPlateList::icon_textures_loaded ( ) const
inline
1155{ return m_del_texture.get_id() != 0 && m_icon_textures_dark == m_is_dark; }

References m_del_texture, m_icon_textures_dark, and m_is_dark.

Referenced by load_icon_textures().

Here is the caller graph for this function:

◆ id()

ObjectID Slic3r::ObjectBase::id ( ) const
inlineinherited
69{ return m_id; }

References m_id.

Referenced by Slic3r::CutObjectBase::CutObjectBase(), Slic3r::Model::Model(), Slic3r::ModelInstance::ModelInstance(), Slic3r::ModelMaterial::ModelMaterial(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelObject::ModelObject(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), Slic3r::ModelVolume::ModelVolume(), ObjectBase(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::PrintBase::SlicingStatus::SlicingStatus(), Slic3r::_BBS_3MF_Exporter::_add_cut_information_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_model_config_file_to_archive(), Slic3r::_BBS_3MF_Exporter::_add_slice_info_config_file_to_archive(), Slic3r::GUI::Plater::priv::actualize_slicing_warnings(), Slic3r::ModelObjectStatusDB::add(), Slic3r::ModelObjectStatusDB::add_if_new(), Slic3r::Model::add_object(), Slic3r::append_and_translate(), Slic3r::SLAPrint::apply(), Slic3r::GUI::calc_distance(), Slic3r::GUI::calc_surface_offset(), Slic3r::check_model_ids_equal(), Slic3r::check_model_ids_validity(), Slic3r::GUI::GLGizmoTextureDisplacement::close_image_adjust(), Slic3r::Model::collect_reusable_objects(), Slic3r::ModelObject::convert_units(), copy_id(), Slic3r::PrintObjectStatusDB::count(), anonymous_namespace{RaycastManager.cpp}::create_key(), Slic3r::GUI::create_meshes(), anonymous_namespace{EmbossJob.cpp}::create_volume(), Slic3r::GUI::Emboss::create_volume_sources(), Slic3r::GUI::GLGizmoPainterBase::data_changed(), Slic3r::GCode::do_export(), Slic3r::GUI::PartPlate::duplicate_all_instance(), Slic3r::GUI::PartPlateList::duplicate_plate(), Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::Print::export_cached_data(), Slic3r::GUI::Plater::export_stl(), Slic3r::find_volume_extents(), Slic3r::PreciseSeam::detail::fragment_location(), Slic3r::GUI::Plater::priv::generate_first_layer_bbox(), Slic3r::ModelObjectStatusDB::get(), Slic3r::Model::get_backup_path(), Slic3r::GUI::GLCanvas3D::get_empty_cells(), Slic3r::ModelInstance::get_labeled_id(), Slic3r::GUI::get_model_volume(), Slic3r::PrintObjectStatusDB::get_range(), Slic3r::GUI::get_selected_volume(), Slic3r::GUI::get_volume(), Slic3r::CutObjectBase::has_same_id(), Slic3r::UndoRedo::StackImpl::immutable_object_id_impl(), Slic3r::GUI::GLGizmoFdmSupports::init_print_instance(), Slic3r::CutObjectBase::is_equal(), Slic3r::GUI::GLGizmoSVG::is_svg_object(), Slic3r::ModelVolume::is_the_only_one_part(), Slic3r::GUI::IMSlider::IsNewPrint(), Slic3r::ModelObject::load(), load_and_construct(), Slic3r::Print::load_cached_data(), Slic3r::GLVolumeCollection::load_object_auxiliary(), Slic3r::GLVolumeCollection::load_object_volume(), Slic3r::GUI::GCodeViewer::load_shells(), Slic3r::UndoRedo::StackImpl::load_snapshot(), Slic3r::GUI::GLCanvas3D::CenterOfMass::model_markers(), Slic3r::model_property_changed(), Slic3r::model_volume_list_changed(), Slic3r::model_volume_list_copy_configs(), Slic3r::ModelConfigObject::object_id_and_timestamp_match(), Slic3r::ObjectWithTimestamp::object_id_and_timestamp_match(), Slic3r::GUI::GLGizmoEmboss::on_mouse_change_selection(), Slic3r::GUI::GLGizmoSimplify::on_render_input_window(), Slic3r::GUI::GLGizmoTextureDisplacement::open_image_adjust(), Slic3r::CutObjectBase::operator<(), Slic3r::Model::operator=(), Slic3r::ModelObject::operator=(), Slic3r::ModelObject::operator=(), Slic3r::CutObjectBase::operator==(), Slic3r::outer_inner_brim_area(), Slic3r::GUI::GLGizmoTextureDisplacement::painted_area_mm2(), Slic3r::GUI::GLGizmoCut3D::perform_cut(), anonymous_namespace{GLGizmoEmboss.cpp}::prepare_volumes_to_slice(), Slic3r::GUI::GLGizmoTextureDisplacement::preview_part(), Slic3r::GCode::process_layer(), Slic3r::GUI::NotificationManager::push_slicing_warning_notification(), Slic3r::GUI::GLGizmoTextureDisplacement::queue_preview_job(), Slic3r::GUI::queue_texture_displacement_debug(), Slic3r::GUI::GLGizmoEmboss::re_emboss(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_other_paint_overlay(), Slic3r::GUI::GLGizmoTextureDisplacement::rebuild_painted_colors(), Slic3r::GUI::GLCanvas3D::reload_scene(), Slic3r::_BBS_Backup_Manager::remove_backup(), Slic3r::Model::remove_backup_path_if_exist(), Slic3r::GUI::GLGizmoTextureDisplacement::render_image_adjust_window(), Slic3r::CLI::run(), Slic3r::GUI::GLCanvas3D::LayersEditing::select_object(), Slic3r::ModelMaterial::serialize(), Slic3r::Model::set_backup_path(), Slic3r::GUI::GLGizmoBrimEars::set_brim_data(), Slic3r::GUI::PartPlate::set_hover_id(), Slic3r::GUI::GLGizmoEmboss::set_volume_by_selection(), Slic3r::GUI::GLGizmoSVG::set_volume_by_selection(), Slic3r::sla_instances(), Slic3r::slices_to_regions(), Slic3r::ModelObject::split(), anonymous_namespace{EmbossJob.cpp}::start_create_volume_on_surface_job(), anonymous_namespace{SurfaceDrag.cpp}::start_dragging(), Slic3r::GUI::Emboss::start_update_volume(), Slic3r::UndoRedo::StackImpl::take_snapshot(), Slic3r::GUI::texture_displacement_bake_volume(), Slic3r::GUI::GLGizmoPainterBase::update_contours(), anonymous_namespace{EmbossJob.cpp}::update_name_in_list(), Slic3r::GUI::ObjectList::update_name_in_model(), Slic3r::GUI::update_object_cut_id(), Slic3r::GUI::GLGizmoTextureDisplacement::v2_recommendation(), Slic3r::verify_update_print_object_regions(), wipe_tower_instance_id, and wipe_tower_object_id.

◆ init()

void Slic3r::GUI::PartPlateList::init ( )
private
5964{
5965 m_intialized = false;
5966 PartPlate* first_plate = NULL;
5967 first_plate = new PartPlate(this, Vec3d(0.0, 0.0, 0.0), m_plate_width, m_plate_depth, m_plate_height, m_plater, m_model, true, printer_technology);
5968 assert(first_plate != NULL);
5969 m_plate_list.push_back(first_plate);
5970
5971 m_print_index = 0;
5973 {
5974 Print* print = new Print();
5975 GCodeResult* gcode = new GCodeResult();
5978 first_plate->set_print(print, gcode, m_print_index);
5979 m_print_index++;
5980 }
5981 first_plate->set_index(0);
5982
5983 m_plate_count = 1;
5984 m_plate_cols = 1;
5985 m_current_plate = 0;
5986
5987 select_plate(0);
5988 unprintable_plate.set_index(1);
5989
5990 m_intialized = true;
5991}

References Slic3r::GUI::gcode(), m_current_plate, m_gcode_result_list, m_intialized, m_model, m_plate_cols, m_plate_count, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, m_plater, m_print_index, m_print_list, PartPlate, print(), printer_technology, Slic3r::ptFFF, select_plate(), Slic3r::GUI::PartPlate::set_index(), Slic3r::GUI::PartPlate::set_print(), and unprintable_plate.

Referenced by PartPlateList(), PartPlateList(), reinit(), and reset().

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

◆ init_bed_type_info()

void Slic3r::GUI::PartPlateList::init_bed_type_info ( )
8763{
8764 BedTextureInfo::TexturePart pct_part_left(10, 130, 10, 110, "orca_bed_pct_left.svg");
8765 BedTextureInfo::TexturePart st_part1(9, 70, 12.5, 170, "bbl_bed_st_left.svg");
8766 BedTextureInfo::TexturePart st_part2(74, -10, 148, 12, "bbl_bed_st_bottom.svg");
8767 BedTextureInfo::TexturePart pc_part1(10, 130, 10, 110, "bbl_bed_pc_left.svg");
8768 BedTextureInfo::TexturePart pc_part2(74, -10, 148, 12, "bbl_bed_pc_bottom.svg");
8769 BedTextureInfo::TexturePart ep_part1(7.5, 90, 12.5, 150, "bbl_bed_ep_left.svg");
8770 BedTextureInfo::TexturePart ep_part2(74, -10, 148, 12, "bbl_bed_ep_bottom.svg");
8771 BedTextureInfo::TexturePart pei_part1(7.5, 50, 12.5, 190, "bbl_bed_pei_left.svg");
8772 BedTextureInfo::TexturePart pei_part2(74, -10, 148, 12, "bbl_bed_pei_bottom.svg");
8773 BedTextureInfo::TexturePart pte_part1(10, 80, 10, 160, "bbl_bed_pte_left.svg");
8774 BedTextureInfo::TexturePart pte_part2(74, -10, 148, 12, "bbl_bed_pte_bottom.svg");
8775 auto bed_texture_maps = wxGetApp().plater()->get_bed_texture_maps();
8776 std::string bottom_texture_end_name = bed_texture_maps.find("bottom_texture_end_name") != bed_texture_maps.end() ? bed_texture_maps["bottom_texture_end_name"] : "";
8777 std::string bottom_texture_rect_str = bed_texture_maps.find("bottom_texture_rect") != bed_texture_maps.end() ? bed_texture_maps["bottom_texture_rect"] : "";
8778 std::string bottom_texture_rect_longer_str = bed_texture_maps.find("bottom_texture_rect_longer") != bed_texture_maps.end() ? bed_texture_maps["bottom_texture_rect_longer"] : "";
8779 std::string middle_texture_rect_str = bed_texture_maps.find("middle_texture_rect") != bed_texture_maps.end() ? bed_texture_maps["middle_texture_rect"] : "";
8780 std::string use_double_extruder_default_texture = bed_texture_maps.find("use_double_extruder_default_texture") != bed_texture_maps.end() ? bed_texture_maps["use_double_extruder_default_texture"] : "";
8781 std::array<float, 4> bottom_texture_rect = {0, 0, 0, 0}, bottom_texture_rect_longer = {0, 0, 0, 0}, middle_texture_rect = {0, 0, 0, 0};
8782 if (bottom_texture_rect_str.size() > 0) {
8783 std::vector<std::string> items;
8784 boost::algorithm::erase_all(bottom_texture_rect_str, " ");
8785 boost::split(items, bottom_texture_rect_str, boost::is_any_of(","));
8786 if (items.size() == 4) {
8787 for (int i = 0; i < items.size(); i++) {
8788 bottom_texture_rect[i] = std::atof(items[i].c_str());
8789 }
8790 }
8791 }
8792 if (bottom_texture_rect_longer_str.size() > 0) {
8793 std::vector<std::string> items;
8794 boost::algorithm::erase_all(bottom_texture_rect_longer_str, " ");
8795 boost::split(items, bottom_texture_rect_longer_str, boost::is_any_of(","));
8796 if (items.size() == 4) {
8797 for (int i = 0; i < items.size(); i++) {
8798 bottom_texture_rect_longer[i] = std::atof(items[i].c_str());
8799 }
8800 }
8801 }
8802 if (middle_texture_rect_str.size() > 0) {
8803 std::vector<std::string> items;
8804 boost::algorithm::erase_all(middle_texture_rect_str, " ");
8805 boost::split(items, middle_texture_rect_str, boost::is_any_of(","));
8806 if (items.size() == 4) {
8807 for (int i = 0; i < items.size(); i++) {
8808 middle_texture_rect[i] = std::atof(items[i].c_str());
8809 }
8810 }
8811 }
8812 auto is_single_extruder = wxGetApp().preset_bundle->get_printer_extruder_count() == 1;
8813 bool use_double_extruder_texture = !is_single_extruder || use_double_extruder_default_texture == "true";
8814 if (use_double_extruder_texture) {
8815 pte_part1 = BedTextureInfo::TexturePart(57, 300, 236.12f, 10.f, "bbl_bed_pte_middle.svg");
8816 auto &middle_rect = middle_texture_rect;
8817 if (middle_rect[2] > 0.f) {
8818 pte_part1 = BedTextureInfo::TexturePart(middle_rect[0], middle_rect[1], middle_rect[2], middle_rect[3], "bbl_bed_pte_middle.svg");
8819 }
8820 pte_part2 = BedTextureInfo::TexturePart(45, -14.5, 70, 8, "bbl_bed_pte_left_bottom.svg");
8821 auto &bottom_rect = bottom_texture_rect;
8822 auto &bottom_rect_longer = bottom_texture_rect_longer;
8823 if (bottom_texture_end_name.size() > 0 && bottom_rect[2] > 0.f) {
8824 std::string pte_part2_name = "bbl_bed_pte_bottom_" + bottom_texture_end_name + ".svg";
8825 pte_part2 = BedTextureInfo::TexturePart(bottom_rect[0], bottom_rect[1], bottom_rect[2], bottom_rect[3], pte_part2_name);
8826 }
8827
8828 pei_part1 = BedTextureInfo::TexturePart(57, 300, 236.12f, 10.f, "bbl_bed_pei_middle.svg");
8829 if (middle_rect[2] > 0.f) {
8830 pei_part1 = BedTextureInfo::TexturePart(middle_rect[0], middle_rect[1], middle_rect[2], middle_rect[3], "bbl_bed_pei_middle.svg");
8831 }
8832 pei_part2 = BedTextureInfo::TexturePart(45, -14.5, 70, 8, "bbl_bed_pei_left_bottom.svg");
8833 if (bottom_texture_end_name.size() > 0 && bottom_rect[2] > 0.f) {
8834 std::string pei_part2_name = "bbl_bed_pei_bottom_" + bottom_texture_end_name + ".svg";
8835 pei_part2 = BedTextureInfo::TexturePart(bottom_rect[0], bottom_rect[1], bottom_rect[2], bottom_rect[3], pei_part2_name);
8836 }
8837
8838 st_part1 = BedTextureInfo::TexturePart(57, 300, 236.12f, 10.f, "bbl_bed_st_middle.svg");
8839 if (middle_rect[2] > 0.f) {
8840 st_part1 = BedTextureInfo::TexturePart(middle_rect[0], middle_rect[1], middle_rect[2], middle_rect[3], "bbl_bed_st_middle.svg");
8841 }
8842 st_part2 = BedTextureInfo::TexturePart(45, -14.5, 260, 8, "bbl_bed_st_left_bottom.svg");
8843 if (bottom_texture_end_name.size() > 0 && bottom_rect[2] > 0.f) {
8844 std::string st_part2_name = "bbl_bed_st_bottom_" + bottom_texture_end_name + ".svg";
8845 st_part2 = BedTextureInfo::TexturePart(bottom_rect[0], bottom_rect[1], bottom_rect[2], bottom_rect[3], st_part2_name);
8846 } else if (bottom_rect_longer[2] > 0.f) {
8847 // SuperTack bottom strip uses the wider "longer" rect.
8848 st_part2.update_pos(bottom_rect_longer[0], bottom_rect_longer[1], bottom_rect_longer[2], bottom_rect_longer[3]);
8849 }
8850
8851 ep_part1 = BedTextureInfo::TexturePart(57, 300, 236.12f, 10.f, "bbl_bed_ep_middle.svg");
8852 if (middle_rect[2] > 0.f) {
8853 ep_part1 = BedTextureInfo::TexturePart(middle_rect[0], middle_rect[1], middle_rect[2], middle_rect[3], "bbl_bed_ep_middle.svg");
8854 }
8855 ep_part2 = BedTextureInfo::TexturePart(45, -14.5, 260, 8, "bbl_bed_ep_left_bottom.svg");
8856 if (bottom_texture_end_name.size() > 0 && bottom_rect[2] > 0.f) {
8857 std::string ep_part2_name = "bbl_bed_ep_bottom_" + bottom_texture_end_name + ".svg";
8858 ep_part2 = BedTextureInfo::TexturePart(bottom_rect[0], bottom_rect[1], bottom_rect[2], bottom_rect[3], ep_part2_name);
8859 } else if (bottom_rect_longer[2] > 0.f) {
8860 // Engineering-plate bottom strip uses the wider "longer" rect.
8861 ep_part2.update_pos(bottom_rect_longer[0], bottom_rect_longer[1], bottom_rect_longer[2], bottom_rect_longer[3]);
8862 }
8863
8864 pc_part1 = BedTextureInfo::TexturePart(57, 300, 236.12f, 10.f, "bbl_bed_pc_middle.svg");
8865 if (middle_rect[2] > 0.f) {
8866 pc_part1 = BedTextureInfo::TexturePart(middle_rect[0], middle_rect[1], middle_rect[2], middle_rect[3], "bbl_bed_pc_middle.svg"); }
8867 pc_part2 = BedTextureInfo::TexturePart(45, -14.5, 70, 8, "bbl_bed_pc_left_bottom.svg");
8868 if (bottom_texture_end_name.size() > 0 && bottom_rect[2] > 0.f) {
8869 std::string pc_part2_name = "bbl_bed_pc_bottom_" + bottom_texture_end_name + ".svg";
8870 pc_part2 = BedTextureInfo::TexturePart(bottom_rect[0], bottom_rect[1], bottom_rect[2], bottom_rect[3], pc_part2_name);
8871 }
8872
8874 auto bed_types = wxGetApp().plater()->sidebar().get_cur_combox_bed_types();
8875 for (int i = 0; i < bed_types.size(); i++) {
8876 m_allow_bed_type_in_double_nozzle[bed_types[i]] = true;
8877 }
8878 } else {
8879 if (bottom_texture_end_name.size() > 0) {
8880 st_part2.update_file("bbl_bed_st_bottom_" + bottom_texture_end_name + ".svg");
8881 pc_part2.update_file("bbl_bed_pc_bottom_" + bottom_texture_end_name + ".svg");
8882 ep_part2.update_file("bbl_bed_ep_bottom_" + bottom_texture_end_name + ".svg");
8883 pei_part2.update_file("bbl_bed_pei_bottom_" + bottom_texture_end_name + ".svg");
8884 pte_part2.update_file("bbl_bed_pte_bottom_" + bottom_texture_end_name + ".svg");
8885 }
8886 }
8887
8888 for (size_t i = 0; i < btCount; i++) {
8889 bed_texture_info[i].reset();
8890 bed_texture_info[i].parts.clear();
8891 }
8892 bed_texture_info[btSuperTack].parts.push_back(st_part1);
8893 bed_texture_info[btSuperTack].parts.push_back(st_part2);
8894 bed_texture_info[btPC].parts.push_back(pc_part1);
8895 bed_texture_info[btPC].parts.push_back(pc_part2);
8896 bed_texture_info[btPCT].parts.push_back(pct_part_left);
8897 bed_texture_info[btPCT].parts.push_back(pc_part2);
8898 bed_texture_info[btEP].parts.push_back(ep_part1);
8899 bed_texture_info[btEP].parts.push_back(ep_part2);
8900 bed_texture_info[btPEI].parts.push_back(pei_part1);
8901 bed_texture_info[btPEI].parts.push_back(pei_part2);
8902 bed_texture_info[btPTE].parts.push_back(pte_part1);
8903 bed_texture_info[btPTE].parts.push_back(pte_part2);
8904
8905 auto bed_ext = get_extents(m_shape);
8906 int bed_width = bed_ext.size()(0);
8907 int bed_height = bed_ext.size()(1);
8908 float base_width = 256;//standard 256*256 for single_extruder
8909 float base_height = 256;
8910 if (use_double_extruder_texture) { // standard 350*325 for double_extruder
8911 base_width = bed_width;
8912 base_height = bed_height;
8913 }
8914 float x_rate = bed_width / base_width;
8915 float y_rate = bed_height / base_height;
8916 for (int i = 0; i < btCount; i++) {
8917 for (int j = 0; j < bed_texture_info[i].parts.size(); j++) {
8918 bed_texture_info[i].parts[j].x *= x_rate;
8919 bed_texture_info[i].parts[j].y *= y_rate;
8920 bed_texture_info[i].parts[j].w *= x_rate;
8921 bed_texture_info[i].parts[j].h *= y_rate;
8922 bed_texture_info[i].parts[j].update_buffer();
8923 }
8924 }
8925}
BedTextureInfo bed_texture_info[btCount]
Definition PartPlate.hpp:1170
std::map< int, bool > m_allow_bed_type_in_double_nozzle
Definition PartPlate.hpp:1169
@ btPEI
Definition PrintConfig.hpp:511
@ btEP
Definition PrintConfig.hpp:510
@ btPC
Definition PrintConfig.hpp:509
@ btSuperTack
Definition PrintConfig.hpp:514
@ btPTE
Definition PrintConfig.hpp:512
@ btPCT
Definition PrintConfig.hpp:513
@ btCount
Definition PrintConfig.hpp:515
BoundingBox get_extents(const ExPolygonsWithIds &e)
Definition Emboss.cpp:1374

References bed_texture_info, Slic3r::btCount, Slic3r::btEP, Slic3r::btPC, Slic3r::btPCT, Slic3r::btPEI, Slic3r::btPTE, Slic3r::btSuperTack, Slic3r::get_extents(), m_allow_bed_type_in_double_nozzle, m_shape, Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::update_file(), and Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::update_pos().

Referenced by load_next_bedtype_texture().

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

◆ init_cali_texture_info()

void Slic3r::GUI::PartPlateList::init_cali_texture_info ( )
9132{
9133 BedTextureInfo::TexturePart cali_line(18, 2, 224, 16, "bbl_cali_lines.svg");
9134 cali_texture_info.parts.push_back(cali_line);
9135
9136 for (int j = 0; j < cali_texture_info.parts.size(); j++) {
9137 cali_texture_info.parts[j].update_buffer();
9138 }
9139}
BedTextureInfo cali_texture_info
Definition PartPlate.hpp:1171

References cali_texture_info.

Referenced by load_next_cali_texture().

Here is the caller graph for this function:

◆ init_extruder_only_area_info()

bool Slic3r::GUI::PartPlateList::init_extruder_only_area_info ( )
8962{
8963 Rect left_only_rect, right_only_rect;
8964 auto ok = calc_extruder_only_area(left_only_rect, right_only_rect);
8965 if (!ok) { return false; }
8966 float base_width = 25.f;
8967 float base_height = 320.f;
8968 float left_x_rate = left_only_rect.w / base_width;
8969 float left_y_rate = left_only_rect.h / base_height;
8970 bool is_zh = wxGetApp().app_config->get("language") == "zh_CN";
8971 Vec4f base_left(-6.f, -75.f, 12.f, 150.f);
8972 if (is_zh) {
8973 base_left = Vec4f(-5.5f, -76.f, 12.f, 150.f);
8974 }
8975 base_left[0] = base_left[0] * left_x_rate + left_only_rect.x + left_only_rect.w / 2.f;
8976 base_left[1] = base_left[1] * left_y_rate + left_only_rect.y + left_only_rect.h / 2.f;
8977 base_left[2] = base_left[2] * left_x_rate;
8978 base_left[3] = base_left[3] * left_y_rate;
8979 Vec4f base_right(-5.5f, -75.f, 12.f, 150.f);
8980 if (is_zh) {
8981 base_right = Vec4f(-4.5f, -76.f, 12.f, 150.f);
8982 }
8983 float right_x_rate = right_only_rect.w / base_width;
8984 float right_y_rate = right_only_rect.h / base_height;
8985 base_right[0] = base_right[0] * right_x_rate + right_only_rect.x + right_only_rect.w / 2.f;
8986 base_right[1] = base_right[1] * right_y_rate + right_only_rect.y + right_only_rect.h / 2.f;
8987 base_right[2] = base_right[2] * right_x_rate;
8988 base_right[3] = base_right[3] * right_y_rate;
8989 BedTextureInfo::TexturePart left_part(base_left[0], base_left[1], base_left[2], base_left[3], "left_extruder_only_area.svg");
8990 BedTextureInfo::TexturePart left_ch_part(base_left[0], base_left[1], base_left[2], base_left[3], "left_extruder_only_area_ch.svg");
8991 BedTextureInfo::TexturePart right_part(base_right[0], base_right[1], base_right[2], base_right[3], "right_extruder_only_area.svg");
8992 BedTextureInfo::TexturePart right_ch_part(base_right[0], base_right[1], base_right[2], base_right[3], "right_extruder_only_area_ch.svg");
8993
8994 for (size_t i = 0; i < (unsigned char) ExtruderOnlyAreaType::btAreaCount; i++) {
8995 extruder_only_area_info[i].reset();
8996 extruder_only_area_info[i].parts.clear();
8997 }
8998 extruder_only_area_info[(unsigned char) ExtruderOnlyAreaType::Engilish].parts.push_back(left_part);
8999 if (base_right[2]>5) {//width should >5
9000 extruder_only_area_info[(unsigned char) ExtruderOnlyAreaType::Engilish].parts.push_back(right_part);
9001 }
9002 extruder_only_area_info[(unsigned char) ExtruderOnlyAreaType::Chinese].parts.push_back(left_ch_part);
9003 if (base_right[2] > 5) { // width should >5
9004 extruder_only_area_info[(unsigned char) ExtruderOnlyAreaType::Chinese].parts.push_back(right_ch_part);
9005 }
9006
9007 for (int i = 0; i < (unsigned char) ExtruderOnlyAreaType::btAreaCount; i++) {
9008 for (int j = 0; j < extruder_only_area_info[i].parts.size(); j++) {
9009 extruder_only_area_info[i].parts[j].update_buffer();
9010 }
9011 }
9012 return true;
9013}
BedTextureInfo extruder_only_area_info[(unsigned char) Slic3r::ExtruderOnlyAreaType::btAreaCount]
Definition PartPlate.hpp:1172
bool calc_extruder_only_area(Rect &left_only_rect, Rect &right_only_rect)
Definition PartPlate.cpp:8927
Eigen::Matrix< float, 4, 1, Eigen::DontAlign > Vec4f
Definition Point.hpp:66
@ Chinese
Definition PrintConfig.hpp:521
@ Engilish
Definition PrintConfig.hpp:520
@ btAreaCount
Definition PrintConfig.hpp:522

References Slic3r::btAreaCount, calc_extruder_only_area(), Slic3r::Chinese, Slic3r::Engilish, extruder_only_area_info, Slic3r::GUI::PartPlateList::Rect::h, Slic3r::GUI::PartPlateList::BedTextureInfo::parts, Slic3r::GUI::PartPlateList::Rect::w, Slic3r::GUI::PartPlateList::Rect::x, and Slic3r::GUI::PartPlateList::Rect::y.

Referenced by load_next_extruder_only_area_texture().

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

◆ intersects()

bool Slic3r::GUI::PartPlateList::intersects ( const BoundingBoxf3 & bb)
7002{
7003 bool result = false;
7004 std::vector<PartPlate*>::iterator it = m_plate_list.begin();
7005 for (it = m_plate_list.begin(); it != m_plate_list.end(); it++) {
7006 if ((*it)->intersects(bb)) {
7007 result = true;
7008 }
7009 }
7010 return result;
7011}

References m_plate_list.

◆ invalid_all_slice_result()

void Slic3r::GUI::PartPlateList::invalid_all_slice_result ( )
8138{
8139 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": plates count %1%") % m_plate_list.size();
8140 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8141 {
8142 m_plate_list[i]->update_slice_result_valid_state(false);
8143 }
8144
8145 return;
8146}

References m_plate_list.

◆ invalidate_all_imex_ghosts()

void Slic3r::GUI::PartPlateList::invalidate_all_imex_ghosts ( )
7052{
7053 for (PartPlate* p : m_plate_list)
7054 if (p) p->invalidate_imex_ghosts();
7055}

References m_plate_list, and PartPlate.

Here is the call graph for this function:

◆ invalidate_exclusion_volume_previews()

void Slic3r::GUI::PartPlateList::invalidate_exclusion_volume_previews ( )
6529{
6530 for (PartPlate *plate : m_plate_list)
6531 if (plate != nullptr)
6532 plate->invalidate_exclusion_volume_preview();
6533}

References m_plate_list, and PartPlate.

Here is the call graph for this function:

◆ is_all_plates_ready_for_slice()

bool Slic3r::GUI::PartPlateList::is_all_plates_ready_for_slice ( ) const
8208{
8209 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8210 {
8211 if (m_plate_list[i]->can_slice())
8212 return true;
8213 }
8214 return false;
8215}

References m_plate_list.

◆ is_all_slice_result_ready_for_export()

bool Slic3r::GUI::PartPlateList::is_all_slice_result_ready_for_export ( ) const
8183{
8184 bool res = false;
8185
8186 for (unsigned int i = 0; i < (unsigned int) m_plate_list.size(); ++i) {
8187 if (!m_plate_list[i]->empty()) {
8188 if (m_plate_list[i]->is_all_instances_unprintable()) {
8189 continue;
8190 }
8191 if (!m_plate_list[i]->is_slice_result_ready_for_print()) {
8192 return false;
8193 }
8194 }
8195 if (m_plate_list[i]->is_slice_result_ready_for_print()) {
8196 if (!m_plate_list[i]->has_printable_instances()) {
8197 return false;
8198 }
8199 res = true;
8200 }
8201 }
8202
8203 return res;
8204}
bool empty(const BoundingBoxBase< PointType, PointsType > &bb)
Definition BoundingBox.hpp:273

References Slic3r::empty(), and m_plate_list.

Referenced by Slic3r::GUI::MainFrame::get_enable_print_status().

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

◆ is_all_slice_results_ready_for_print()

bool Slic3r::GUI::PartPlateList::is_all_slice_results_ready_for_print ( ) const
8161{
8162 bool res = false;
8163
8164 for (unsigned int i = 0; i < (unsigned int) m_plate_list.size(); ++i) {
8165 if (!m_plate_list[i]->empty()) {
8166 if (m_plate_list[i]->is_all_instances_unprintable()) {
8167 continue;
8168 }
8169 if (!m_plate_list[i]->is_slice_result_ready_for_print()) {
8170 return false;
8171 }
8172 }
8173 if (m_plate_list[i]->is_slice_result_ready_for_print()) {
8174 res = true;
8175 }
8176 }
8177
8178 return res;
8179}

References Slic3r::empty(), and m_plate_list.

Referenced by Slic3r::GUI::MainFrame::can_export_all_gcode(), and Slic3r::GUI::MainFrame::get_enable_print_status().

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

◆ is_all_slice_results_valid()

bool Slic3r::GUI::PartPlateList::is_all_slice_results_valid ( ) const
8150{
8151 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8152 {
8153 if (!m_plate_list[i]->is_slice_result_valid())
8154 return false;
8155 }
8156 return true;
8157}

References m_plate_list.

◆ is_locked()

bool Slic3r::GUI::PartPlateList::is_locked ( int index)
inline
1007{ return m_plate_list[index]->is_locked();}

References m_plate_list.

Referenced by Slic3r::GUI::anonymous_namespace{NativeCommands.cpp}::build_command_catalog(), postprocess_bed_index_for_selected(), postprocess_bed_index_for_unselected(), Slic3r::GUI::OrientJob::prepare_selection(), preprocess_arrange_polygon(), and rebuild_plates_after_arrangement().

Here is the caller graph for this function:

◆ load_and_construct()

template<class Archive>
void Slic3r::ObjectBase::load_and_construct ( Archive & ar,
cereal::construct< ObjectBase > & construct )
inlinestaticprivateinherited
109{ ObjectID id; ar(id); construct(id); }
ObjectID id() const
Definition ObjectID.hpp:69

References id().

Here is the call graph for this function:

◆ load_bedtype_textures()

void Slic3r::GUI::PartPlateList::load_bedtype_textures ( )
9046{
9047 while (load_next_bedtype_texture()) {}
9048}
bool load_next_bedtype_texture()
Definition PartPlate.cpp:9050

References load_next_bedtype_texture().

Here is the call graph for this function:

◆ load_cali_textures()

void Slic3r::GUI::PartPlateList::load_cali_textures ( )
9142{
9143 while (load_next_cali_texture()) {}
9144}
bool load_next_cali_texture()
Definition PartPlate.cpp:9146

References load_next_cali_texture().

Here is the call graph for this function:

◆ load_extruder_only_area_textures()

void Slic3r::GUI::PartPlateList::load_extruder_only_area_textures ( )
9113{
9115}
bool load_next_extruder_only_area_texture()
Definition PartPlate.cpp:9117

References load_next_extruder_only_area_texture().

Here is the call graph for this function:

◆ load_from_3mf_structure()

int Slic3r::GUI::PartPlateList::load_from_3mf_structure ( PlateDataPtrs & plate_data_list,
int filament_count = 1 )
8509{
8510 int ret = 0;
8511
8512 if (plate_data_list.size() <= 0)
8513 {
8514 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":no plates, should not happen!");
8515 return -1;
8516 }
8517 clear(true, true);
8518 set_filament_count(filament_count);
8519 for (unsigned int i = 0; i < (unsigned int)plate_data_list.size(); ++i)
8520 {
8521 int index = create_plate(false);
8522 m_plate_list[index]->m_locked = plate_data_list[i]->locked;
8523 m_plate_list[index]->config()->apply(plate_data_list[i]->config);
8524 m_plate_list[index]->set_plate_name(plate_data_list[i]->plate_name);
8525 if (plate_data_list[i]->plate_index != index)
8526 {
8527 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":plate index %1% seems invalid, skip it")% plate_data_list[i]->plate_index;
8528 }
8529 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1%, gcode_file %2%, is_sliced_valid %3%, toolpath_outside %4%, is_support_used %5% is_label_object_enabled %6%")
8530 %i %plate_data_list[i]->gcode_file %plate_data_list[i]->is_sliced_valid %plate_data_list[i]->toolpath_outside %plate_data_list[i]->is_support_used %plate_data_list[i]->is_label_object_enabled;
8531 //load object and instance from 3mf
8532 //just test for file correct or not, we will rebuild later
8533 /*for (std::vector<std::pair<int, int>>::iterator it = plate_data_list[i]->objects_and_instances.begin(); it != plate_data_list[i]->objects_and_instances.end(); ++it)
8534 m_plate_list[index]->obj_to_instance_set.insert(std::pair(it->first, it->second));*/
8535 if (!plate_data_list[i]->gcode_file.empty()) {
8536 m_plate_list[index]->m_gcode_path_from_3mf = plate_data_list[i]->gcode_file;
8537 }
8538 GCodeResult* gcode_result = nullptr;
8539 PrintBase* fff_print = nullptr;
8540 m_plate_list[index]->get_print(&fff_print, &gcode_result, nullptr);
8541 PrintStatistics& ps = (dynamic_cast<Print*>(fff_print))->print_statistics();
8542 gcode_result->print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time = atoi(plate_data_list[i]->gcode_prediction.c_str());
8543 ps.total_weight = atof(plate_data_list[i]->gcode_weight.c_str());
8544 ps.total_used_filament = 0.f;
8545 for (auto filament_item: plate_data_list[i]->slice_filaments_info)
8546 {
8547 ps.total_used_filament += filament_item.used_m;
8548 }
8549 ps.total_used_filament *= 1000; //koef
8550 gcode_result->toolpath_outside = plate_data_list[i]->toolpath_outside;
8551 gcode_result->label_object_enabled = plate_data_list[i]->is_label_object_enabled;
8552 gcode_result->timelapse_warning_code = plate_data_list[i]->timelapse_warning_code;
8553 m_plate_list[index]->set_timelapse_warning_code(plate_data_list[i]->timelapse_warning_code);
8554 gcode_result->filament_change_sequence = plate_data_list[i]->filament_change_sequence;
8555 gcode_result->nozzle_change_sequence = plate_data_list[i]->nozzle_change_sequence;
8556 gcode_result->optimal_assignment = plate_data_list[i]->optimal_assignment;
8557 m_plate_list[index]->slice_filaments_info = plate_data_list[i]->slice_filaments_info;
8558 gcode_result->warnings = plate_data_list[i]->warnings;
8559 gcode_result->filament_maps = plate_data_list[i]->filament_maps;
8560 gcode_result->used_mixed_filaments.clear();
8561 for (const auto &mixed_info : plate_data_list[i]->mixed_filaments_info) {
8562 if (mixed_info.id > 0)
8563 gcode_result->used_mixed_filaments.push_back(static_cast<unsigned int>(mixed_info.id - 1));
8564 }
8565 if (Print *print = dynamic_cast<Print*>(fff_print))
8566 print->set_slice_used_mixed_filaments(gcode_result->used_mixed_filaments);
8567
8568 // Reconstruct the device-side nozzle grouping from the loaded 3mf so
8569 // the monitor/preview can map filaments to physical nozzles.
8570 // load_nozzle_infos_with_compatibility handles older single-nozzle 3mf (no <nozzle> tags) by
8571 // falling back to the per-filament group_id, then to the extruder volume types / nozzle diameters.
8572 {
8573 // nozzle_volume_types is space-separated ints; nozzle_diameters is comma/space-separated floats.
8574 auto parse_int_tokens = [](const std::string& str) -> std::vector<int> {
8575 std::vector<int> out;
8576 std::istringstream iss(str);
8577 std::string tok;
8578 while (iss >> tok) { try { out.push_back(std::stoi(tok)); } catch (...) {} }
8579 return out;
8580 };
8581 auto parse_double_tokens = [](const std::string& str) -> std::vector<double> {
8582 std::vector<double> out;
8583 std::string s = str;
8584 std::replace(s.begin(), s.end(), ',', ' ');
8585 std::istringstream iss(s);
8586 std::string tok;
8587 while (iss >> tok) { try { out.push_back(std::stod(tok)); } catch (...) {} }
8588 return out;
8589 };
8590
8591 std::vector<int> nozzle_volume_type_values = parse_int_tokens(plate_data_list[i]->nozzle_volume_types);
8592 std::vector<double> nozzle_diameter_values = parse_double_tokens(plate_data_list[i]->nozzle_diameters);
8593
8594 std::vector<NozzleVolumeType> extruder_volume_types(nozzle_volume_type_values.size(), NozzleVolumeType::nvtStandard);
8595 for (size_t idx = 0; idx < nozzle_volume_type_values.size(); ++idx)
8596 if (nozzle_volume_type_values[idx] >= 0 && nozzle_volume_type_values[idx] <= nvtMaxNozzleVolumeType)
8597 extruder_volume_types[idx] = static_cast<NozzleVolumeType>(nozzle_volume_type_values[idx]);
8598
8600 plate_data_list[i]->nozzles_info,
8601 plate_data_list[i]->slice_filaments_info,
8602 plate_data_list[i]->filament_maps,
8603 extruder_volume_types,
8604 nozzle_diameter_values);
8605
8606 std::vector<int> fil_seq(plate_data_list[i]->filament_change_sequence.begin(), plate_data_list[i]->filament_change_sequence.end());
8607 std::vector<int> noz_seq(plate_data_list[i]->nozzle_change_sequence.begin(), plate_data_list[i]->nozzle_change_sequence.end());
8608 bool enable_filament_dynamic_map = false;
8609 if (plate_data_list[i]->config.has("enable_filament_dynamic_map"))
8610 enable_filament_dynamic_map = plate_data_list[i]->config.option<ConfigOptionBool>("enable_filament_dynamic_map")->value;
8611
8613 plate_data_list[i]->slice_filaments_info, nozzle_infos, fil_seq, noz_seq, enable_filament_dynamic_map);
8614 if (group_result)
8615 gcode_result->nozzle_group_result = std::make_shared<MultiNozzleUtils::StaticNozzleGroupResult>(group_result.value());
8616 else
8617 gcode_result->nozzle_group_result = nullptr;
8618 }
8619 if (m_plater && !plate_data_list[i]->thumbnail_file.empty()) {
8620 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1%, load thumbnail from %2%.")%(i+1) %plate_data_list[i]->thumbnail_file;
8621 if (boost::filesystem::exists(plate_data_list[i]->thumbnail_file)) {
8622 m_plate_list[index]->load_thumbnail_data(plate_data_list[i]->thumbnail_file, m_plate_list[index]->thumbnail_data);
8623 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ <<boost::format(": plate %1% after load, width %2%, height %3%, size %4%!")
8624 %(i+1) %m_plate_list[index]->thumbnail_data.width %m_plate_list[index]->thumbnail_data.height %m_plate_list[index]->thumbnail_data.pixels.size();
8625 }
8626 }
8627
8628 if (m_plater && !plate_data_list[i]->no_light_thumbnail_file.empty()) {
8629 if (boost::filesystem::exists(plate_data_list[i]->no_light_thumbnail_file)) {
8630 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1%, load no_light_thumbnail_file from %2%.")%(i+1) %plate_data_list[i]->no_light_thumbnail_file;
8631 m_plate_list[index]->load_thumbnail_data(plate_data_list[i]->no_light_thumbnail_file, m_plate_list[index]->no_light_thumbnail_data);
8632 }
8633 }
8634
8635 /*if (m_plater && !plate_data_list[i]->pattern_file.empty()) {
8636 if (boost::filesystem::exists(plate_data_list[i]->pattern_file)) {
8637 //no need to load pattern data currently
8638 //m_plate_list[index]->load_pattern_thumbnail_data(plate_data_list[i]->pattern_file);
8639 }
8640 }*/
8641 if (m_plater && !plate_data_list[i]->top_file.empty()) {
8642 if (boost::filesystem::exists(plate_data_list[i]->top_file)) {
8643 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1%, load top_thumbnail from %2%.")%(i+1) %plate_data_list[i]->top_file;
8644 m_plate_list[index]->load_thumbnail_data(plate_data_list[i]->top_file, m_plate_list[index]->top_thumbnail_data);
8645 }
8646 }
8647 if (m_plater && !plate_data_list[i]->pick_file.empty()) {
8648 if (boost::filesystem::exists(plate_data_list[i]->pick_file)) {
8649 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1%, load pick_thumbnail from %2%.")%(i+1) %plate_data_list[i]->pick_file;
8650 m_plate_list[index]->load_thumbnail_data(plate_data_list[i]->pick_file, m_plate_list[index]->pick_thumbnail_data);
8651 }
8652 }
8653 if (m_plater && !plate_data_list[i]->pattern_bbox_file.empty()) {
8654 if (boost::filesystem::exists(plate_data_list[i]->pattern_bbox_file)) {
8655 m_plate_list[index]->load_pattern_box_data(plate_data_list[i]->pattern_bbox_file);
8656 }
8657 }
8658
8659 }
8660 print();
8661 ret = reload_all_objects();
8662 print();
8663
8664 return ret;
8665}
void set_filament_count(int filament_count)
Definition PartPlate.cpp:9173
static std::optional< StaticNozzleGroupResult > create(const std::vector< FilamentInfo > &filaments_info, const std::vector< NozzleInfo > &nozzles_info, const std::vector< int > &filament_change_seq, const std::vector< int > &nozzle_change_seq, bool support_dynamic_map)
Definition MultiNozzleUtils.cpp:735
std::vector< NozzleInfo > load_nozzle_infos_with_compatibility(const std::vector< NozzleInfo > &nozzle_infos, const std::vector< FilamentInfo > &filament_infos, const std::vector< int > &filament_map, const std::vector< NozzleVolumeType > &extruder_volume_types, const std::vector< double > &nozzle_diameter)
Definition MultiNozzleUtils.cpp:900
NozzleVolumeType
Definition PrintConfig.hpp:618
@ nvtMaxNozzleVolumeType
Definition PrintConfig.hpp:629
@ nvtStandard
Definition PrintConfig.hpp:619
@ Normal
Definition GCodeProcessor.hpp:89

References clear(), Slic3r::MultiNozzleUtils::StaticNozzleGroupResult::create(), create_plate(), Slic3r::GCodeProcessorResult::filament_change_sequence, Slic3r::GCodeProcessorResult::filament_maps, Slic3r::GCodeProcessorResult::label_object_enabled, Slic3r::MultiNozzleUtils::load_nozzle_infos_with_compatibility(), m_plate_list, m_plater, Slic3r::PrintEstimatedStatistics::modes, Slic3r::PrintEstimatedStatistics::Normal, Slic3r::GCodeProcessorResult::nozzle_change_sequence, Slic3r::GCodeProcessorResult::nozzle_group_result, Slic3r::nvtMaxNozzleVolumeType, Slic3r::nvtStandard, Slic3r::GCodeProcessorResult::optimal_assignment, print(), Slic3r::GCodeProcessorResult::print_statistics, reload_all_objects(), set_filament_count(), Slic3r::GCodeProcessorResult::timelapse_warning_code, Slic3r::GCodeProcessorResult::toolpath_outside, Slic3r::PrintStatistics::total_used_filament, Slic3r::PrintStatistics::total_weight, Slic3r::GCodeProcessorResult::used_mixed_filaments, Slic3r::ConfigOptionSingle< T >::value, and Slic3r::GCodeProcessorResult::warnings.

Referenced by Slic3r::CLI::run().

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

◆ load_gcode_files()

int Slic3r::GUI::PartPlateList::load_gcode_files ( )
8669{
8670 int ret = 0;
8671
8672 //only do this while m_plater valid for gui mode
8673 if (!m_plater)
8674 return ret;
8675
8676 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8677 {
8678 if (!m_plate_list[i]->m_gcode_path_from_3mf.empty()) {
8679 //the same as plater::priv::update_print_volume_state();
8680 //BoundingBoxf3 print_volume = m_plate_list[i]->get_bounding_box(false);
8681 //print_volume.max(2) = this->m_plate_height;
8682 //print_volume.min(2) = -1e10;
8683 m_model->update_print_volume_state({m_plate_list[i]->get_shape(), this->m_plate_height, m_plate_list[i]->get_extruder_areas(), m_plate_list[i]->get_extruder_heights() });
8684
8685 if (!m_plate_list[i]->load_gcode_from_file(m_plate_list[i]->m_gcode_path_from_3mf))
8686 ret ++;
8687 }
8688 }
8689
8690 BOOST_LOG_TRIVIAL(trace) << boost::format("totally got %1% gcode files") % ret;
8691
8692 return ret;
8693}
void trace(unsigned int level, const char *message)
Definition utils.cpp:247

References m_model, m_plate_height, m_plate_list, m_plater, and Slic3r::trace().

Here is the call graph for this function:

◆ load_icon_textures()

void Slic3r::GUI::PartPlateList::load_icon_textures ( )
9098{
9099 if (!icon_textures_loaded())
9101}
void generate_icon_textures()
Definition PartPlate.cpp:6046
bool icon_textures_loaded() const
Definition PartPlate.hpp:1155

References generate_icon_textures(), and icon_textures_loaded().

Referenced by render().

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

◆ load_logo_texture()

bool Slic3r::GUI::PartPlateList::load_logo_texture ( )
9063{
9064 if (m_logo_texture_filename.empty()) {
9065 m_logo_texture.reset();
9066 return false;
9067 }
9068
9069 if (m_logo_texture.get_id() != 0 && m_logo_texture.get_source() == m_logo_texture_filename) {
9070 if (m_logo_texture.unsent_compressed_data_available())
9071 // sends to gpu the already available compressed levels of the main texture
9072 m_logo_texture.send_compressed_data_to_gpu();
9073 return true;
9074 }
9075
9076 m_logo_texture.reset();
9077 // starts generating the main texture, compression will run asynchronously
9078 if (boost::algorithm::iends_with(m_logo_texture_filename, ".svg")) {
9079 if (!m_logo_texture.load_from_svg_file(m_logo_texture_filename, true, true, true, logo_texture_size())) {
9080 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": load logo texture from %1% failed!") % m_logo_texture_filename;
9081 return false;
9082 }
9083 }
9084 else if (boost::algorithm::iends_with(m_logo_texture_filename, ".png")) {
9085 if (!m_logo_texture.load_from_file(m_logo_texture_filename, true, GLTexture::MultiThreaded, true)) {
9086 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": load logo texture from %1% failed!") % m_logo_texture_filename;
9087 return false;
9088 }
9089 }
9090 else {
9091 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": can not load logo texture from %1%, unsupported format") % m_logo_texture_filename;
9092 return false;
9093 }
9094 return true;
9095}
@ MultiThreaded
Definition GLTexture.hpp:74
GLTexture m_logo_texture
Definition PartPlate.hpp:800
static GLint logo_texture_size()
Definition PartPlate.cpp:9015

References Slic3r::GUI::logo_texture_size(), m_logo_texture, m_logo_texture_filename, and Slic3r::GUI::GLTexture::MultiThreaded.

Referenced by load_next_plate_texture().

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

◆ load_next_bedtype_texture()

bool Slic3r::GUI::PartPlateList::load_next_bedtype_texture ( )
9051{
9053 return false;
9054 if (m_next_bedtype_texture == 0)
9057 return true;
9059 return false;
9060}
void init_bed_type_info()
Definition PartPlate.cpp:8762
size_t m_next_bedtype_texture
Definition PartPlate.hpp:1177
static bool is_load_bedtype_textures
Definition PartPlate.hpp:895
static bool load_next_part_texture(PartPlateList::BedTextureInfo *infos, size_t count, size_t &next, bool compress_and_filter)
Definition PartPlate.cpp:9022

References bed_texture_info, Slic3r::btCount, init_bed_type_info(), is_load_bedtype_textures, Slic3r::GUI::load_next_part_texture(), and m_next_bedtype_texture.

Referenced by load_bedtype_textures(), and load_next_plate_texture().

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

◆ load_next_cali_texture()

bool Slic3r::GUI::PartPlateList::load_next_cali_texture ( )
9147{
9149 return false;
9150 if (m_next_cali_texture == 0)
9153 return true;
9155 return false;
9156}
size_t m_next_cali_texture
Definition PartPlate.hpp:1178
static bool is_load_cali_texture
Definition PartPlate.hpp:896
void init_cali_texture_info()
Definition PartPlate.cpp:9131

References cali_texture_info, init_cali_texture_info(), is_load_cali_texture, Slic3r::GUI::load_next_part_texture(), and m_next_cali_texture.

Referenced by load_cali_textures(), and load_next_plate_texture().

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

◆ load_next_extruder_only_area_texture()

bool Slic3r::GUI::PartPlateList::load_next_extruder_only_area_texture ( )
9118{
9120 return false;
9123 return false;
9124 }
9126 return true;
9128 return false;
9129}
static bool is_load_extruder_only_area_textures
Definition PartPlate.hpp:897
size_t m_next_extruder_only_area_texture
Definition PartPlate.hpp:1179
bool init_extruder_only_area_info()
Definition PartPlate.cpp:8961

References Slic3r::btAreaCount, extruder_only_area_info, init_extruder_only_area_info(), is_load_extruder_only_area_textures, Slic3r::GUI::load_next_part_texture(), and m_next_extruder_only_area_texture.

Referenced by load_extruder_only_area_textures(), and load_next_plate_texture().

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

◆ load_next_plate_texture()

bool Slic3r::GUI::PartPlateList::load_next_plate_texture ( )
9104{
9105 if (!render_bedtype_logo) {
9107 return false;
9108 }
9110}
bool load_logo_texture()
Definition PartPlate.cpp:9062
bool render_bedtype_logo
Definition PartPlate.hpp:826

References load_logo_texture(), load_next_bedtype_texture(), load_next_cali_texture(), load_next_extruder_only_area_texture(), and render_bedtype_logo.

Here is the call graph for this function:

◆ lock_plate()

int Slic3r::GUI::PartPlateList::lock_plate ( int index,
bool state )
7137{
7138 int ret = 0;
7139 PartPlate* plate = NULL;
7140
7141 plate = get_plate(index);
7142 if (!plate)
7143 {
7144 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":can not get plate for index %1%, size %2%") % index % m_plate_list.size();
7145 return -1;
7146 }
7147 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":lock plate %1%, to state %2%") % index % state;
7148
7149 plate->lock(state);
7150
7151 return ret;
7152}

References get_plate(), Slic3r::GUI::PartPlate::lock(), m_plate_list, and PartPlate.

Referenced by Slic3r::GUI::anonymous_namespace{NativeCommands.cpp}::build_command_catalog(), and Slic3r::CLI::run().

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

◆ move_plate_to_index()

int Slic3r::GUI::PartPlateList::move_plate_to_index ( int old_index,
int new_index )
7091{
7092 int ret = 0, delta;
7093 Vec3d origin;
7094
7095
7096 if (old_index == new_index)
7097 {
7098 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(":should not happen, the same index %1%") % old_index;
7099 return -1;
7100 }
7101
7102 // Orca: Rebuild plate membership before moving the plates.
7104
7105 if (old_index < new_index)
7106 {
7107 delta = 1;
7108 }
7109 else
7110 {
7111 delta = -1;
7112 }
7113
7114 PartPlate* plate = m_plate_list[old_index];
7115 //update the plates between old_index and new_index
7116 for (unsigned int i = (unsigned int)old_index; i != (unsigned int)new_index; i = i + delta)
7117 {
7118 m_plate_list[i] = m_plate_list[i + delta];
7119 m_plate_list[i]->set_index(i);
7120
7121 origin = compute_origin(i, m_plate_cols);
7122 m_plate_list[i]->set_pos_and_size(origin, m_plate_width, m_plate_depth, m_plate_height, true);
7123 }
7124 origin = compute_origin(new_index, m_plate_cols);
7125 m_plate_list[new_index] = plate;
7126 plate->set_index(new_index);
7127 plate->set_pos_and_size(origin, m_plate_width, m_plate_depth, m_plate_height, true);
7128
7129 //update the new plate index
7130 m_current_plate = new_index;
7131
7132 return ret;
7133}

References compute_origin(), m_current_plate, m_plate_cols, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, PartPlate, reload_all_objects(), Slic3r::GUI::PartPlate::set_index(), and Slic3r::GUI::PartPlate::set_pos_and_size().

Here is the call graph for this function:

◆ notify_instance_removed()

int Slic3r::GUI::PartPlateList::notify_instance_removed ( int obj_id,
int instance_id )
7373{
7374 int ret = 0, index, instance_to_delete = instance_id;
7375 PartPlate* plate = NULL;
7376
7377 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_id % instance_id;
7378 if (instance_id == -1) {
7379 instance_to_delete = 0;
7380 }
7381 index = find_instance(obj_id, instance_to_delete);
7382 if (index != -1)
7383 {
7384 //found it added before
7385 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in plate %1%, remove it") % index;
7386 plate = m_plate_list[index];
7387 plate->remove_instance(obj_id, instance_to_delete);
7388 plate->update_slice_result_valid_state();
7389 plate->thumbnail_data.reset();
7390 plate->no_light_thumbnail_data.reset();
7391 plate->top_thumbnail_data.reset();
7392 plate->pick_thumbnail_data.reset();
7393 }
7394
7395 if (unprintable_plate.contain_instance(obj_id, instance_to_delete))
7396 {
7397 //found in unprintable plate, add it to plate
7398 unprintable_plate.remove_instance(obj_id, instance_to_delete);
7399 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in unprintable plate, remove it");
7400 }
7401
7402 if (instance_id == -1) {
7403 //update all the obj_ids which is bigger
7404 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7405 {
7406 PartPlate* plate = m_plate_list[i];
7407 assert(plate != NULL);
7408
7409 plate->update_object_index(obj_id, m_model->objects.size());
7410 }
7411 unprintable_plate.update_object_index(obj_id, m_model->objects.size());
7412 }
7413
7414 if (m_plater)
7415 m_plater->mark_plate_toolbar_image_dirty();
7416
7417 return 0;
7418}

References find_instance(), m_model, m_plate_list, m_plater, Slic3r::GUI::PartPlate::no_light_thumbnail_data, PartPlate, Slic3r::GUI::PartPlate::pick_thumbnail_data, Slic3r::GUI::PartPlate::remove_instance(), Slic3r::ThumbnailData::reset(), Slic3r::GUI::PartPlate::thumbnail_data, Slic3r::GUI::PartPlate::top_thumbnail_data, unprintable_plate, Slic3r::GUI::PartPlate::update_object_index(), and Slic3r::GUI::PartPlate::update_slice_result_valid_state().

Referenced by Slic3r::GUI::ensure_belt_purge_tower().

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

◆ notify_instance_update()

int Slic3r::GUI::PartPlateList::notify_instance_update ( int obj_id,
int instance_id,
bool is_new = false )
7238{
7239 int ret = 0, index;
7240 PartPlate* plate = NULL;
7241 ModelObject* object = NULL;
7242
7243 if ((obj_id >= 0) && (obj_id < m_model->objects.size()))
7244 {
7245 object = m_model->objects[obj_id];
7246 }
7247 else if (obj_id >= 1000 && obj_id < 1000 + m_plate_count) {
7248 //wipe tower updates
7249 PartPlate* plate = m_plate_list[obj_id - 1000];
7250 plate->update_slice_result_valid_state( false );
7251 plate->thumbnail_data.reset();
7252 plate->no_light_thumbnail_data.reset();
7253 plate->top_thumbnail_data.reset();
7254 plate->pick_thumbnail_data.reset();
7255
7256 return 0;
7257 }
7258 else
7259 return -1;
7260
7261 BoundingBoxf3 boundingbox = object->instance_convex_hull_bounding_box(instance_id);
7262
7263 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_id % instance_id;
7264 index = find_instance(obj_id, instance_id);
7265 if (index != -1)
7266 {
7267 //found it added before
7268 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in previous plate %1%") % index;
7269 plate = m_plate_list[index];
7270 if (!plate->intersect_instance(obj_id, instance_id, &boundingbox))
7271 {
7272 //not include anymore, remove it from original plate
7273 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": not in plate %1% anymore, remove it") % index;
7274 plate->remove_instance(obj_id, instance_id);
7275 }
7276 else
7277 {
7278 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": still in original plate %1%, no need to be updated") % index;
7279 plate->update_instance_exclude_status(obj_id, instance_id, &boundingbox);
7280 plate->update_states();
7281 plate->update_slice_result_valid_state();
7282 plate->thumbnail_data.reset();
7283 plate->no_light_thumbnail_data.reset();
7284 plate->top_thumbnail_data.reset();
7285 plate->pick_thumbnail_data.reset();
7286 return 0;
7287 }
7288 plate->update_slice_result_valid_state();
7289 plate->thumbnail_data.reset();
7290 plate->no_light_thumbnail_data.reset();
7291 plate->top_thumbnail_data.reset();
7292 plate->pick_thumbnail_data.reset();
7293 }
7294 else if (unprintable_plate.contain_instance(obj_id, instance_id))
7295 {
7296 //found it in the unprintable plate
7297 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in unprintable plate");
7298 if (!unprintable_plate.intersect_instance(obj_id, instance_id, &boundingbox))
7299 {
7300 //not include anymore, remove it from original plate
7301 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": not in unprintable plate anymore, remove it");
7302 unprintable_plate.remove_instance(obj_id, instance_id);
7303 }
7304 else
7305 {
7306 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": still in unprintable plate, no need to be updated");
7307 return 0;
7308 }
7309 }
7310
7311 auto is_object_config_compatible_with_spiral_vase = [](ModelObject* object) {
7312 const DynamicPrintConfig& config = object->config.get();
7313 if (config.has("wall_loops") && config.opt_int("wall_loops") == 1 &&
7314 config.has("top_shell_layers") && config.opt_int("top_shell_layers") == 0 &&
7315 config.has("sparse_infill_density") && config.option<ConfigOptionPercent>("sparse_infill_density")->value == 0 &&
7316 config.has("enable_support") && !config.opt_bool("enable_support") &&
7317 config.has("enforce_support_layers") && config.opt_int("enforce_support_layers") == 0 &&
7318 config.has("ensure_vertical_shell_thickness") && config.opt_bool("ensure_vertical_shell_thickness") &&
7319 config.has("detect_thin_wall") && !config.opt_bool("detect_thin_wall") &&
7320 config.has("timelapse_type") && config.opt_enum<TimelapseType>("timelapse_type") == TimelapseType::tlTraditional)
7321 return true;
7322 else
7323 return false;
7324 };
7325
7326 //try to find a new plate
7327 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7328 {
7329 PartPlate* plate = m_plate_list[i];
7330 assert(plate != NULL);
7331
7332 if (plate->intersect_instance(obj_id, instance_id, &boundingbox))
7333 {
7334 //found a new plate, add it to plate
7335 plate->add_instance(obj_id, instance_id, false, &boundingbox);
7336
7337 // spiral mode, update object setting
7338 if (plate->config()->has("spiral_mode") && plate->config()->opt_bool("spiral_mode") && !is_object_config_compatible_with_spiral_vase(object)) {
7339 if (!is_new) {
7340 auto answer = static_cast<TabPrintPlate*>(wxGetApp().plate_tab)->show_spiral_mode_settings_dialog(true);
7341 if (answer == wxID_YES) {
7342 plate->set_vase_mode_related_object_config(obj_id);
7343 }
7344 }
7345 else {
7346 plate->set_vase_mode_related_object_config(obj_id);
7347 }
7348 }
7349
7350 plate->update_slice_result_valid_state();
7351 plate->thumbnail_data.reset();
7352 plate->no_light_thumbnail_data.reset();
7353 plate->top_thumbnail_data.reset();
7354 plate->pick_thumbnail_data.reset();
7355 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": add it to new plate %1%") % i;
7356 return 0;
7357 }
7358 }
7359
7360 if (unprintable_plate.intersect_instance(obj_id, instance_id, &boundingbox))
7361 {
7362 //found in unprintable plate, add it to plate
7363 unprintable_plate.add_instance(obj_id, instance_id, false, &boundingbox);
7364 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": add it to unprintable plate");
7365 return 0;
7366 }
7367
7368 return 0;
7369}
TimelapseType
Definition PrintConfig.hpp:468
@ tlTraditional
Definition PrintConfig.hpp:469

References Slic3r::GUI::PartPlate::add_instance(), Slic3r::GUI::PartPlate::config(), find_instance(), Slic3r::ConfigOptionResolver::has(), Slic3r::GUI::PartPlate::intersect_instance(), m_model, m_plate_count, m_plate_list, Slic3r::GUI::PartPlate::no_light_thumbnail_data, Slic3r::DynamicConfig::opt_bool(), Slic3r::DynamicConfig::opt_enum(), Slic3r::DynamicConfig::opt_int(), Slic3r::ConfigBase::option(), PartPlate, Slic3r::GUI::PartPlate::pick_thumbnail_data, Slic3r::GUI::PartPlate::remove_instance(), Slic3r::ThumbnailData::reset(), Slic3r::GUI::PartPlate::set_vase_mode_related_object_config(), Slic3r::GUI::PartPlate::thumbnail_data, Slic3r::tlTraditional, Slic3r::GUI::PartPlate::top_thumbnail_data, unprintable_plate, Slic3r::GUI::PartPlate::update_instance_exclude_status(), Slic3r::GUI::PartPlate::update_slice_result_valid_state(), Slic3r::GUI::PartPlate::update_states(), and Slic3r::ConfigOptionSingle< T >::value.

Referenced by Slic3r::GUI::ObjectList::add_object_to_list(), Slic3r::GUI::GLCanvas3D::do_mirror(), Slic3r::GUI::Selection::notify_instance_update(), and Slic3r::GUI::ObjectList::notify_instance_updated().

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

◆ on_change_color_mode()

void Slic3r::GUI::PartPlateList::on_change_color_mode ( bool is_dark)
inline
1056{ m_is_dark = is_dark; }
static bool is_dark()
Definition TextureImportDialog.cpp:85

References is_dark(), and m_is_dark.

Here is the call graph for this function:

◆ on_extruder_count_changed()

void Slic3r::GUI::PartPlateList::on_extruder_count_changed ( int extruder_count)
9166{
9167 for (unsigned int i = 0; i < (unsigned int) m_plate_list.size(); ++i) {
9168 m_plate_list[i]->on_extruder_count_changed(extruder_count);
9169 }
9170 BOOST_LOG_TRIVIAL(info) << boost::format("%1%: extruder_count=%2%")% __FUNCTION__ %extruder_count;
9171}

References m_plate_list.

◆ on_filament_added()

void Slic3r::GUI::PartPlateList::on_filament_added ( int filament_count)
9184{
9186 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
9187 {
9188 m_plate_list[i]->on_filament_added();
9189 }
9190 BOOST_LOG_TRIVIAL(info) << boost::format("%1%: filament_count=%2%")% __FUNCTION__ %filament_count;
9191}

References m_filament_count, and m_plate_list.

◆ on_filament_deleted()

void Slic3r::GUI::PartPlateList::on_filament_deleted ( int filament_count,
int filament_id )
9194{
9196 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
9197 {
9198 m_plate_list[i]->on_filament_deleted(filament_count, filament_id);
9199 }
9200 BOOST_LOG_TRIVIAL(info) << boost::format("%1%: filament_count=%2%, filament_id=%3%")% __FUNCTION__ %filament_count %filament_id;
9201}

References m_filament_count, and m_plate_list.

◆ plate_stride_x()

double Slic3r::GUI::PartPlateList::plate_stride_x ( )
7026{
7027 //const auto plate_shape = Slic3r::Polygon::new_scale(m_shape);
7028 //double plate_width = plate_shape.bounding_box().size().x();
7029 //return unscaled<double>((1. + LOGICAL_PART_PLATE_GAP) * plate_width);
7030 return m_plate_width * (1. + LOGICAL_PART_PLATE_GAP);
7031}

References LOGICAL_PART_PLATE_GAP, and m_plate_width.

Referenced by compute_plate_index(), compute_shape_position(), postprocess_arrange_polygon(), preprocess_arrange_polygon(), preprocess_arrange_polygon_other_locked(), and set_shapes().

Here is the caller graph for this function:

◆ plate_stride_y()

double Slic3r::GUI::PartPlateList::plate_stride_y ( )
7034{
7035 //const auto plate_shape = Slic3r::Polygon::new_scale(m_shape);
7036 //double plate_depth = plate_shape.bounding_box().size().y();
7037 //return unscaled<double>((1. + LOGICAL_PART_PLATE_GAP) * plate_depth);
7038 return m_plate_depth * (1. + LOGICAL_PART_PLATE_GAP);
7039}

References LOGICAL_PART_PLATE_GAP, and m_plate_depth.

Referenced by compute_plate_index(), compute_shape_position(), postprocess_arrange_polygon(), preprocess_arrange_polygon(), preprocess_arrange_polygon_other_locked(), and set_shapes().

Here is the caller graph for this function:

◆ postprocess_arrange_polygon()

void Slic3r::GUI::PartPlateList::postprocess_arrange_polygon ( arrangement::ArrangePolygon & arrange_polygon,
bool selected )
7895{
7896 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": bed_idx %1%, selected %2%, translation(x) %3%, (y) %4%") % arrange_polygon.bed_idx % selected % unscale<double>(arrange_polygon.translation(X)) % unscale<double>(arrange_polygon.translation(Y));
7897
7898 // UNARRANGED means the item could not be placed, so it has no bed to map onto and
7899 // must be left where the user had it. Moving it to a virtual bed here would shift
7900 // it off the plate, because no such plate is created for it afterwards.
7901 if (arrange_polygon.bed_idx == arrangement::UNARRANGED)
7902 return;
7903
7904 if ((selected) || (arrange_polygon.bed_idx != PartPlateList::MAX_PLATES_COUNT))
7905 {
7906 arrange_polygon.row = arrange_polygon.bed_idx / m_plate_cols;
7907 arrange_polygon.col = arrange_polygon.bed_idx % m_plate_cols;
7908 arrange_polygon.translation(X) += scaled<double>(plate_stride_x() * arrange_polygon.col);
7909 arrange_polygon.translation(Y) -= scaled<double>(plate_stride_y() * arrange_polygon.row);
7910 }
7911
7912 return;
7913}
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
BoundingBox scaled(const BoundingBoxf &bb)
Definition BoundingBox.hpp:284

References Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::arrangement::ArrangePolygon::col, m_plate_cols, MAX_PLATES_COUNT, plate_stride_x(), plate_stride_y(), Slic3r::arrangement::ArrangePolygon::row, Slic3r::scaled(), Slic3r::arrangement::ArrangePolygon::translation, Slic3r::arrangement::UNARRANGED, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::GUI::ArrangeJob::finalize(), and Slic3r::CLI::run().

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

◆ postprocess_bed_index_for_current_plate()

void Slic3r::GUI::PartPlateList::postprocess_bed_index_for_current_plate ( arrangement::ArrangePolygon & arrange_polygon)
7877{
7878 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": bed_idx %1%, locked_plate %2%, translation(x) %3%, (y) %4%") % arrange_polygon.bed_idx % arrange_polygon.locked_plate % unscale<double>(arrange_polygon.translation(X)) % unscale<double>(arrange_polygon.translation(Y));
7879
7880 if (arrange_polygon.bed_idx == -1)
7881 {
7882 //outarea for large object
7883 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": can not be arranged inside plate!");
7884 }
7885 else if (arrange_polygon.bed_idx == 0)
7886 arrange_polygon.bed_idx += m_current_plate;
7887 else
7888 arrange_polygon.bed_idx = m_plate_list.size();
7889
7890 return;
7891}

References Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::arrangement::ArrangePolygon::locked_plate, m_current_plate, m_plate_list, Slic3r::arrangement::ArrangePolygon::translation, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::GUI::ArrangeJob::finalize(), and Slic3r::CLI::run().

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

◆ postprocess_bed_index_for_selected()

void Slic3r::GUI::PartPlateList::postprocess_bed_index_for_selected ( arrangement::ArrangePolygon & arrange_polygon)
7797{
7798 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": bed_idx %1%, locked_plate %2%, translation(x) %3%, (y) %4%") % arrange_polygon.bed_idx % arrange_polygon.locked_plate % unscale<double>(arrange_polygon.translation(X)) % unscale<double>(arrange_polygon.translation(Y));
7799
7800 if (arrange_polygon.bed_idx == -1)
7801 {
7802 //outarea for large object, can not process here for the plate number maybe increased later
7803 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(": can not be arranged inside plate!");
7804 return;
7805 }
7806
7807 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7808 {
7809 if (m_plate_list[i]->is_locked())
7810 {
7811 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found locked_plate %1%, increate index by 1") % i;
7812 //arrange_polygon.translation(X) += scaled<double>(plate_stride_x());
7813 arrange_polygon.bed_idx += 1;
7814 //offset_x += scaled<double>(plate_stride_x());
7815 }
7816 else
7817 {
7818 //judge whether it is at the left side of the plate border
7819 if (arrange_polygon.bed_idx <= i)
7820 {
7821 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":found in plate_index %1%, bed_idx %2%") % i % arrange_polygon.bed_idx;
7822 return;
7823 }
7824 }
7825 }
7826
7827 //create a new plate which can hold this arrange_polygon
7828 int plate_index = create_plate(false);
7829
7830 while (plate_index != -1)
7831 {
7832 if (arrange_polygon.bed_idx <= plate_index)
7833 {
7834 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":new plate_index %1%, matches bed_idx %2%") % plate_index % arrange_polygon.bed_idx;
7835 break;
7836 }
7837
7838 plate_index = create_plate(false);
7839 }
7840
7841 return;
7842}
bool is_locked(int index)
Definition PartPlate.hpp:1007

References Slic3r::arrangement::ArrangePolygon::bed_idx, create_plate(), is_locked(), Slic3r::arrangement::ArrangePolygon::locked_plate, m_plate_list, Slic3r::arrangement::ArrangePolygon::translation, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::GUI::ArrangeJob::finalize(), and Slic3r::CLI::run().

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

◆ postprocess_bed_index_for_unselected()

void Slic3r::GUI::PartPlateList::postprocess_bed_index_for_unselected ( arrangement::ArrangePolygon & arrange_polygon)
7846{
7847 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": bed_idx %1%, locked_plate %2%, translation(x) %3%, (y) %4%") % arrange_polygon.bed_idx % arrange_polygon.locked_plate % unscale<double>(arrange_polygon.translation(X)) % unscale<double>(arrange_polygon.translation(Y));
7848
7849 if (arrange_polygon.bed_idx == PartPlateList::MAX_PLATES_COUNT)
7850 return;
7851
7852 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7853 {
7854 if (m_plate_list[i]->is_locked())
7855 {
7856 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found locked_plate %1%, increate index by 1") % i;
7857 //arrange_polygon.translation(X) += scaled<double>(plate_stride_x());
7858 arrange_polygon.bed_idx += 1;
7859 //offset_x += scaled<double>(plate_stride_x());
7860 }
7861 else
7862 {
7863 //judge whether it is at the left side of the plate border
7864 if (arrange_polygon.bed_idx <= i)
7865 {
7866 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(":found in plate_index %1%, bed_idx %2%") % i % arrange_polygon.bed_idx;
7867 return;
7868 }
7869 }
7870 }
7871
7872 return;
7873}

References Slic3r::arrangement::ArrangePolygon::bed_idx, is_locked(), Slic3r::arrangement::ArrangePolygon::locked_plate, m_plate_list, MAX_PLATES_COUNT, Slic3r::arrangement::ArrangePolygon::translation, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::GUI::ArrangeJob::finalize().

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

◆ preprocess_arrange_polygon()

bool Slic3r::GUI::PartPlateList::preprocess_arrange_polygon ( int obj_index,
int instance_index,
arrangement::ArrangePolygon & arrange_polygon,
bool selected )
7581{
7582 bool locked = false;
7583 int lockplate_cnt = 0;
7584
7585 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7586 {
7587 if (m_plate_list[i]->contain_instance(obj_index, instance_index))
7588 {
7589 if (m_plate_list[i]->is_locked())
7590 {
7591 locked = true;
7592 arrange_polygon.bed_idx = i;
7593 arrange_polygon.row = i / m_plate_cols;
7594 arrange_polygon.col = i % m_plate_cols;
7595 arrange_polygon.translation(X) -= scaled<double>(plate_stride_x() * arrange_polygon.col);
7596 arrange_polygon.translation(Y) += scaled<double>(plate_stride_y() * arrange_polygon.row);
7597 }
7598 else
7599 {
7600 if (!selected)
7601 {
7602 //will be treated as fixeditem later
7603 arrange_polygon.bed_idx = i - lockplate_cnt;
7604 arrange_polygon.row = i / m_plate_cols;
7605 arrange_polygon.col = i % m_plate_cols;
7606 arrange_polygon.translation(X) -= scaled<double>(plate_stride_x() * arrange_polygon.col);
7607 arrange_polygon.translation(Y) += scaled<double>(plate_stride_y() * arrange_polygon.row);
7608 }
7609 }
7610 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1% instance_id %2% already in plate %3%, locked %4%, row %5%, col %6%\n") % obj_index % instance_index % i % locked % arrange_polygon.row % arrange_polygon.col;
7611 return locked;
7612 }
7613 if (m_plate_list[i]->is_locked())
7614 lockplate_cnt++;
7615 }
7616 //not be contained by any plates
7617 if (!selected)
7618 arrange_polygon.bed_idx = PartPlateList::MAX_PLATES_COUNT;
7619
7620 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": not in any plates, bed_idx %1%, translation(x) %2%, (y) %3%") % arrange_polygon.bed_idx % unscale<double>(arrange_polygon.translation(X)) % unscale<double>(arrange_polygon.translation(Y));
7621
7622 return locked;
7623}

References Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::arrangement::ArrangePolygon::col, is_locked(), m_plate_cols, m_plate_list, MAX_PLATES_COUNT, plate_stride_x(), plate_stride_y(), Slic3r::arrangement::ArrangePolygon::row, Slic3r::scaled(), Slic3r::arrangement::ArrangePolygon::translation, Slic3r::unscale(), Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::GUI::ArrangeJob::prepare_all(), Slic3r::GUI::ArrangeJob::prepare_selected(), and Slic3r::CLI::run().

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

◆ preprocess_arrange_polygon_other_locked()

bool Slic3r::GUI::PartPlateList::preprocess_arrange_polygon_other_locked ( int obj_index,
int instance_index,
arrangement::ArrangePolygon & arrange_polygon,
bool selected )
7627{
7628 bool locked = false;
7629
7630 if (selected)
7631 {
7632 //arrange_polygon.translation(X) -= scaled<double>(plate_stride_x() * m_current_plate);
7633 }
7634 else
7635 {
7636 locked = true;
7637 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7638 {
7639 if (m_plate_list[i]->contain_instance(obj_index, instance_index))
7640 {
7641 arrange_polygon.bed_idx = i;
7642 arrange_polygon.row = i / m_plate_cols;
7643 arrange_polygon.col = i % m_plate_cols;
7644 arrange_polygon.translation(X) -= scaled<double>(plate_stride_x() * arrange_polygon.col);
7645 arrange_polygon.translation(Y) += scaled<double>(plate_stride_y() * arrange_polygon.row);
7646 //BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1% instance_id %2% in plate %3%, locked %4%, row %5%, col %6%\n") % obj_index % instance_index % i % locked % arrange_polygon.row % arrange_polygon.col;
7647 return locked;
7648 }
7649 }
7650 arrange_polygon.bed_idx = PartPlateList::MAX_PLATES_COUNT;
7651 }
7652 return locked;
7653}

References Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::arrangement::ArrangePolygon::col, m_plate_cols, m_plate_list, MAX_PLATES_COUNT, plate_stride_x(), plate_stride_y(), Slic3r::arrangement::ArrangePolygon::row, Slic3r::scaled(), Slic3r::arrangement::ArrangePolygon::translation, Slic3r::X, and Slic3r::Y.

Referenced by Slic3r::GUI::ArrangeJob::prepare_partplate(), and Slic3r::CLI::run().

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

◆ preprocess_exclude_areas()

bool Slic3r::GUI::PartPlateList::preprocess_exclude_areas ( arrangement::ArrangePolygons & unselected,
const DynamicPrintConfig & config,
bool enable_wrapping_detect,
int num_plates = 16,
float inflation = 0 )
7657{
7658 bool added = false;
7659
7660 // wrapping detection area
7661 if (enable_wrapping_detect)
7662 {
7663 if (!m_wrapping_exclude_areas.empty())
7664 {
7665 Polygon ap{};
7666 for (const Vec2d &p : m_wrapping_exclude_areas)
7667 {
7668 ap.append({scale_(p(0)), scale_(p(1))});
7669 }
7670
7671 for(int j = 0; j < num_plates; j++)
7672 {
7673 arrangement::ArrangePolygon ret;
7674 ret.poly.contour = ap;
7675 ret.translation = Vec2crd(0, 0);
7676 ret.rotation = 0.0f;
7677 ret.is_virt_object = true;
7678 ret.bed_idx = j;
7679 ret.height = 1;
7680 ret.name = "WrappingRegion";
7681 ret.inflation = inflation;
7682
7683 unselected.emplace_back(std::move(ret));
7684 }
7685 }
7686 added = true;
7687 }
7689 const bool use_resolved_regions = has_bed_exclude_volumes(config);
7690
7691 if (use_resolved_regions) {
7692 const std::vector<std::vector<BedExcludeRegion>> regions_by_extruder =
7694 const size_t extruder_count = mode == BedExcludeVolumeMode::Shared ?
7695 std::min<size_t>(1, regions_by_extruder.size()) : regions_by_extruder.size();
7696
7697 for (size_t extruder_id = 0; extruder_id < extruder_count; ++extruder_id) {
7698 for (size_t region_id = 0; region_id < regions_by_extruder[extruder_id].size(); ++region_id) {
7699 const BedExcludeRegion &region = regions_by_extruder[extruder_id][region_id];
7700 if (!region.is_collision_volume() || region.polygon.points.size() < 3 ||
7701 (region.has_z_range && region.z_max <= region.z_min + EPSILON))
7702 continue;
7703
7704 for (int plate_idx = 0; plate_idx < num_plates; ++plate_idx) {
7705 arrangement::ArrangePolygon blocker;
7706 blocker.poly.contour = bed_exclusion_arrange_polygon(region.polygon);
7707 blocker.translation = Vec2crd::Zero();
7708 blocker.rotation = 0.0;
7709 blocker.is_virt_object = true;
7710 blocker.is_bed_exclusion = true;
7711 blocker.bed_exclusion_extruder_id = mode == BedExcludeVolumeMode::Shared ? -1 : int(extruder_id);
7712 blocker.bed_idx = plate_idx;
7713 blocker.height = std::max(0.0, region.z_max - region.z_min);
7714 blocker.z_min = region.z_min;
7715 blocker.z_max = region.z_max;
7716 blocker.has_z_range = region.has_z_range;
7717 blocker.name = "BedExclusionVolume" + std::to_string(extruder_id) + "_" + std::to_string(region_id);
7718 blocker.inflation = inflation;
7719 unselected.emplace_back(std::move(blocker));
7720 }
7721 added = true;
7722 }
7723 }
7724 }
7725
7726 // Keep Orca's established legacy-area arrange obstacle alongside any
7727 // explicit collision-volume blockers. The two settings are additive.
7728 if (!m_exclude_areas.empty()) {
7729 //has exclude areas
7730 PartPlate *plate = m_plate_list[0];
7731
7732 for (int index = 0; index < plate->m_exclude_bounding_box.size(); index ++)
7733 {
7734 Polygon ap({
7735 {scaled(plate->m_exclude_bounding_box[index].min.x()), scaled(plate->m_exclude_bounding_box[index].min.y())},
7736 {scaled(plate->m_exclude_bounding_box[index].max.x()), scaled(plate->m_exclude_bounding_box[index].min.y())},
7737 {scaled(plate->m_exclude_bounding_box[index].max.x()), scaled(plate->m_exclude_bounding_box[index].max.y())},
7738 {scaled(plate->m_exclude_bounding_box[index].min.x()), scaled(plate->m_exclude_bounding_box[index].max.y())}
7739 });
7740
7741 for (int j = 0; j < num_plates; j++)
7742 {
7743 arrangement::ArrangePolygon ret;
7744 ret.poly.contour = ap;
7745 ret.translation = Vec2crd(0, 0);
7746 ret.rotation = 0.0f;
7747 ret.is_virt_object = true;
7748 ret.bed_idx = j;
7749 ret.height = 1;
7750 ret.name = "ExcludedRegion" + std::to_string(index);
7751 ret.inflation = inflation;
7752
7753 unselected.emplace_back(std::move(ret));
7754 }
7755 added = true;
7756 }
7757 }
7758
7759 return added;
7760}
#define EPSILON
Definition ColorUtils.cpp:64
#define scale_(val)
Definition libslic3r.h:106
bool has_bed_exclude_volumes(const DynamicPrintConfig &cfg)
Definition PrintConfig.cpp:14346
std::vector< std::vector< BedExcludeRegion > > get_bed_excluded_regions_by_extruder(const DynamicPrintConfig &cfg)
Definition PrintConfig.cpp:14211
Polygon bed_exclusion_arrange_polygon(const Polygon &polygon)
Definition ExclusionVolumeGeometry.cpp:70
BedExcludeVolumeMode active_bed_exclude_volume_mode(const DynamicPrintConfig &cfg)
Definition PrintConfig.cpp:14364
Eigen::Matrix< coord_t, 2, 1, Eigen::DontAlign > Vec2crd
Definition Point.hpp:52
BedExcludeVolumeMode
Definition PrintConfig.hpp:642
@ Shared
Definition PrintConfig.hpp:643
Slic3r::Polygon Polygon
Definition Emboss.cpp:101

References Slic3r::active_bed_exclude_volume_mode(), Slic3r::MultiPoint::append(), Slic3r::bed_exclusion_arrange_polygon(), Slic3r::arrangement::ArrangePolygon::bed_exclusion_extruder_id, Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::ExPolygon::contour, EPSILON, Slic3r::get_bed_excluded_regions_by_extruder(), Slic3r::has_bed_exclude_volumes(), Slic3r::arrangement::ArrangePolygon::has_z_range, Slic3r::BedExcludeRegion::has_z_range, Slic3r::arrangement::ArrangePolygon::height, Slic3r::arrangement::ArrangePolygon::inflation, Slic3r::arrangement::ArrangePolygon::is_bed_exclusion, Slic3r::BedExcludeRegion::is_collision_volume(), Slic3r::arrangement::ArrangePolygon::is_virt_object, m_exclude_areas, Slic3r::GUI::PartPlate::m_exclude_bounding_box, m_plate_list, m_wrapping_exclude_areas, Slic3r::arrangement::ArrangePolygon::name, PartPlate, Slic3r::MultiPoint::points, Slic3r::arrangement::ArrangePolygon::poly, Slic3r::BedExcludeRegion::polygon, Slic3r::arrangement::ArrangePolygon::rotation, scale_, Slic3r::scaled(), Slic3r::Shared, Slic3r::arrangement::ArrangePolygon::translation, Slic3r::arrangement::ArrangePolygon::z_max, Slic3r::BedExcludeRegion::z_max, Slic3r::arrangement::ArrangePolygon::z_min, and Slic3r::BedExcludeRegion::z_min.

Referenced by Slic3r::GUI::FillBedJob::prepare(), Slic3r::GUI::ArrangeJob::prepare_all(), Slic3r::GUI::ArrangeJob::prepare_partplate(), and Slic3r::CLI::run().

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

◆ preprocess_nonprefered_areas()

bool Slic3r::GUI::PartPlateList::preprocess_nonprefered_areas ( arrangement::ArrangePolygons & regions,
int num_plates = 1,
float inflation = 0 )
7763{
7764 bool added = false;
7765
7766 std::vector<BoundingBoxf> nonprefered_regions;
7767 nonprefered_regions.emplace_back(Vec2d{ 18,0 }, Vec2d{ 240,15 }); // new extrusion & hand-eye calibration region
7768
7769 //has exclude areas
7770 PartPlate* plate = m_plate_list[0];
7771 for (int index = 0; index < nonprefered_regions.size(); index++)
7772 {
7773 Polygon ap = scaled(nonprefered_regions[index]).polygon();
7774 for (int j = 0; j < num_plates; j++)
7775 {
7776 arrangement::ArrangePolygon ret;
7777 ret.poly.contour = ap;
7778 ret.translation = Vec2crd(0, 0);
7779 ret.rotation = 0.0f;
7780 ret.is_virt_object = true;
7781 ret.is_extrusion_cali_object = true;
7782 ret.bed_idx = j;
7783 ret.height = 1;
7784 ret.name = "NonpreferedRegion" + std::to_string(index);
7785 ret.inflation = inflation;
7786
7787 regions.emplace_back(std::move(ret));
7788 }
7789 added = true;
7790 }
7791 return added;
7792}
void polygon(Polygon *polygon) const
Definition BoundingBox.cpp:20

References Slic3r::arrangement::ArrangePolygon::bed_idx, Slic3r::ExPolygon::contour, Slic3r::arrangement::ArrangePolygon::height, Slic3r::arrangement::ArrangePolygon::inflation, Slic3r::arrangement::ArrangePolygon::is_extrusion_cali_object, Slic3r::arrangement::ArrangePolygon::is_virt_object, m_plate_list, Slic3r::arrangement::ArrangePolygon::name, PartPlate, Slic3r::arrangement::ArrangePolygon::poly, Slic3r::BoundingBox::polygon(), Slic3r::arrangement::ArrangePolygon::rotation, Slic3r::scaled(), and Slic3r::arrangement::ArrangePolygon::translation.

Referenced by Slic3r::CLI::run().

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

◆ print()

void Slic3r::GUI::PartPlateList::print ( ) const
8696{
8697 BOOST_LOG_TRIVIAL(trace) << __FUNCTION__ << boost::format("PartPlateList %1%, m_plate_count %2%, current_plate %3%, print_count %4%, current print index %5%, plate cols %6%") % this % m_plate_count % m_current_plate % m_print_list.size() % m_print_index % m_plate_cols;
8698 BOOST_LOG_TRIVIAL(trace) << boost::format("m_plate_width %1%, m_plate_depth %2%, m_plate_height %3%, plate count %4%\nplate list:") % m_plate_width % m_plate_depth % m_plate_height % m_plate_list.size();
8699 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8700 {
8701 BOOST_LOG_TRIVIAL(trace) << boost::format("the %1%th plate") % i;
8702 m_plate_list[i]->print();
8703 }
8704 BOOST_LOG_TRIVIAL(trace) << boost::format("the unprintable plate:");
8705 unprintable_plate.print();
8706
8707 flush_logs();
8708 return;
8709}
void flush_logs()
Definition utils.cpp:480

References Slic3r::flush_logs(), m_current_plate, m_plate_cols, m_plate_count, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, m_print_index, m_print_list, Slic3r::trace(), and unprintable_plate.

Referenced by clear(), create_plate(), get_current_fff_print(), init(), load_from_3mf_structure(), Slic3r::UndoRedo::StackImpl::load_snapshot(), rebuild_plates_after_deserialize(), store_to_3mf_structure(), and Slic3r::UndoRedo::StackImpl::take_snapshot().

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

◆ rebuild_plates_after_arrangement()

int Slic3r::GUI::PartPlateList::rebuild_plates_after_arrangement ( bool recycle_plates = true,
bool except_locked = false,
int plate_index = -1 )
8346{
8347 int ret = 0;
8348
8349 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":before rebuild, plates count %1%, recycle_plates %2%") % m_plate_list.size() % recycle_plates;
8350
8351 // sort by arrange_order
8352 std::sort(m_model->objects.begin(), m_model->objects.end(), [](auto a, auto b) {return a->instances[0]->arrange_order < b->instances[0]->arrange_order; });
8353 //for (auto object : m_model->objects)
8354 // std::sort(object->instances.begin(), object->instances.end(), [](auto a, auto b) {return a->arrange_order < b->arrange_order; });
8355
8356 ret = reload_all_objects(except_locked, plate_index);
8357
8358 if (recycle_plates)
8359 {
8360 for (unsigned int i = (unsigned int)m_plate_list.size() - 1; i > 0; --i)
8361 {
8362 if (m_plate_list[i]->empty()
8363 || !m_plate_list[i]->has_printable_instances())
8364 {
8365 //delete it
8366 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":delete plate %1% for empty") % i;
8367 delete_plate(i);
8368 }
8369 else if (m_plate_list[i]->is_locked()) {
8370 continue;
8371 }
8372 else
8373 {
8374 break;
8375 }
8376 }
8377 }
8378
8379#if 0
8380 if (m_plater != nullptr) {
8381 // In GUI mode
8382 wxGetApp().obj_list()->reload_all_plates();
8383 }
8384#endif
8385
8386 if (m_plater)
8387 m_plater->mark_plate_toolbar_image_dirty();
8388
8389 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":after rebuild, plates count %1%") % m_plate_list.size();
8390 return ret;
8391}

References delete_plate(), Slic3r::empty(), is_locked(), m_model, m_plate_list, m_plater, and reload_all_objects().

Referenced by Slic3r::GUI::ArrangeJob::finalize(), and Slic3r::CLI::run().

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

◆ rebuild_plates_after_deserialize()

int Slic3r::GUI::PartPlateList::rebuild_plates_after_deserialize ( std::vector< bool > & previous_sliced_result,
std::vector< std::string > & previous_gcode_paths )
8238{
8239 int ret = 0;
8240
8241 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": plates count %1%") % m_plate_list.size();
8242 // SoftFever: assign plater info first
8243 for (auto partplate : m_plate_list) {
8244 partplate->m_plater = this->m_plater;
8245 partplate->m_partplate_list = this;
8246 partplate->m_model = this->m_model;
8247 partplate->printer_technology = this->printer_technology;
8248 }
8250 update_all_plates_pos_and_size(false, false, false, false);
8252 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8253 {
8254 bool need_reset_print = false;
8255 //check the previous sliced result
8256 if (m_plate_list[i]->m_slice_result_valid) {
8257 if ((i >= previous_sliced_result.size()) || !previous_sliced_result[i])
8258 m_plate_list[i]->update_slice_result_valid_state(false);
8259 }
8260 if ((i < previous_gcode_paths.size())
8261 && !previous_gcode_paths[i].empty()
8262 && (m_plate_list[i]->m_tmp_gcode_path != previous_gcode_paths[i])) {
8263 if (boost::filesystem::exists(previous_gcode_paths[i])) {
8264 boost::nowide::remove(previous_gcode_paths[i].c_str());
8265 need_reset_print = true;
8266 }
8267 }
8268
8269 std::map<int, PrintBase*>::iterator it = m_print_list.find(m_plate_list[i]->m_print_index);
8270 std::map<int, GCodeResult*>::iterator it2 = m_gcode_result_list.find(m_plate_list[i]->m_print_index);
8271 if (it != m_print_list.end())
8272 {
8273 //find it
8274 if (it2 == m_gcode_result_list.end())
8275 {
8276 //should not happen
8277 assert(0);
8278 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":can not find gcode result for plate %1%, print index %2%") % i % m_plate_list[i]->m_print_index;
8279 delete it->second;
8280 m_print_list.erase(it);
8281 }
8282 else
8283 {
8284 m_plate_list[i]->set_print(it->second, it2->second, m_plate_list[i]->m_print_index);
8285 it->second->set_plate_index(i);
8286 if (need_reset_print) {
8287 Print *print = dynamic_cast<Print*>(it->second);
8288 it2->second->reset();
8289 print->set_gcode_file_invalidated();
8290 if ((i == m_current_plate)&&m_plater)
8291 m_plater->reset_gcode_toolpaths();
8292 }
8293 continue;
8294 }
8295 }
8296
8297 //can not find, create a new one
8298 Print* print = new Print();
8299 GCodeResult* gcode = new GCodeResult();
8302 m_plate_list[i]->set_print(print, gcode, m_print_index);
8303 print->set_plate_index(i);
8304 m_print_index++;
8305 }
8306
8307 //go through the print list, and delete the one not used by plate
8308 std::map<int, PrintBase*>::iterator it = m_print_list.begin();
8309 int print_index;
8310 std::vector<int> delete_list;
8311 while (it != m_print_list.end())
8312 {
8313 print_index = it->first;
8314
8315 int plate_index = find_plate_by_print_index(print_index);
8316 if (plate_index < 0)
8317 {
8318 delete_list.push_back(print_index);
8319 }
8320 it++;
8321 }
8322
8323 for (unsigned int index = 0; index < delete_list.size(); index++)
8324 {
8325 destroy_print(delete_list[index]);
8326 }
8327
8328 //update the bed's position
8330 m_plater->set_bed_position(pos);
8331
8332 //not used
8333 /*if (m_plate_width == 0)
8334 {
8335 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": jump to the first init state, need to re-set size!");
8336 Vec3d max = m_plater->get_bed().get_bounding_box(false).max;
8337 Vec3d min = m_plater->get_bed().get_bounding_box(false).min;
8338 double z = m_plater->config()->opt_float("printable_height");
8339 reset_size(max.x() - min.x(), max.y() - min.y(), z);
8340 }*/
8341 return ret;
8342}
int find_plate_by_print_index(int index)
Definition PartPlate.cpp:7155

References compute_shape_position(), destroy_print(), find_plate_by_print_index(), Slic3r::GUI::gcode(), m_current_plate, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_gcode_result_list, m_height_to_lid, m_height_to_rod, m_logo_texture_filename, m_model, m_plate_cols, m_plate_list, m_plater, m_print_index, m_print_list, m_shape, m_wrapping_exclude_areas, print(), printer_technology, set_shapes(), update_all_plates_pos_and_size(), and update_plate_cols().

Referenced by Slic3r::UndoRedo::StackImpl::load_snapshot().

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

◆ refresh_imex_icons()

void Slic3r::GUI::PartPlateList::refresh_imex_icons ( )
9159{
9160 const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
9161 for (PartPlate* plate : m_plate_list)
9162 plate->refresh_imex_icon();
9163}
std::mutex m_plates_mutex
Definition PartPlate.hpp:777

References m_plate_list, m_plates_mutex, and PartPlate.

Here is the call graph for this function:

◆ register_raycasters_for_picking()

void Slic3r::GUI::PartPlateList::register_raycasters_for_picking ( GLCanvas3D & canvas)
inline
1063 {
1064 for (auto plate : m_plate_list)
1065 plate->register_raycasters_for_picking(canvas);
1066 }

References m_plate_list.

◆ reinit()

void Slic3r::GUI::PartPlateList::reinit ( )
6494{
6495 clear(true, true);
6496
6497 init();
6498
6499 m_plate_list[0]->set_filament_count(m_filament_count);
6500
6501 //reset plate 0's position
6504 //reset unprintable plate's position
6506 unprintable_plate.set_pos_and_size(origin2, m_plate_width, m_plate_depth, m_plate_height, false);
6507 //re-calc the bounding boxes
6509
6510 if (m_plater) {
6511 // In GUI mode
6513 }
6514
6515 return;
6516}

References calc_bounding_boxes(), clear(), compute_origin_for_unprintable(), compute_shape_position(), init(), m_exclude_areas, m_extruder_areas, m_extruder_heights, m_filament_count, m_height_to_lid, m_height_to_rod, m_plate_cols, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, m_plater, m_shape, set_default_wipe_tower_pos_for_plate(), and unprintable_plate.

Here is the call graph for this function:

◆ release_icon_textures()

void Slic3r::GUI::PartPlateList::release_icon_textures ( )
private
6258{
6259 m_logo_texture.reset();
6260 m_del_texture.reset();
6261 m_del_hovered_texture.reset();
6263 m_move_front_texture.reset();
6264 m_arrange_texture.reset();
6266 m_orient_texture.reset();
6268 m_locked_texture.reset();
6270 m_lockopen_texture.reset();
6278 for (GLTexture& texture : m_imex_mode_textures)
6279 texture.reset();
6280 for (GLTexture& texture : m_imex_mode_hovered_textures)
6281 texture.reset();
6282 m_imex_warn_texture.reset();
6283 for (int i = 0;i < MAX_PLATE_COUNT; i++) {
6284 m_idx_textures[i].reset();
6285 }
6286 //reset
6293 for (int i = 0; i < btCount; i++) {
6294 for (auto& part: bed_texture_info[i].parts) {
6295 if (part.texture) {
6296 part.texture->reset();
6297 delete part.texture;
6298 }
6299 if (part.buffer) {
6300 delete part.buffer;
6301 }
6302 }
6303 }
6304 for (int i = 0; i < (unsigned char)ExtruderOnlyAreaType::btAreaCount; i++) {
6305 for (auto &part : extruder_only_area_info[i].parts) {
6306 if (part.texture) {
6307 part.texture->reset();
6308 delete part.texture;
6309 }
6310 if (part.buffer) { delete part.buffer; }
6311 }
6312 }
6313}

References bed_texture_info, Slic3r::btAreaCount, Slic3r::btCount, extruder_only_area_info, is_load_bedtype_textures, is_load_cali_texture, is_load_extruder_only_area_textures, m_arrange_hovered_texture, m_arrange_texture, m_del_hovered_texture, m_del_texture, m_idx_textures, m_imex_mode_hovered_textures, m_imex_mode_textures, m_imex_warn_texture, m_locked_hovered_texture, m_locked_texture, m_lockopen_hovered_texture, m_lockopen_texture, m_logo_texture, m_move_front_hovered_texture, m_move_front_texture, m_next_bedtype_texture, m_next_cali_texture, m_next_extruder_only_area_texture, m_orient_hovered_texture, m_orient_texture, m_plate_name_edit_hovered_texture, m_plate_name_edit_texture, m_plate_set_filament_map_hovered_texture, m_plate_set_filament_map_texture, m_plate_settings_hovered_texture, m_plate_settings_texture, and MAX_PLATE_COUNT.

Referenced by ~PartPlateList().

Here is the caller graph for this function:

◆ reload_all_objects()

int Slic3r::GUI::PartPlateList::reload_all_objects ( bool except_locked = false,
int plate_index = -1 )
7462{
7463 int ret = 0;
7464 unsigned int i, j, k;
7465
7466 clear(false, false, except_locked, plate_index);
7467
7468 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": m_model->objects.size() is %1%") % m_model->objects.size();
7469 //try to find a new plate
7470 for (i = 0; i < (unsigned int)m_model->objects.size(); ++i)
7471 {
7472 ModelObject* object = m_model->objects[i];
7473 for (j = 0; j < (unsigned int)object->instances.size(); ++j)
7474 {
7475 ModelInstance* instance = object->instances[j];
7476 BoundingBoxf3 boundingbox = object->instance_convex_hull_bounding_box(j);
7477 for (k = 0; k < (unsigned int)m_plate_list.size(); ++k)
7478 {
7479 PartPlate* plate = m_plate_list[k];
7480 assert(plate != NULL);
7481
7482 if (plate->intersect_instance(i, j, &boundingbox))
7483 {
7484 //found a new plate, add it to plate
7485 plate->add_instance(i, j, false, &boundingbox);
7486 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found plate_id %1%, for obj_id %2%, instance_id %3%") % k % i % j;
7487
7488 //need to judge whether this instance has an outer part
7489 /*if (plate->check_outside(i, j))
7490 {
7491 plate->m_ready_for_slice = false;
7492 }*/
7493 break;
7494 }
7495 }
7496
7497 if ((k == m_plate_list.size()) && (unprintable_plate.intersect_instance(i, j, &boundingbox)))
7498 {
7499 //found in unprintable plate, add it to plate
7500 unprintable_plate.add_instance(i, j, false, &boundingbox);
7501 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found in unprintable plate, obj_id %1%, instance_id %2%") % i % j;
7502 }
7503 }
7504
7505 }
7506
7507 return ret;
7508}

References Slic3r::GUI::PartPlate::add_instance(), clear(), Slic3r::GUI::PartPlate::intersect_instance(), m_model, m_plate_list, PartPlate, and unprintable_plate.

Referenced by create_plate(), load_from_3mf_structure(), move_plate_to_index(), Slic3r::GUI::ObjectList::OnDrop(), rebuild_plates_after_arrangement(), reset_size(), and Slic3r::CLI::run().

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

◆ render()

void Slic3r::GUI::PartPlateList::render ( const Transform3d & view_matrix,
const Transform3d & projection_matrix,
bool bottom,
bool only_current = false,
bool only_body = false,
int hover_id = -1,
bool render_cali = false,
bool show_grid = true,
bool hide_chrome = false,
bool hide_inactive = false )
7918{
7919 const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
7920 std::vector<PartPlate*>::iterator it = m_plate_list.begin();
7921
7922 int plate_hover_index = -1;
7923 int plate_hover_action = -1;
7924 if (hover_id != -1) {
7925 plate_hover_index = hover_id / PartPlate::GRABBER_COUNT;
7926 plate_hover_action = hover_id % PartPlate::GRABBER_COUNT;
7927 }
7928
7930 for (it = m_plate_list.begin(); it != m_plate_list.end(); it++) {
7931 int current_index = (*it)->get_index();
7932 if ((only_current || hide_inactive) && (current_index != m_current_plate))
7933 continue;
7934 if (current_index == m_current_plate) {
7936 if (plate_hover_index == current_index)
7937 (*it)->render(view_matrix, projection_matrix, bottom, only_body, false, height_mode, plate_hover_action, render_cali, show_grid, hide_chrome);
7938 else
7939 (*it)->render(view_matrix, projection_matrix, bottom, only_body, false, height_mode, -1, render_cali, show_grid, hide_chrome);
7940 }
7941 else {
7942 if (plate_hover_index == current_index)
7943 (*it)->render(view_matrix, projection_matrix, bottom, only_body, false, PartPlate::HEIGHT_LIMIT_NONE, plate_hover_action, render_cali, show_grid, hide_chrome);
7944 else
7945 (*it)->render(view_matrix, projection_matrix, bottom, only_body, false, PartPlate::HEIGHT_LIMIT_NONE, -1, render_cali, show_grid, hide_chrome);
7946 }
7947 }
7948}
void load_icon_textures()
Definition PartPlate.cpp:9097
PartPlate::HeightLimitMode m_height_limit_mode
Definition PartPlate.hpp:789
static constexpr unsigned int GRABBER_COUNT
Definition PartPlate.hpp:288
HeightLimitMode
Definition PartPlate.hpp:110
@ HEIGHT_LIMIT_NONE
Definition PartPlate.hpp:111

References Slic3r::GUI::PartPlate::GRABBER_COUNT, Slic3r::GUI::PartPlate::HEIGHT_LIMIT_NONE, load_icon_textures(), m_current_plate, m_height_limit_mode, m_plate_list, and m_plates_mutex.

Referenced by Slic3r::GUI::GLCanvas3D::_render_platelist().

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

◆ render_exclusion_volume_intersections()

void Slic3r::GUI::PartPlateList::render_exclusion_volume_intersections ( const Transform3d & view_matrix,
const Transform3d & projection_matrix )
6538{
6539 GLShaderProgram *shader = wxGetApp().get_shader("flat");
6540 if (shader == nullptr)
6541 return;
6542
6543 shader->start_using();
6544 shader->set_uniform("view_model_matrix", view_matrix);
6545 shader->set_uniform("projection_matrix", projection_matrix);
6546
6551
6552 for (PartPlate *plate : m_plate_list)
6553 if (plate != nullptr)
6554 plate->render_exclusion_volume_intersections();
6555
6558 shader->stop_using();
6559}
#define glsafe(cmd)
Definition OpenGLUtils.hpp:25
#define GL_TRUE
Definition gl.h:1892
#define glEnable
Definition gl.h:3667
#define GL_DEPTH_TEST
Definition gl.h:574
#define GL_SRC_ALPHA
Definition gl.h:1621
#define glDepthMask
Definition gl.h:3595
#define GL_BLEND
Definition gl.h:275
#define GL_ONE_MINUS_SRC_ALPHA
Definition gl.h:1239
#define GL_FALSE
Definition gl.h:648
#define glDisable
Definition gl.h:3607
#define glBlendFunc
Definition gl.h:3325

References GL_BLEND, GL_DEPTH_TEST, GL_FALSE, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_TRUE, glBlendFunc, glDepthMask, glDisable, glEnable, glsafe, m_plate_list, PartPlate, Slic3r::GLShaderProgram::set_uniform(), Slic3r::GLShaderProgram::start_using(), and Slic3r::GLShaderProgram::stop_using().

Here is the call graph for this function:

◆ render_hover_tooltip()

void Slic3r::GUI::PartPlateList::render_hover_tooltip ( ) const
7951{
7952 if (m_hover_tooltip.empty())
7953 return;
7954
7955 const auto scale = m_plater->get_current_canvas3D()->get_scale();
7956 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, {6 * scale, 3 * scale});
7957 ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 3 * scale);
7958 ImGui::PushStyleColor(ImGuiCol_PopupBg, ImGuiWrapper::COL_WINDOW_BACKGROUND);
7959 ImGui::PushStyleColor(ImGuiCol_Border, {0, 0, 0, 0});
7960 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.00f, 1.00f, 1.00f, 1.00f));
7961 ImGui::BeginTooltip();
7962 ImGui::TextUnformatted(m_hover_tooltip.c_str());
7963 ImGui::EndTooltip();
7964 ImGui::PopStyleColor(3);
7965 ImGui::PopStyleVar(2);
7966}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
static const ImVec4 COL_WINDOW_BACKGROUND
Definition ImGuiWrapper.hpp:388

References Slic3r::GUI::ImGuiWrapper::COL_WINDOW_BACKGROUND, m_hover_tooltip, m_plater, and scale().

Here is the call graph for this function:

◆ reset()

void Slic3r::GUI::PartPlateList::reset ( bool do_init)
6479{
6480 clear(true, false);
6481
6482 //m_plate_list.clear();
6483
6484 if (do_init) {
6485 init();
6486 m_plate_list[0]->set_filament_count(m_filament_count);
6487 }
6488
6489 return;
6490}

References clear(), init(), m_filament_count, and m_plate_list.

Referenced by Slic3r::UndoRedo::StackImpl::load_snapshot().

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

◆ reset_hover_id()

void Slic3r::GUI::PartPlateList::reset_hover_id ( )
6993{
6994 const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
6995 std::vector<PartPlate*>::iterator it = m_plate_list.begin();
6996 for (it = m_plate_list.begin(); it != m_plate_list.end(); it++) {
6997 (*it)->set_hover_id(-1);
6998 }
6999}

References m_plate_list, and m_plates_mutex.

◆ reset_size()

void Slic3r::GUI::PartPlateList::reset_size ( int width,
int depth,
double height,
bool reload_objects = true,
bool update_shapes = false )
6408{
6409 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":before size: plate_width %1%, plate_depth %2%, plate_height %3%") % m_plate_width % m_plate_depth % m_plate_height;
6410 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":after size: plate_width %1%, plate_depth %2%, plate_height %3%") % width % depth % height;
6411 if ((m_plate_width != width) || (m_plate_depth != depth) || (m_plate_height != height))
6412 {
6414 m_plate_depth = depth;
6416 update_all_plates_pos_and_size(false, false, true);
6417 if (update_shapes) {
6419 }
6420 if (reload_objects)
6422 else
6423 clear(false, false, false, -1);
6424 }
6425
6426 return;
6427}

References clear(), m_exclude_areas, m_extruder_areas, m_extruder_heights, m_height_to_lid, m_height_to_rod, m_logo_texture_filename, m_plate_depth, m_plate_height, m_plate_width, m_shape, m_wrapping_exclude_areas, reload_all_objects(), set_shapes(), and update_all_plates_pos_and_size().

Referenced by Slic3r::GUI::CalibUtils::process_and_store_3mf(), and Slic3r::CLI::run().

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

◆ select_plate()

int Slic3r::GUI::PartPlateList::select_plate ( int index)
6935{
6936 const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
6937 if (m_plate_list.empty() || index >= m_plate_list.size()) {
6938 return -1;
6939 }
6940 const int previous_index = m_current_plate;
6941
6942 // BBS: erase unnecessary snapshot
6943 if (get_curr_plate_index() != index && m_intialized) {
6944 if (m_plater)
6945 m_plater->take_snapshot("select partplate!");
6946 }
6947
6948 std::vector<PartPlate *>::iterator it = m_plate_list.begin();
6949 for (it = m_plate_list.begin(); it != m_plate_list.end(); it++) {
6950 (*it)->set_unselected();
6951 }
6952
6953 m_current_plate = index;
6954 m_plate_list[m_current_plate]->set_selected();
6955
6956 //BBS
6957 if(m_model)
6958 m_model->curr_plate_index = index;
6959
6960 //BBS update bed origin
6961 if (m_intialized && m_plater) {
6963 m_plater->set_bed_position(pos);
6964 //wxQueueEvent(m_plater, new SimpleEvent(EVT_GLCANVAS_PLATE_SELECT));
6965 }
6966
6967 // With the other plates hidden, the view follows the selected plate.
6968 if (previous_index != index && m_intialized && m_plater != nullptr && m_plater->is_view3D_shown() && wxGetApp().focus_mode()) {
6969 Camera& camera = m_plater->get_camera();
6970 Vec3d target = camera.get_target();
6971 target.head<2>() = m_plate_list[index]->get_bounding_box().center().head<2>();
6972 camera.set_target(target);
6973 }
6974
6975 if (previous_index != index && m_intialized && m_plater != nullptr && !m_plater->is_loading_project()) {
6976 LifecycleEventContext ctx;
6977 ctx.name = m_plate_list[index]->get_plate_name();
6978 ctx.index = index;
6980 }
6981
6982 return 0;
6983}
PointType center() const
Definition BoundingBox.cpp:237
BoundingBoxf3 & get_bounding_box()
Definition PartPlate.hpp:1067
int get_curr_plate_index() const
Definition PartPlate.hpp:961
@ Camera
Definition Shortcuts.hpp:72
@ PlateSelected
Definition LifecycleEvents.hpp:43

References Slic3r::BoundingBox3Base< PointType >::center(), compute_shape_position(), Slic3r::fire_lifecycle_event(), get_bounding_box(), get_curr_plate_index(), Slic3r::GUI::Camera::get_target(), Slic3r::LifecycleEventContext::index, m_current_plate, m_intialized, m_model, m_plate_cols, m_plate_list, m_plater, m_plates_mutex, Slic3r::LifecycleEventContext::name, Slic3r::PlateSelected, and Slic3r::GUI::Camera::set_target().

Referenced by delete_plate(), init(), Slic3r::GUI::Plater::new_project(), Slic3r::CLI::run(), select_plate_by_obj(), and Slic3r::GUI::Plater::priv::set_current_panel().

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

◆ select_plate_by_obj()

int Slic3r::GUI::PartPlateList::select_plate_by_obj ( int obj_index,
int instance_index )
8004{
8005 int ret = 0, index;
8006 PartPlate* plate = NULL;
8007
8008 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": obj_id %1%, instance_id %2%") % obj_index % instance_index;
8009 index = find_instance(obj_index, instance_index);
8010 if (index != -1)
8011 {
8012 //found it in plate
8013 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(": found it in plate %1%") % index;
8014 select_plate(index);
8015 return 0;
8016 }
8017 return -1;
8018}

References find_instance(), PartPlate, and select_plate().

Referenced by Slic3r::GUI::FillBedJob::prepare().

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

◆ select_plate_view()

void Slic3r::GUI::PartPlateList::select_plate_view ( )
8030{
8032
8033 Vec3d target = m_plate_list[m_current_plate]->get_bounding_box(false).center();
8034 Vec3d position(target.x(), target.y(), m_plater->get_camera().get_distance());
8035 m_plater->get_camera().look_at(position, target, Vec3d::UnitY());
8036 m_plater->get_camera().select_view("topfront");
8037}

References m_current_plate, m_plate_list, and m_plater.

◆ serialize()

template<class Archive>
void Slic3r::GUI::PartPlateList::serialize ( Archive & ar)
inline
1125 {
1126 //ar(cereal::base_class<ObjectBase>(this));
1127 //Cancel undo/redo for m_shape ,Because the printing area of different models is different, currently if the grid changes, it cannot correspond to the model on the left ui
1129 //ar(m_plate_width, m_plate_depth, m_plate_height, m_plate_count, m_current_plate);
1130 }

References m_current_plate, m_height_limit_mode, m_height_to_lid, m_height_to_rod, m_plate_count, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, and unprintable_plate.

◆ set_default_wipe_tower_pos_for_plate()

void Slic3r::GUI::PartPlateList::set_default_wipe_tower_pos_for_plate ( int plate_idx,
bool init_pos = false )
6316{
6317 DynamicConfig & proj_cfg = wxGetApp().preset_bundle->project_config;
6318 ConfigOptionFloats *wipe_tower_x = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_x");
6319 ConfigOptionFloats *wipe_tower_y = proj_cfg.opt<ConfigOptionFloats>("wipe_tower_y");
6320 wipe_tower_x->values.resize(m_plate_list.size(), wipe_tower_x->values.front());
6321 wipe_tower_y->values.resize(m_plate_list.size(), wipe_tower_y->values.front());
6322
6323 auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
6324 // set the default position, the same with print config(left top)
6325 float x = WIPE_TOWER_DEFAULT_X_POS;
6326 float y = WIPE_TOWER_DEFAULT_Y_POS;
6327 if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) {
6330 }
6331
6332 std::string printer_type = wxGetApp().preset_bundle->printers.get_edited_preset().get_printer_type(wxGetApp().preset_bundle);
6333 // Note: printer_type == "N9" and printer_structure_opt->value == PrinterStructure::psI3 can both be true
6334 if (printer_type == "N9") {
6336 }
6337
6338 PartPlate *part_plate = get_plate(plate_idx);
6339 Vec3d plate_origin = part_plate->get_origin();
6340 BoundingBoxf3 plate_bbox = part_plate->get_bounding_box();
6341 BoundingBoxf plate_bbox_2d(Vec2d(plate_bbox.min(0), plate_bbox.min(1)), Vec2d(plate_bbox.max(0), plate_bbox.max(1)));
6342 const std::vector<Pointfs> &extruder_areas = part_plate->get_extruder_areas();
6343 for (const Pointfs &points : extruder_areas) {
6344 BoundingBoxf bboxf(points);
6345 plate_bbox_2d.min = plate_bbox_2d.min(0) >= bboxf.min(0) ? plate_bbox_2d.min : bboxf.min;
6346 plate_bbox_2d.max = plate_bbox_2d.max(0) <= bboxf.max(0) ? plate_bbox_2d.max : bboxf.max;
6347 }
6348
6349 coordf_t plate_bbox_x_min_local_coord = plate_bbox_2d.min(0) - plate_origin(0);
6350 coordf_t plate_bbox_x_max_local_coord = plate_bbox_2d.max(0) - plate_origin(0);
6351 coordf_t plate_bbox_y_max_local_coord = plate_bbox_2d.max(1) - plate_origin(1);
6352
6353 std::vector<int> filament_maps = part_plate->get_real_filament_maps(proj_cfg);
6354 // Keep this composition consistent with the apply-time injection (plate volume map, else
6355 // per-extruder defaults); the config below currently only feeds scalar reads, but a
6356 // divergent volume map would silently mis-resolve any future per-filament read here.
6357 std::vector<int> f_volume_maps = part_plate->get_filament_volume_maps();
6358 if (f_volume_maps.empty()) {
6359 f_volume_maps = wxGetApp().preset_bundle->get_default_nozzle_volume_types_for_filaments(filament_maps);
6360 }
6361 DynamicPrintConfig full_config = wxGetApp().preset_bundle->full_config(false, filament_maps, f_volume_maps);
6362 WipeTowerFootprint footprint = part_plate->estimate_wipe_tower_footprint(full_config, init_pos ? 2 : 0);
6363
6364 if (!init_pos && (is_approx(footprint.width, 0.0) || is_approx(footprint.depth, 0.0))) {
6365 footprint = part_plate->estimate_wipe_tower_footprint(full_config, 2);
6366 }
6367 Vec3d wipe_tower_size(footprint.width, footprint.depth, footprint.height);
6368
6369 // Brim-aware margin: the brim extends outward from the tower position.
6370 const float brim_width = float(footprint.brim_width);
6371 const float margin = WIPE_TOWER_AUTO_MARGIN + brim_width;
6372
6373 // clamp wipe tower position within plate boundaries
6374 {
6375 if (x + margin + wipe_tower_size(0) > plate_bbox_x_max_local_coord) {
6376 x = plate_bbox_x_max_local_coord - wipe_tower_size(0) - margin;
6377 } else if (x < margin + plate_bbox_x_min_local_coord) {
6378 x = margin + plate_bbox_x_min_local_coord;
6379 }
6380
6381 if (y + margin + wipe_tower_size(1) > plate_bbox_y_max_local_coord) {
6382 y = plate_bbox_y_max_local_coord - wipe_tower_size(1) - margin;
6383 } else if (y < margin) {
6384 y = margin;
6385 }
6386 }
6387
6388 // The bounding box above still allows a corner a delta or hexagonal bed does not have, and the
6389 // prime tower is validated against the real outline — pull it onto the bed before storing.
6390 {
6391 Polygons bed{part_plate->get_shared_printable_polygon()};
6392 bed.front().translate(Point(-scaled(plate_origin.x()), -scaled(plate_origin.y()))); // into the frame x/y live in
6393 const BoundingBox tower(Point::new_scale(x, y),
6394 Point::new_scale(x + wipe_tower_size(0), y + wipe_tower_size(1)));
6395 const Vec2f move = WipeTower::move_box_inside_polygon(tower, bed, scaled<coord_t>(margin));
6396 x += move.x();
6397 y += move.y();
6398 }
6399
6400 ConfigOptionFloat wt_x_opt(x);
6401 ConfigOptionFloat wt_y_opt(y);
6402 dynamic_cast<ConfigOptionFloats *>(proj_cfg.option("wipe_tower_x"))->set_at(&wt_x_opt, plate_idx, 0);
6403 dynamic_cast<ConfigOptionFloats *>(proj_cfg.option("wipe_tower_y"))->set_at(&wt_y_opt, plate_idx, 0);
6404}
const float N9_WIPE_TOWER_DEFAULT_Y_POS
Definition PartPlate.cpp:145
const float WIPE_TOWER_DEFAULT_Y_POS
Definition PartPlate.cpp:143
const float WIPE_TOWER_DEFAULT_X_POS
Definition PartPlate.cpp:142
const float I3_WIPE_TOWER_DEFAULT_X_POS
Definition PartPlate.cpp:147
const float I3_WIPE_TOWER_DEFAULT_Y_POS
Definition PartPlate.cpp:148
void set_at(const ConfigOption *rhs, size_t i, size_t j) override
Definition Config.hpp:451
static Point new_scale(coordf_t x, coordf_t y)
Definition Point.hpp:214
static Vec2f move_box_inside_polygon(const BoundingBox &box, const Polygons &polygons, coord_t offset=0)
Definition WipeTower.cpp:1826
static constexpr double WIPE_TOWER_AUTO_MARGIN
Definition libslic3r.h:103
double coordf_t
Definition GUI_ObjectLayers.hpp:26
Kernel::Point_3 Point
Definition MeshRepair.cpp:81
zaa_minimize_perimeter_height ConfigOptionFloat
Definition PrintConfig.hpp:1954
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:22
constexpr bool is_approx(Number value, Number test_value, Number precision=EPSILON)
Definition libslic3r.h:320
@ psI3
Definition PrintConfig.hpp:560
Eigen::Matrix< float, 2, 1, Eigen::DontAlign > Vec2f
Definition Point.hpp:64

References Slic3r::WipeTowerFootprint::brim_width, Slic3r::WipeTowerFootprint::depth, Slic3r::GUI::PartPlate::estimate_wipe_tower_footprint(), Slic3r::GUI::PartPlate::get_bounding_box(), Slic3r::GUI::PartPlate::get_extruder_areas(), Slic3r::GUI::PartPlate::get_filament_volume_maps(), Slic3r::GUI::PartPlate::get_origin(), get_plate(), Slic3r::GUI::PartPlate::get_real_filament_maps(), Slic3r::GUI::PartPlate::get_shared_printable_polygon(), Slic3r::WipeTowerFootprint::height, I3_WIPE_TOWER_DEFAULT_X_POS, I3_WIPE_TOWER_DEFAULT_Y_POS, Slic3r::is_approx(), m_plate_list, Slic3r::BoundingBoxBase< PointType, APointsType >::max, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, Slic3r::BoundingBoxBase< PointType, APointsType >::min, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min, Slic3r::WipeTower::move_box_inside_polygon(), N9_WIPE_TOWER_DEFAULT_Y_POS, Slic3r::Point::new_scale(), Slic3r::DynamicConfig::opt(), Slic3r::ConfigBase::option(), PartPlate, Slic3r::psI3, Slic3r::scaled(), Slic3r::ConfigOptionVector< double >::values, Slic3r::WipeTowerFootprint::width, WIPE_TOWER_AUTO_MARGIN, WIPE_TOWER_DEFAULT_X_POS, WIPE_TOWER_DEFAULT_Y_POS, and Slic3r::wipe_tower_y().

Referenced by create_plate(), reinit(), update_all_plates_pos_and_size(), and Slic3r::GUI::Plater::priv::update_objects_position_when_select_preset().

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

◆ set_filament_count()

void Slic3r::GUI::PartPlateList::set_filament_count ( int filament_count)
9174{
9175 m_filament_count = filament_count;
9176 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
9177 {
9178 m_plate_list[i]->set_filament_count(filament_count);
9179 }
9180 BOOST_LOG_TRIVIAL(info) << boost::format("%1%: filament_count=%2%")% __FUNCTION__ %filament_count;
9181}

References m_filament_count, and m_plate_list.

Referenced by load_from_3mf_structure(), and Slic3r::GUI::Plater::on_filament_count_change().

Here is the caller graph for this function:

◆ set_height_limits_mode()

void Slic3r::GUI::PartPlateList::set_height_limits_mode ( PartPlate::HeightLimitMode mode)
inline
957 {
958 m_height_limit_mode = mode;
959 }

References m_height_limit_mode.

◆ set_hover_id()

void Slic3r::GUI::PartPlateList::set_hover_id ( int id)
6986{
6987 int index = id / PartPlate::GRABBER_COUNT;
6988 int sub_hover_id = id % PartPlate::GRABBER_COUNT;
6989 m_plate_list[index]->set_hover_id(sub_hover_id);
6990}

References Slic3r::GUI::PartPlate::GRABBER_COUNT, and m_plate_list.

◆ set_invalid_id()

void Slic3r::ObjectBase::set_invalid_id ( )
inlineprotectedinherited
90{ m_id = 0; }

References m_id.

Referenced by Slic3r::CutObjectBase::invalidate().

Here is the caller graph for this function:

◆ set_new_unique_id()

void Slic3r::ObjectBase::set_new_unique_id ( )
inlineprotectedinherited
89{ m_id = generate_new_id(); }
static ObjectID generate_new_id()
Definition ObjectID.hpp:100

References generate_new_id(), and m_id.

Referenced by Slic3r::ModelVolume::ModelVolume(), Slic3r::Model::assign_new_unique_ids_recursive(), Slic3r::ModelVolume::assign_new_unique_ids_recursive(), assign_new_unique_ids_recursive(), Slic3r::CutObjectBase::init(), Slic3r::ModelMaterial::set_new_unique_id(), Slic3r::ModelObject::set_new_unique_id(), and Slic3r::ModelVolume::set_new_unique_id().

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

◆ set_render_cali()

void Slic3r::GUI::PartPlateList::set_render_cali ( bool value = true)
inline
1059{ render_cali_logo = value; }
bool render_cali_logo
Definition PartPlate.hpp:828

References render_cali_logo.

◆ set_render_option()

void Slic3r::GUI::PartPlateList::set_render_option ( bool bedtype_texture,
bool plate_settings )
7998{
7999 render_bedtype_logo = bedtype_texture;
8000 render_plate_settings = plate_settings;
8001}
bool render_plate_settings
Definition PartPlate.hpp:827

References render_bedtype_logo, and render_plate_settings.

◆ set_shapes()

bool Slic3r::GUI::PartPlateList::set_shapes ( const Pointfs & shape,
const Pointfs & exclude_areas,
const Pointfs & wrapping_exclude_areas,
const std::vector< Pointfs > & extruder_areas,
const std::vector< double > & extruder_heights,
const std::string & custom_texture,
float height_to_lid,
float height_to_rod )
8047{
8048 const std::lock_guard<std::mutex> local_lock(m_plates_mutex);
8049 m_shape = shape;
8050 m_exclude_areas = exclude_areas;
8051 m_wrapping_exclude_areas = wrapping_exclude_areas;
8052 m_extruder_areas = extruder_areas;
8053 m_extruder_heights = extruder_heights;
8054 m_height_to_lid = height_to_lid;
8055 m_height_to_rod = height_to_rod;
8056
8057 double stride_x = plate_stride_x();
8058 double stride_y = plate_stride_y();
8059 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8060 {
8061 PartPlate* plate = m_plate_list[i];
8062 assert(plate != NULL);
8063
8064 Vec2d pos;
8065
8067 plate->set_shape(shape, exclude_areas, extruder_areas, extruder_heights, pos, height_to_lid, height_to_rod);
8068 }
8069 is_load_bedtype_textures = false; //reload textures
8070 is_load_extruder_only_area_textures = false; // reload textures
8074
8075 update_logo_texture_filename(texture_filename);
8076
8077 return true;
8078}
void update_logo_texture_filename(const std::string &texture_filename)
Definition PartPlate.cpp:8080

References calc_bounding_boxes(), compute_shape_position(), is_load_bedtype_textures, is_load_extruder_only_area_textures, m_exclude_areas, m_extruder_areas, m_extruder_heights, m_height_to_lid, m_height_to_rod, m_next_bedtype_texture, m_next_extruder_only_area_texture, m_plate_cols, m_plate_list, m_plates_mutex, m_shape, m_wrapping_exclude_areas, PartPlate, plate_stride_x(), plate_stride_y(), Slic3r::GUI::PartPlate::set_shape(), and update_logo_texture_filename().

Referenced by create_plate(), delete_plate(), rebuild_plates_after_deserialize(), reset_size(), Slic3r::CLI::run(), and update_plates().

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

◆ show_cali_texture()

void Slic3r::GUI::PartPlateList::show_cali_texture ( bool show = true)

◆ store_to_3mf_structure()

int Slic3r::GUI::PartPlateList::store_to_3mf_structure ( PlateDataPtrs & plate_data_list,
bool with_slice_info = true,
int plate_idx = -1,
bool with_statistics = false )
8394{
8395 int ret = 0;
8396
8397 plate_data_list.clear();
8398 plate_data_list.reserve(m_plate_list.size());
8399 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
8400 {
8401 PlateData* plate_data_item = new PlateData();
8402 // TODO: write if needed
8403 plate_data_item->filament_maps = m_plate_list[i]->get_filament_maps();
8404 plate_data_item->locked = m_plate_list[i]->m_locked;
8405 plate_data_item->plate_index = m_plate_list[i]->m_plate_index;
8406 plate_data_item->plate_name = m_plate_list[i]->get_plate_name();
8407 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1% before load, width %2%, height %3%, size %4%!")
8408 %(i+1) %m_plate_list[i]->thumbnail_data.width %m_plate_list[i]->thumbnail_data.height %m_plate_list[i]->thumbnail_data.pixels.size();
8409 plate_data_item->plate_thumbnail.load_from(m_plate_list[i]->thumbnail_data);
8410 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": plate %1% after load, width %2%, height %3%, size %4%!")
8411 %(i+1) %plate_data_item->plate_thumbnail.width %plate_data_item->plate_thumbnail.height %plate_data_item->plate_thumbnail.pixels.size();
8412 plate_data_item->config.apply(*m_plate_list[i]->config());
8413
8414 if (m_plate_list[i]->no_light_thumbnail_data.is_valid())
8415 plate_data_item->no_light_thumbnail_file = "valid_no_light";
8416 if (m_plate_list[i]->top_thumbnail_data.is_valid())
8417 plate_data_item->top_file = "valid_top";
8418 if (m_plate_list[i]->pick_thumbnail_data.is_valid())
8419 plate_data_item->pick_file = "valid_pick";
8420
8421 if (m_plate_list[i]->obj_to_instance_set.size() > 0)
8422 {
8423 for (std::set<std::pair<int, int>>::iterator it = m_plate_list[i]->obj_to_instance_set.begin(); it != m_plate_list[i]->obj_to_instance_set.end(); ++it)
8424 plate_data_item->objects_and_instances.emplace_back(it->first, it->second);
8425 }
8426
8427 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ <<boost::format(": plate %1%, gcode_filename=%2%, with_slice_info=%3%, slice_valid %4%, object item count %5%.")
8428 %i %m_plate_list[i]->m_gcode_result->filename % with_slice_info %m_plate_list[i]->is_slice_result_valid()%plate_data_item->objects_and_instances.size();
8429
8430 if (with_slice_info) {
8431 if (m_plate_list[i]->get_slice_result() && m_plate_list[i]->is_slice_result_valid()) {
8432 // BBS only include current palte_idx
8433 if (plate_idx == i || plate_idx == PLATE_CURRENT_IDX || plate_idx == PLATE_ALL_IDX) {
8434 //load calibration thumbnail
8435 //if (m_plate_list[i]->cali_thumbnail_data.is_valid())
8436 // plate_data_item->pattern_file = "valid_pattern";
8437 if (m_plate_list[i]->cali_bboxes_data.is_valid())
8438 plate_data_item->pattern_bbox_file = "valid_pattern_bbox";
8439 plate_data_item->gcode_file = m_plate_list[i]->m_gcode_result->filename;
8440 plate_data_item->is_sliced_valid = true;
8441 plate_data_item->gcode_prediction = std::to_string(
8442 (int) m_plate_list[i]->get_slice_result()->print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time);
8443 plate_data_item->toolpath_outside = m_plate_list[i]->m_gcode_result->toolpath_outside;
8444 plate_data_item->timelapse_warning_code = m_plate_list[i]->m_gcode_result->timelapse_warning_code;
8445 m_plate_list[i]->set_timelapse_warning_code(plate_data_item->timelapse_warning_code);
8446 plate_data_item->is_label_object_enabled = m_plate_list[i]->m_gcode_result->label_object_enabled;
8447 plate_data_item->limit_filament_maps = m_plate_list[i]->m_gcode_result->limit_filament_maps;
8448 plate_data_item->layer_filaments = m_plate_list[i]->m_gcode_result->layer_filaments;
8449 plate_data_item->filament_change_sequence = m_plate_list[i]->m_gcode_result->filament_change_sequence;
8450 plate_data_item->nozzle_change_sequence = m_plate_list[i]->m_gcode_result->nozzle_change_sequence;
8451 plate_data_item->optimal_assignment = m_plate_list[i]->m_gcode_result->optimal_assignment;
8452 plate_data_item->first_layer_time = std::to_string(m_plate_list[i]->get_slice_result()->initial_layer_time);
8453 Print *print = nullptr;
8454 m_plate_list[i]->get_print((PrintBase **) &print, nullptr, nullptr);
8455 if (print) {
8456 const PrintStatistics &ps = print->print_statistics();
8457 if (ps.total_weight != 0.0) {
8458 CNumericLocalesSetter locales_setter;
8459 plate_data_item->gcode_weight =wxString::Format("%.2f", ps.total_weight).ToStdString();
8460 }
8461 plate_data_item->is_support_used = print->is_support_used();
8462 } else {
8463 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format("print is null!");
8464 }
8465 //parse filament info
8466 plate_data_item->parse_filament_info(m_plate_list[i]->get_slice_result());
8467 if (with_statistics)
8468 plate_data_item->statistics = gcode_statistics_json(*m_plate_list[i]->get_slice_result());
8469
8470 // Record mixed (virtual) filaments actually used on this plate.
8471 // Source is ToolOrdering::used_mixed_filaments (slots that appeared in
8472 // layer tools before resolve), persisted on GCodeProcessorResult / Print —
8473 // not print->extruders() which only reflects assignment.
8474 {
8475 std::vector<unsigned int> used_mixed;
8476 if (auto *slice_result = m_plate_list[i]->get_slice_result())
8477 used_mixed = slice_result->used_mixed_filaments;
8478 if (used_mixed.empty() && print)
8479 used_mixed = print->get_slice_used_mixed_filaments();
8480 if (!used_mixed.empty() && print) {
8481 const auto &fila_types = print->config().filament_type.values;
8482 const auto &fila_colors = print->config().filament_colour.values;
8483 const auto &fila_comps = print->config().filament_mixed_components.values;
8484 for (unsigned int fid : used_mixed) {
8485 PlateMixedFilamentInfo mixed_info;
8486 mixed_info.id = (int) fid + 1;
8487 if (fid < fila_types.size()) mixed_info.type = fila_types[fid];
8488 if (fid < fila_colors.size()) mixed_info.color = fila_colors[fid];
8489 if (fid < fila_comps.size()) mixed_info.components = fila_comps[fid];
8490 plate_data_item->mixed_filaments_info.push_back(mixed_info);
8491 }
8492 }
8493 }
8494 } else {
8495 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "slice result = " << m_plate_list[i]->get_slice_result()
8496 << ", result valid = " << m_plate_list[i]->is_slice_result_valid();
8497 }
8498 }
8499 }
8500
8501 plate_data_list.push_back(plate_data_item);
8502 }
8503 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":stored %1% plates!") % m_plate_list.size();
8504
8505 return ret;
8506}
#define PLATE_ALL_IDX
Definition PartPlate.hpp:57
#define PLATE_CURRENT_IDX
Definition PartPlate.hpp:56
std::string gcode_statistics_json(const GCodeProcessorResult &result)
Definition GCodeStatistics.cpp:69

References Slic3r::ConfigBase::apply(), Slic3r::PlateMixedFilamentInfo::color, Slic3r::PlateMixedFilamentInfo::components, Slic3r::PlateData::config, Slic3r::PlateData::filament_change_sequence, Slic3r::PlateData::filament_maps, Slic3r::PlateData::first_layer_time, Slic3r::PlateData::gcode_file, Slic3r::PlateData::gcode_prediction, Slic3r::gcode_statistics_json(), Slic3r::PlateData::gcode_weight, Slic3r::ThumbnailData::height, Slic3r::PlateMixedFilamentInfo::id, Slic3r::PlateData::is_label_object_enabled, Slic3r::PlateData::is_sliced_valid, Slic3r::PlateData::is_support_used, Slic3r::PlateData::layer_filaments, Slic3r::PlateData::limit_filament_maps, Slic3r::ThumbnailData::load_from(), Slic3r::PlateData::locked, m_plate_list, Slic3r::PlateData::mixed_filaments_info, Slic3r::PlateData::no_light_thumbnail_file, Slic3r::PrintEstimatedStatistics::Normal, Slic3r::PlateData::nozzle_change_sequence, Slic3r::PlateData::objects_and_instances, Slic3r::PlateData::optimal_assignment, Slic3r::PlateData::parse_filament_info(), Slic3r::PlateData::pattern_bbox_file, Slic3r::PlateData::pick_file, Slic3r::ThumbnailData::pixels, PLATE_ALL_IDX, PLATE_CURRENT_IDX, Slic3r::PlateData::plate_index, Slic3r::PlateData::plate_name, Slic3r::PlateData::plate_thumbnail, print(), Slic3r::PlateData::statistics, Slic3r::PlateData::timelapse_warning_code, Slic3r::PlateData::toolpath_outside, Slic3r::PlateData::top_file, Slic3r::PrintStatistics::total_weight, Slic3r::PlateMixedFilamentInfo::type, and Slic3r::ThumbnailData::width.

Referenced by Slic3r::GUI::CalibUtils::process_and_store_3mf(), and Slic3r::CLI::run().

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

◆ timestamp()

virtual Timestamp Slic3r::ObjectBase::timestamp ( ) const
inlinevirtualinherited

Reimplemented in Slic3r::ModelConfigObject, and Slic3r::ObjectWithTimestamp.

74{ return 0; }

◆ update_all_plates_pos_and_size()

void Slic3r::GUI::PartPlateList::update_all_plates_pos_and_size ( bool adjust_position = true,
bool with_unprintable_move = true,
bool switch_plate_type = false,
bool do_clear = true )
7068{
7069 Vec3d origin1, origin2;
7070 for (unsigned int i = 0; i < (unsigned int)m_plate_list.size(); ++i)
7071 {
7072 PartPlate* plate = m_plate_list[i];
7073 assert(plate != NULL);
7074
7075 //compute origin1 for PartPlate
7076 origin1 = compute_origin(i, m_plate_cols);
7077 plate->set_pos_and_size(origin1, m_plate_width, m_plate_depth, m_plate_height, adjust_position, do_clear);
7078
7079 // set default wipe pos when switch plate
7080 if (switch_plate_type && m_plater/* && plate->get_used_extruders().size() <= 0*/) {
7082 }
7083 }
7084
7086 unprintable_plate.set_pos_and_size(origin2, m_plate_width, m_plate_depth, m_plate_height, with_unprintable_move);
7087}

References compute_origin(), compute_origin_for_unprintable(), m_plate_cols, m_plate_depth, m_plate_height, m_plate_list, m_plate_width, m_plater, PartPlate, set_default_wipe_tower_pos_for_plate(), Slic3r::GUI::PartPlate::set_pos_and_size(), and unprintable_plate.

Referenced by create_plate(), delete_plate(), rebuild_plates_after_deserialize(), reset_size(), and update_plates().

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

◆ update_current_slice_result_state()

void Slic3r::GUI::PartPlateList::update_current_slice_result_state ( bool valid)
inline
1100{ m_plate_list[m_current_plate]->update_slice_result_valid_state(valid); }

References m_current_plate, and m_plate_list.

◆ update_logo_texture_filename()

void Slic3r::GUI::PartPlateList::update_logo_texture_filename ( const std::string & texture_filename)
8081{
8082 auto check_texture = [](const std::string &texture) {
8083 boost::system::error_code ec; // so the exists call does not throw (e.g. after a permission problem)
8084 return !texture.empty() && (boost::algorithm::iends_with(texture, ".png") || boost::algorithm::iends_with(texture, ".svg")) && boost::filesystem::exists(texture, ec);
8085 };
8086 if (!texture_filename.empty() && !check_texture(texture_filename)) {
8088 BOOST_LOG_TRIVIAL(error) << "Unable to load bed texture: " << texture_filename;
8089 } else {
8090 m_logo_texture_filename = texture_filename;
8092 }
8093}
void slash_to_back_slash(std::string &file_path)
Definition FileHelp.cpp:26

References m_logo_texture_filename, and Slic3r::Utils::slash_to_back_slash().

Referenced by set_shapes().

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

◆ update_plate_cols()

void Slic3r::GUI::PartPlateList::update_plate_cols ( )
7059{
7060 m_plate_count = m_plate_list.size();
7061
7063 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(":m_plate_count %1%, m_plate_cols change to %2%") % m_plate_count % m_plate_cols;
7064 return;
7065}

References compute_colum_count(), m_plate_cols, m_plate_count, and m_plate_list.

Referenced by create_plate(), delete_plate(), and rebuild_plates_after_deserialize().

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

◆ update_plates()

void Slic3r::GUI::PartPlateList::update_plates ( )

◆ update_slice_context_to_current_plate()

void Slic3r::GUI::PartPlateList::update_slice_context_to_current_plate ( BackgroundSlicingProcess & process)
8098{
8099 PartPlate* current_plate;
8100
8101 current_plate = m_plate_list[m_current_plate];
8102 assert(current_plate != NULL);
8103
8104 current_plate->update_slice_context(process);
8105
8106 return;
8107}

References m_current_plate, m_plate_list, PartPlate, and Slic3r::GUI::PartPlate::update_slice_context().

Referenced by Slic3r::GUI::Plater::priv::undo_redo_to(), and Slic3r::GUI::Plater::priv::update_background_process().

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

◆ cereal::access

friend class cereal::access
friend

References cereal::access.

Referenced by cereal::access.

◆ PartPlate

◆ UndoRedo::StackImpl

friend class UndoRedo::StackImpl
friend

Member Data Documentation

◆ bed_texture_info

BedTextureInfo Slic3r::GUI::PartPlateList::bed_texture_info[btCount]

◆ bed_textures

GLTexture Slic3r::GUI::PartPlateList::bed_textures[(unsigned int) btCount]
static

◆ cali_texture_info

BedTextureInfo Slic3r::GUI::PartPlateList::cali_texture_info

◆ extruder_only_area_info

◆ is_load_bedtype_textures

bool Slic3r::GUI::PartPlateList::is_load_bedtype_textures = false
static

◆ is_load_cali_texture

bool Slic3r::GUI::PartPlateList::is_load_cali_texture = false
static

◆ is_load_extruder_only_area_textures

bool Slic3r::GUI::PartPlateList::is_load_extruder_only_area_textures = false
static

◆ m_allow_bed_type_in_double_nozzle

std::map<int, bool> Slic3r::GUI::PartPlateList::m_allow_bed_type_in_double_nozzle

Referenced by init_bed_type_info().

◆ m_arrange_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_arrange_hovered_texture
private

◆ m_arrange_texture

GLTexture Slic3r::GUI::PartPlateList::m_arrange_texture
private

◆ m_bounding_box

BoundingBoxf3 Slic3r::GUI::PartPlateList::m_bounding_box
private

◆ m_current_plate

◆ m_del_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_del_hovered_texture
private

◆ m_del_texture

GLTexture Slic3r::GUI::PartPlateList::m_del_texture
private

◆ m_exclude_areas

◆ m_extruder_areas

std::vector<Pointfs> Slic3r::GUI::PartPlateList::m_extruder_areas
private

◆ m_extruder_heights

std::vector<double> Slic3r::GUI::PartPlateList::m_extruder_heights
private

◆ m_filament_count

int Slic3r::GUI::PartPlateList::m_filament_count = 1
private

◆ m_gcode_result_list

std::map<int, GCodeResult*> Slic3r::GUI::PartPlateList::m_gcode_result_list
private

◆ m_height_limit_mode

PartPlate::HeightLimitMode Slic3r::GUI::PartPlateList::m_height_limit_mode {PartPlate::HEIGHT_LIMIT_BOTH}
private
@ HEIGHT_LIMIT_BOTH
Definition PartPlate.hpp:114

Referenced by render(), serialize(), and set_height_limits_mode().

◆ m_height_to_lid

float Slic3r::GUI::PartPlateList::m_height_to_lid
private

◆ m_height_to_rod

float Slic3r::GUI::PartPlateList::m_height_to_rod
private

◆ m_hover_tooltip

std::string Slic3r::GUI::PartPlateList::m_hover_tooltip
private

◆ m_icon_textures_dark

bool Slic3r::GUI::PartPlateList::m_icon_textures_dark = false
private

◆ m_id

ObjectID Slic3r::ObjectBase::m_id
privateinherited

◆ m_idx_textures

GLTexture Slic3r::GUI::PartPlateList::m_idx_textures[MAX_PLATE_COUNT]
private

◆ m_imex_mode_hovered_textures

std::array<GLTexture, 4> Slic3r::GUI::PartPlateList::m_imex_mode_hovered_textures
private

◆ m_imex_mode_textures

std::array<GLTexture, 4> Slic3r::GUI::PartPlateList::m_imex_mode_textures
private

◆ m_imex_warn_texture

GLTexture Slic3r::GUI::PartPlateList::m_imex_warn_texture
private

◆ m_intialized

bool Slic3r::GUI::PartPlateList::m_intialized
private

◆ m_is_dark

bool Slic3r::GUI::PartPlateList::m_is_dark = false
private

◆ m_locked_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_locked_hovered_texture
private

◆ m_locked_texture

GLTexture Slic3r::GUI::PartPlateList::m_locked_texture
private

◆ m_lockopen_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_lockopen_hovered_texture
private

◆ m_lockopen_texture

GLTexture Slic3r::GUI::PartPlateList::m_lockopen_texture
private

◆ m_logo_texture

GLTexture Slic3r::GUI::PartPlateList::m_logo_texture
private

◆ m_logo_texture_filename

◆ m_model

◆ m_move_front_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_move_front_hovered_texture
private

◆ m_move_front_texture

GLTexture Slic3r::GUI::PartPlateList::m_move_front_texture
private

◆ m_next_bedtype_texture

size_t Slic3r::GUI::PartPlateList::m_next_bedtype_texture { 0 }
private

◆ m_next_cali_texture

size_t Slic3r::GUI::PartPlateList::m_next_cali_texture { 0 }
private
1178{ 0 };

Referenced by load_next_cali_texture(), and release_icon_textures().

◆ m_next_extruder_only_area_texture

size_t Slic3r::GUI::PartPlateList::m_next_extruder_only_area_texture { 0 }
private

◆ m_orient_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_orient_hovered_texture
private

◆ m_orient_texture

GLTexture Slic3r::GUI::PartPlateList::m_orient_texture
private

◆ m_plate_cols

◆ m_plate_count

int Slic3r::GUI::PartPlateList::m_plate_count
private

◆ m_plate_depth

◆ m_plate_height

◆ m_plate_list

std::vector<PartPlate*> Slic3r::GUI::PartPlateList::m_plate_list
private

Referenced by add_to_plate(), calc_bounding_boxes(), check_all_plate_local_bed_type(), clear(), construct_objects_list_for_new_plate(), contains(), create_plate(), delete_plate(), find_instance(), find_instance(), find_instance_belongs(), find_plate_by_print_index(), get_curr_plate(), get_curr_plate(), get_current_fff_print(), get_current_slice_result(), get_extruders(), get_nonempty_plate_list(), get_plate(), get_plate_count(), get_plate_list(), get_selected_plate(), get_sliced_result(), init(), intersects(), invalid_all_slice_result(), invalidate_all_imex_ghosts(), invalidate_exclusion_volume_previews(), is_all_plates_ready_for_slice(), is_all_slice_result_ready_for_export(), is_all_slice_results_ready_for_print(), is_all_slice_results_valid(), is_locked(), load_from_3mf_structure(), load_gcode_files(), lock_plate(), move_plate_to_index(), notify_instance_removed(), notify_instance_update(), on_extruder_count_changed(), on_filament_added(), on_filament_deleted(), postprocess_bed_index_for_current_plate(), postprocess_bed_index_for_selected(), postprocess_bed_index_for_unselected(), preprocess_arrange_polygon(), preprocess_arrange_polygon_other_locked(), preprocess_exclude_areas(), preprocess_nonprefered_areas(), print(), rebuild_plates_after_arrangement(), rebuild_plates_after_deserialize(), refresh_imex_icons(), register_raycasters_for_picking(), reinit(), reload_all_objects(), render(), render_exclusion_volume_intersections(), reset(), reset_hover_id(), select_plate(), select_plate_view(), serialize(), set_default_wipe_tower_pos_for_plate(), set_filament_count(), set_hover_id(), set_shapes(), store_to_3mf_structure(), update_all_plates_pos_and_size(), update_current_slice_result_state(), update_plate_cols(), and update_slice_context_to_current_plate().

◆ m_plate_name_edit_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_name_edit_hovered_texture
private

◆ m_plate_name_edit_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_name_edit_texture
private

◆ m_plate_set_filament_map_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_set_filament_map_hovered_texture
private

◆ m_plate_set_filament_map_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_set_filament_map_texture
private

◆ m_plate_settings_changed_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_settings_changed_hovered_texture
private

Referenced by generate_icon_textures().

◆ m_plate_settings_changed_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_settings_changed_texture
private

Referenced by generate_icon_textures().

◆ m_plate_settings_hovered_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_settings_hovered_texture
private

◆ m_plate_settings_texture

GLTexture Slic3r::GUI::PartPlateList::m_plate_settings_texture
private

◆ m_plate_width

◆ m_plater

◆ m_plates_mutex

std::mutex Slic3r::GUI::PartPlateList::m_plates_mutex
private

◆ m_print_index

int Slic3r::GUI::PartPlateList::m_print_index
private

◆ m_print_list

std::map<int, PrintBase*> Slic3r::GUI::PartPlateList::m_print_list
private

◆ m_shape

◆ m_wrapping_exclude_areas

◆ MAX_PLATES_COUNT

◆ printer_technology

PrinterTechnology Slic3r::GUI::PartPlateList::printer_technology
private

◆ render_bedtype_logo

bool Slic3r::GUI::PartPlateList::render_bedtype_logo = true
private

◆ render_cali_logo

bool Slic3r::GUI::PartPlateList::render_cali_logo = true
private

Referenced by set_render_cali().

◆ render_plate_settings

bool Slic3r::GUI::PartPlateList::render_plate_settings = true
private

Referenced by set_render_option().

◆ s_last_id

size_t Slic3r::ObjectBase::s_last_id = 0
staticprivateinherited

Referenced by generate_new_id().

◆ unprintable_plate


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