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

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

Inheritance diagram for Slic3r::GUI::ObjectTablePanel:
Collaboration diagram for Slic3r::GUI::ObjectTablePanel:

Public Member Functions

void OnCellLeftClick (wxGridEvent &)
void OnRowSize (wxGridSizeEvent &)
void OnColSize (wxGridSizeEvent &)
void OnSelectCell (wxGridEvent &)
void OnRangeSelected (wxGridRangeSelectEvent &)
void OnCellValueChanged (wxGridEvent &)
 ObjectTablePanel (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style, const wxString &name, Plater *platerObj, Model *modelObj)
 ~ObjectTablePanel ()
void load_data ()
void SetSelection (int object_id, int volume_id)
void sort_by_default ()
wxSize get_init_size ()
void resetAllValuesInSideWindow (int row, bool is_object, ModelObject *object, ModelConfig *config, const std::string &category)
void msw_rescale ()
void set_default_filaments_and_colors ()

Public Attributes

int range_select_left_col
int range_select_right_col
int range_select_top_row
int range_select_bottom_row
std::vector< wxString > m_filaments_name
std::vector< wxColour > m_filaments_colors
int m_filaments_count { 1 }

Private Member Functions

int init_bitmap ()
int init_filaments_and_colors ()
 wxDECLARE_ABSTRACT_CLASS (ObjectGrid)
 wxDECLARE_EVENT_TABLE ()

Private Attributes

wxColour m_bg_colour
wxColour m_hover_colour
wxBoxSizer * m_top_sizer {nullptr}
wxBoxSizer * m_page_sizer {nullptr}
ObjectGrid * m_object_grid {nullptr}
ObjectGridTable * m_object_grid_table {nullptr}
wxScrolledWindow * m_side_window {nullptr}
ObjectTableSettings * m_object_settings { nullptr }
Model * m_model {nullptr}
Plater * m_plater {nullptr}
int m_cur_row { -1 }
int m_cur_col { -1 }
wxFloatingPointValidator< float > m_float_validator
wxBitmap m_undo_bitmap
std::vector< wxBitmap * > m_color_bitmaps
ScalableBitmap m_bmp_reset
ScalableBitmap m_bmp_reset_disable

Friends

class ObjectGridTable

Detailed Description

Constructor & Destructor Documentation

◆ ObjectTablePanel()

Slic3r::GUI::ObjectTablePanel::ObjectTablePanel ( wxWindow * parent,
wxWindowID id,
const wxPoint & pos,
const wxSize & size,
long style,
const wxString & name,
Plater * platerObj,
Model * modelObj )

References style.

◆ ~ObjectTablePanel()

Slic3r::GUI::ObjectTablePanel::~ObjectTablePanel ( )
3209{
3210 //do it in the grid
3211 /*if (m_object_grid_table) {
3212 m_object_grid_table->release_object_configs();
3213 delete m_object_grid_table;
3214 m_object_grid_table = nullptr;
3215 }*/
3216 if (m_top_sizer)
3217 m_top_sizer->Clear(true);
3218 delete m_object_settings;
3219
3220 m_filaments_name.clear();
3221 m_filaments_colors.clear();
3222}
std::vector< wxString > m_filaments_name
Definition GUI_ObjectTable.hpp:593
wxBoxSizer * m_top_sizer
Definition GUI_ObjectTable.hpp:606
ObjectTableSettings * m_object_settings
Definition GUI_ObjectTable.hpp:611
std::vector< wxColour > m_filaments_colors
Definition GUI_ObjectTable.hpp:594

References m_filaments_colors, m_filaments_name, m_object_settings, and m_top_sizer.

Member Function Documentation

◆ get_init_size()

wxSize Slic3r::GUI::ObjectTablePanel::get_init_size ( )
3312{
3313 wxSize size;
3314 int width = 0, height = 0;
3315
3316 //compute height
3317 int row_count = m_object_grid_table->GetNumberRows();
3318 if (row_count >= g_overflow_row_count) {
3319 height = row_count * g_min_row_size;
3320 }
3321 else {
3322 for (int index = 0; index < m_object_grid_table->GetNumberRows(); index++)
3323 {
3324 height += m_object_grid->GetRowSize(index);
3325 }
3326 }
3328
3329 if (height < (g_min_row_count * g_min_row_size))
3331
3332 //compute width
3333 for (int index = 0; index < m_object_grid_table->GetNumberCols(); index++)
3334 {
3335 width += m_object_grid->GetColSize(index);
3336 }
3338
3339 size.Set(width, height);
3340
3341 return size;
3342}
ObjectGridTable * m_object_grid_table
Definition GUI_ObjectTable.hpp:609
ObjectGrid * m_object_grid
Definition GUI_ObjectTable.hpp:608
static const int g_min_row_size
Definition GUI_ObjectTable.cpp:70
static const int g_min_setting_width
Definition GUI_ObjectTable.cpp:73
static const int g_min_row_count
Definition GUI_ObjectTable.cpp:66
static const int g_extra_height
Definition GUI_ObjectTable.cpp:71
static const int g_vscroll_width
Definition GUI_ObjectTable.cpp:74
static const int g_overflow_row_count
Definition GUI_ObjectTable.cpp:69
coord_t width(const BoundingBox &box)
Definition Arrange.cpp:1184
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185

References Slic3r::GUI::g_extra_height, Slic3r::GUI::g_min_row_count, Slic3r::GUI::g_min_row_size, Slic3r::GUI::g_min_setting_width, Slic3r::GUI::g_overflow_row_count, Slic3r::GUI::g_vscroll_width, m_object_grid, and m_object_grid_table.

Referenced by OnColSize(), and OnRowSize().

Here is the caller graph for this function:

◆ init_bitmap()

int Slic3r::GUI::ObjectTablePanel::init_bitmap ( )
private
2865{
2866 m_undo_bitmap = create_scaled_bitmap("lock_normal", nullptr, 18);
2868
2869 return 0;
2870}
wxBitmap m_undo_bitmap
Definition GUI_ObjectTable.hpp:622
std::vector< wxBitmap * > m_color_bitmaps
Definition GUI_ObjectTable.hpp:623
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448
std::vector< wxBitmap * > get_extruder_color_icons(bool thin_icon)
Definition wxExtensions.cpp:572

References create_scaled_bitmap(), get_extruder_color_icons(), m_color_bitmaps, and m_undo_bitmap.

Here is the call graph for this function:

◆ init_filaments_and_colors()

int Slic3r::GUI::ObjectTablePanel::init_filaments_and_colors ( )
private
2873{
2874 //DynamicPrintConfig& global_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
2875 const DynamicPrintConfig* global_config = m_plater->config();
2876 const std::vector<std::string> filament_presets = wxGetApp().preset_bundle->filament_presets;
2877 m_filaments_count = filament_presets.size();
2878 if (m_filaments_count <= 0) {
2879 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(", can not get filaments, count: %1%, set to default") %m_filaments_count;
2881 return -1;
2882 }
2883
2884 const ConfigOptionStrings* filament_opt = dynamic_cast<const ConfigOptionStrings*>(global_config->option("filament_colour"));
2885 if (filament_opt == nullptr) {
2887 return -1;
2888 }
2891 unsigned int color_count = filament_opt->values.size();
2892 if (color_count != m_filaments_count) {
2893 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << boost::format(", invalid color count:%1%, extruder count: %2%") %color_count %m_filaments_count;
2894 }
2895
2896 unsigned int i = 0;
2897 ColorRGB rgb;
2898 while (i < m_filaments_count) {
2899 const std::string& txt_color = global_config->opt_string("filament_colour", i);
2900 if (i < color_count) {
2901 if (decode_color(txt_color, rgb))
2902 {
2903 m_filaments_colors[i] = wxColour(rgb.r_uchar(), rgb.g_uchar(), rgb.b_uchar());
2904 }
2905 else
2906 {
2907 m_filaments_colors[i] = *wxGREEN;
2908 }
2909 }
2910 else {
2911 m_filaments_colors[i] = *wxGREEN;
2912 }
2913
2914 //parse the filaments
2915 m_filaments_name[i] = wxString(std::to_string(i+1) + ": " + filament_presets[i]);
2916
2917 i++;
2918 }
2919
2920 return 0;
2921}
Plater * m_plater
Definition GUI_ObjectTable.hpp:613
void set_default_filaments_and_colors()
Definition GUI_ObjectTable.hpp:596
int m_filaments_count
Definition GUI_ObjectTable.hpp:595
static wxColour decode_color(const std::string &color)
Definition SliceInfoPanel.cpp:51

References Slic3r::ColorRGB::b_uchar(), Slic3r::GUI::decode_color(), Slic3r::ColorRGB::g_uchar(), m_filaments_colors, m_filaments_count, m_filaments_name, m_plater, Slic3r::DynamicConfig::opt_string(), Slic3r::ConfigBase::option(), Slic3r::ColorRGB::r_uchar(), set_default_filaments_and_colors(), and Slic3r::ConfigOptionVector< T >::values.

Here is the call graph for this function:

◆ load_data()

void Slic3r::GUI::ObjectTablePanel::load_data ( )
2924{
2925 int rows, cols;
2926
2927 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(", enter");
2928 m_object_grid_table->construct_object_configs(m_object_grid);
2929 m_object_grid->AssignTable(m_object_grid_table);
2930
2931 rows = m_object_grid_table->get_row_count();
2932 cols = m_object_grid_table->get_col_count();
2933
2934 //construct tables
2935 //m_object_grid->CreateGrid(rows, cols, wxGridSelectCells);
2936#if HAS_COL_HEADER
2937 m_object_grid->SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
2938
2939 m_object_grid->SetColLabelValue(ObjectGridTable::col_printable, _L("Printable"));
2941 m_object_grid->SetColLabelValue(ObjectGridTable::col_plate_index, wxString::Format("%S %S", _L("Plate"), wxString::FromUTF8("\u2191\u2193")));
2942 /*m_object_grid->SetColLabelValue(ObjectGridTable::col_assemble_name, L("Module"));*/
2943 m_object_grid->SetColLabelValue(ObjectGridTable::col_name, wxString::Format("%S %S", _L("Name"), wxString::FromUTF8("\u2191\u2193")));
2944 m_object_grid->SetColLabelValue(ObjectGridTable::col_filaments, wxString::Format("%S %S", _L("Filament"), wxString::FromUTF8("\u2191\u2193")));
2946 m_object_grid->SetColLabelValue(ObjectGridTable::col_layer_height, _L("Layer height"));
2948 m_object_grid->SetColLabelValue(ObjectGridTable::col_wall_loops, _L("Wall loops"));
2950 m_object_grid->SetColLabelValue(ObjectGridTable::col_fill_density, _L("Infill density(%)"));
2952 m_object_grid->SetColLabelValue(ObjectGridTable::col_enable_support, _L("Support"));
2954 m_object_grid->SetColLabelValue(ObjectGridTable::col_brim_type, _L("Brim"));
2956 m_object_grid->SetColLabelValue(ObjectGridTable::col_speed_perimeter, _L("Outer wall speed"));
2958 m_object_grid->SetLabelFont(Label::Head_13);
2959 m_object_grid->SetLabelTextColour(StateColor::darkModeColorFor(wxColour("#363636")));
2960 m_object_grid->SetLabelBackgroundColour( StateColor::darkModeColorFor(wxColour("#D9D9D9")));
2961#else
2962 m_object_grid->HideColLabels();
2963#endif
2964 m_object_grid->HideRowLabels();
2965
2966 m_object_grid->EnableGridLines (false);
2967 m_object_grid->EnableDragColSize(false);
2968 m_object_grid->EnableDragGridSize(false);
2969 m_object_grid->EnableDragRowSize(false);
2970
2971 /*set the first row as label*/
2972 //format
2973 wxGridCellAttr *attr;
2974 attr = new wxGridCellAttr;
2975 //attr->SetBackgroundColour(wxColour(191, 191, 255));
2976 attr->SetBackgroundColour(*wxWHITE);
2977 attr->SetTextColour(*wxBLACK);
2978 attr->SetAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
2979 attr->SetReadOnly(true);
2980 m_object_grid->SetRowAttr (0, attr);
2981#if HAS_COL_HEADER
2982 m_object_grid->SetRowSize(0, 0);
2983#endif
2984 //merges
2985 m_object_grid->SetCellSize(0, ObjectGridTable::col_printable, 1, 2);
2986 //m_object_grid->SetCellSize(0, ObjectGridTable::col_assemble_name, 1, 1);
2987 m_object_grid->SetCellSize(0, ObjectGridTable::col_name, 1, 1);
2988 m_object_grid->SetCellSize(0, ObjectGridTable::col_filaments, 1, 1);
2989 m_object_grid->SetCellSize(0, ObjectGridTable::col_layer_height, 1, 2);
2990 m_object_grid->SetCellSize(0, ObjectGridTable::col_wall_loops, 1, 2);
2991 m_object_grid->SetCellSize(0, ObjectGridTable::col_fill_density, 1, 2);
2993 m_object_grid->SetCellSize(0, ObjectGridTable::col_brim_type, 1, 2);
2995
2996 //m_object_grid->SetSelectionForeground(wxColour(0xDB,0xFD,0xE7));
2997 //m_object_grid->SetSelectionBackground(*wxWHITE);
2998 m_object_grid->SetDefaultCellBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
2999 m_object_grid->SetSelectionBackground(StateColor::darkModeColorFor(wxColour("#BFE1DE"))); // its not fully working since background of control's covers cell
3000
3001 m_object_grid->SetCellHighlightColour(StateColor::darkModeColorFor(wxColour("#009688")));
3002 m_object_grid->SetCellHighlightPenWidth(FromDIP(1));
3003 m_object_grid->SetCellHighlightROPenWidth(FromDIP(1)); // Highlight for read-only cells
3004
3005 for (int col = 0; col < cols; col++)
3006 {
3007 ObjectGridTable::ObjectGridCol* grid_col = m_object_grid_table->get_grid_col(col);
3008 m_object_grid->SetColSize(col, grid_col->size);
3009
3010 for (int row = 1; row < rows; row++)
3011 {
3012 ObjectGridTable::ObjectGridRow* grid_row = m_object_grid_table->get_grid_row(row-1);
3013
3014 m_object_grid->SetCellAlignment(row, col, grid_col->horizontal_align, wxALIGN_CENTRE );
3015 m_object_grid->SetCellOverflow(row, col, false);
3016 //m_object_grid->SetCellBackgroundColour (row, col, *wxLIGHT_GREY);
3017 m_object_grid->SetCellBackgroundColour (row, col, StateColor::darkModeColorFor(*wxWHITE));
3018 m_object_grid->SetCellTextColour(row, col,StateColor::darkModeColorFor(wxColour(*wxBLACK)));
3019 //set the render and editor
3020 if (grid_col->b_icon) {
3021 m_object_grid->SetCellRenderer(row, col, new GridCellIconRenderer());
3022 m_object_grid->SetReadOnly(row, col);
3023 }
3024 //else if (grid_col->b_for_object && (grid_row->row_type == ObjectGridTable::row_volume)) {
3025 // /*m_object_grid->SetReadOnly(row, col);
3026 // m_object_grid->SetCellEditor(row, col, new wxGridCellAutoWrapStringEditor());
3027 // m_object_grid->SetCellRenderer(row, col, new wxGridCellAutoWrapStringRenderer());*/
3028 //}
3029 else {
3030 if (!grid_col->b_editable)
3031 m_object_grid->SetReadOnly(row, col);
3032 //set editor
3033 switch (grid_col->type)
3034 {
3035 case coString:
3036 m_object_grid->SetCellEditor(row, col, new GridCellTextEditor());
3037 //m_object_grid->SetCellRenderer(row, col, new wxGridCellAutoWrapStringRenderer());
3038 m_object_grid->SetCellFitMode(row, col, wxGridFitMode::Ellipsize());
3039 break;
3040 case coBool:
3041 m_object_grid->SetCellEditor(row, col, new GridCellSupportEditor());
3042 //m_object_grid->SetCellEditor(row, col, new wxGridCellBoolEditor());
3043 //m_object_grid->SetCellRenderer(row, col, new GridCellSupportRenderer());
3044 m_object_grid->SetCellRenderer(row, col, new GridCellSupportRenderer());
3045 break;
3046 case coInt:
3047 m_object_grid->SetCellEditor(row, col, new GridCellTextEditor());
3048 m_object_grid->SetCellRenderer(row, col, new wxGridCellNumberRenderer());
3049 break;
3050 case coEnum:
3051 if (col == ObjectGridTable::col_filaments) {
3052 if ((grid_row->model_volume_type != ModelVolumeType::NEGATIVE_VOLUME) && \
3053 (grid_row->model_volume_type != ModelVolumeType::SUPPORT_BLOCKER) && \
3054 (grid_row->model_volume_type != ModelVolumeType::SUPPORT_ENFORCER) && \
3055 !is_precise_seam(grid_row->model_volume_type)) { // Precise Seam is non-printing helper geometry
3056 GridCellFilamentsEditor* filament_editor = new GridCellFilamentsEditor(grid_col->choices, false, &m_color_bitmaps);
3057 m_object_grid->SetCellEditor(row, col, filament_editor);
3058 m_object_grid->SetCellRenderer(row, col, new GridCellFilamentsRenderer());
3059 }
3060 else {
3061 m_object_grid->SetCellEditor(row, col, new GridCellTextEditor());
3062 auto gcfil = new GridCellFilamentsRenderer();
3063 m_object_grid->SetCellRenderer(row, col, gcfil);
3064 m_object_grid->SetReadOnly(row, col);
3065 //m_object_grid->SetCellFitMode(row, col, wxGridFitMode::Ellipsize());
3066 }
3067 }
3068 else {
3069 GridCellChoiceEditor* combo_editor = new GridCellChoiceEditor(grid_col->choices);
3070 m_object_grid->SetCellEditor(row, col, combo_editor);
3071 m_object_grid->SetCellRenderer(row, col, new wxGridCellChoiceRenderer());
3072 }
3073 break;
3074 case coFloat: {
3075 m_object_grid->SetCellEditor(row, col, new GridCellTextEditor());
3077 m_object_grid->SetCellRenderer(row, col, new wxGridCellFloatRenderer(6, 0));
3078 }
3079 else {
3080 m_object_grid->SetCellRenderer(row, col, new wxGridCellFloatRenderer(6, 2));
3081 }
3082
3083 break;
3084 }
3085 case coPercent:
3086 {
3087 m_object_grid->SetCellEditor(row, col, new GridCellTextEditor());
3088 m_object_grid->SetCellRenderer(row, col, new wxGridCellFloatRenderer(6,1));
3089 break;
3090 }
3091 default:
3092 break;
3093 }
3094 if (col == ObjectGridTable::col_name) {
3095 m_object_grid->SetCellFont(row, col, Label::Body_13);
3096 /* if (grid_row->row_type == ObjectGridTable::row_object)
3097 m_object_grid->SetCellFont(row, col, Label::Head_14);
3098 else
3099 m_object_grid->SetCellFont(row, col, Label::Body_14);*/
3100 }
3101 }
3102 }
3103 }
3104
3105 for (int i = 0; i < ObjectGridTable::col_max; i++)
3106 {
3107 ObjectGridTable::ObjectGridCol *grid_col = m_object_grid_table->get_grid_col(i);
3108 if (grid_col->size > 0) {
3109 int fit_size1 = m_object_grid->GetColSize(i);
3110 m_object_grid->SetColSize(i, grid_col->size);
3111 }
3112 }
3113 m_object_grid->Fit();
3114
3115 for (int i = 0; i < ObjectGridTable::col_max; i++) {
3116 switch (i) {
3117 /* case ObjectGridTable::col_printable: {
3118 m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28) - FromDIP(5));
3119 break;
3120 }*/
3121
3123 m_object_grid->SetColSize(i, FromDIP(0));
3124 break;
3125
3127 m_object_grid->SetColSize(i, FromDIP(140));
3128 break;
3129
3130 /* case ObjectGridTable::col_filaments:
3131 m_object_grid->SetColSize(i, FromDIP(55));
3132 break;*/
3133
3135 m_object_grid->SetColSize(i, FromDIP(0));
3136 break;
3137
3139 auto width = m_object_grid->GetColSize(i) - FromDIP(28);
3140 if (width < m_object_grid->GetTextExtent(("000.00")).x) {
3141 width = m_object_grid->GetTextExtent(("000.00")).x;
3142 }
3143 m_object_grid->SetColSize(i, width);
3144 break;
3145 }
3146
3148 m_object_grid->SetColSize(i, FromDIP(28));
3149 break;
3150
3152 auto width = m_object_grid->GetColSize(i) - FromDIP(28);
3153 if (width < m_object_grid->GetTextExtent(("000.00")).x) {
3154 width = m_object_grid->GetTextExtent(("000.00")).x;
3155 }
3156 m_object_grid->SetColSize(i, width);
3157 break;
3158 }
3160 m_object_grid->SetColSize(i, FromDIP(28));
3161 break;
3162
3164 m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28));
3165 break;
3166
3168 m_object_grid->SetColSize(i, FromDIP(28));
3169 break;
3170
3172 m_object_grid->SetColSize(i, m_object_grid->GetColSize(i) - FromDIP(28));
3173 break;
3174
3176 m_object_grid->SetColSize(i, FromDIP(28));
3177 break;
3178
3180 m_object_grid->SetColSize(i, FromDIP(56));
3181 break;
3182
3184 m_object_grid->SetColSize(i, FromDIP(28));
3185 break;
3187 auto width = m_object_grid->GetColSize(i) - FromDIP(28);
3188 if (width < m_object_grid->GetTextExtent(("000.00")).x) { width = m_object_grid->GetTextExtent(("000.00")).x; }
3189 m_object_grid->SetColSize(i, width);
3190 break;
3191 }
3193 m_object_grid->SetColSize(i, FromDIP(28));
3194 break;
3195 }
3196 }
3197
3198
3199 m_object_grid->SetGridLineColour(*wxWHITE);
3200 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(", finished, got %1% rows, %2% cols") %m_object_grid_table->GetNumberRows() %m_object_grid_table->GetNumberCols() ;
3201}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_13
Definition Label.hpp:46
@ col_wall_loops
Definition GUI_ObjectTable.hpp:324
@ col_fill_density
Definition GUI_ObjectTable.hpp:326
@ col_speed_perimeter_reset
Definition GUI_ObjectTable.hpp:333
@ col_printable
Definition GUI_ObjectTable.hpp:315
@ col_brim_type
Definition GUI_ObjectTable.hpp:330
@ col_enable_support_reset
Definition GUI_ObjectTable.hpp:329
@ col_filaments
Definition GUI_ObjectTable.hpp:320
@ col_layer_height
Definition GUI_ObjectTable.hpp:322
@ col_layer_height_reset
Definition GUI_ObjectTable.hpp:323
@ col_fill_density_reset
Definition GUI_ObjectTable.hpp:327
@ col_filaments_reset
Definition GUI_ObjectTable.hpp:321
@ col_printable_reset
Definition GUI_ObjectTable.hpp:316
@ col_plate_index
Definition GUI_ObjectTable.hpp:317
@ col_brim_type_reset
Definition GUI_ObjectTable.hpp:331
@ col_enable_support
Definition GUI_ObjectTable.hpp:328
@ col_max
Definition GUI_ObjectTable.hpp:334
@ col_wall_loops_reset
Definition GUI_ObjectTable.hpp:325
@ col_speed_perimeter
Definition GUI_ObjectTable.hpp:332
@ col_name
Definition GUI_ObjectTable.hpp:319
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219
@ SUPPORT_BLOCKER
Definition Model.hpp:360
@ NEGATIVE_VOLUME
Definition Model.hpp:358
@ SUPPORT_ENFORCER
Definition Model.hpp:361
@ coString
Definition Config.hpp:192
@ coEnum
Definition Config.hpp:214
@ coInt
Definition Config.hpp:188
@ coBool
Definition Config.hpp:210
@ coFloat
Definition Config.hpp:184
@ coPercent
Definition Config.hpp:196
bool is_precise_seam(ModelVolumeType t)
Definition Model.hpp:373
size_t cols(const T &raster)
Definition MarchingSquares.hpp:173
size_t rows(const T &raster)
Definition MarchingSquares.hpp:171

References _L, Slic3r::GUI::ObjectGridTable::ObjectGridCol::b_editable, Slic3r::GUI::ObjectGridTable::ObjectGridCol::b_icon, Label::Body_13, Slic3r::GUI::ObjectGridTable::ObjectGridCol::choices, Slic3r::coBool, Slic3r::coEnum, Slic3r::coFloat, Slic3r::coInt, Slic3r::GUI::ObjectGridTable::col_brim_type, Slic3r::GUI::ObjectGridTable::col_brim_type_reset, Slic3r::GUI::ObjectGridTable::col_enable_support, Slic3r::GUI::ObjectGridTable::col_enable_support_reset, Slic3r::GUI::ObjectGridTable::col_filaments, Slic3r::GUI::ObjectGridTable::col_filaments_reset, Slic3r::GUI::ObjectGridTable::col_fill_density, Slic3r::GUI::ObjectGridTable::col_fill_density_reset, Slic3r::GUI::ObjectGridTable::col_layer_height, Slic3r::GUI::ObjectGridTable::col_layer_height_reset, Slic3r::GUI::ObjectGridTable::col_max, Slic3r::GUI::ObjectGridTable::col_name, Slic3r::GUI::ObjectGridTable::col_plate_index, Slic3r::GUI::ObjectGridTable::col_printable, Slic3r::GUI::ObjectGridTable::col_printable_reset, Slic3r::GUI::ObjectGridTable::col_speed_perimeter, Slic3r::GUI::ObjectGridTable::col_speed_perimeter_reset, Slic3r::GUI::ObjectGridTable::col_wall_loops, Slic3r::GUI::ObjectGridTable::col_wall_loops_reset, Slic3r::coPercent, Slic3r::coString, StateColor::darkModeColorFor(), Label::Head_13, Slic3r::GUI::ObjectGridTable::ObjectGridCol::horizontal_align, Slic3r::is_precise_seam(), m_color_bitmaps, m_object_grid, m_object_grid_table, Slic3r::GUI::ObjectGridTable::ObjectGridRow::model_volume_type, Slic3r::NEGATIVE_VOLUME, Slic3r::GUI::ObjectGridTable::ObjectGridCol::size, Slic3r::SUPPORT_BLOCKER, Slic3r::SUPPORT_ENFORCER, and Slic3r::GUI::ObjectGridTable::ObjectGridCol::type.

Here is the call graph for this function:

◆ msw_rescale()

void Slic3r::GUI::ObjectTablePanel::msw_rescale ( )
3350 {
3351 m_object_grid->HideRowLabels();
3352}

References m_object_grid.

◆ OnCellLeftClick()

void Slic3r::GUI::ObjectTablePanel::OnCellLeftClick ( wxGridEvent & ev)
3225{
3226 int row = ev.GetRow();
3227 int col = ev.GetCol();
3228
3229 ConfigOptionType type = coNone;
3230 bool consumed = m_object_grid_table->OnCellLeftClick(row, col, type);
3231 if (consumed) {
3232 m_object_grid->ClearSelection();
3233 m_object_grid->SelectBlock(row, col-1, row, col-1, true);
3234 //return;
3235 }
3236 m_object_grid->input_string = wxEmptyString;
3237 ev.Skip();
3238 //consumed = m_object_grid->OnCellLeftClick(ev, row, col, type);
3239 //if (!consumed) ev.Skip();
3240}
ConfigOptionType
Definition Config.hpp:180
@ coNone
Definition Config.hpp:182

References Slic3r::coNone, m_object_grid, and m_object_grid_table.

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

Here is the caller graph for this function:

◆ OnCellValueChanged()

void Slic3r::GUI::ObjectTablePanel::OnCellValueChanged ( wxGridEvent & ev)
3290{
3291 int row = ev.GetRow();
3292 int col = ev.GetCol();
3293
3294 m_object_grid_table->OnCellValueChanged(row, col);
3295
3296 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format("cell (%1%, %2%) changed from %3% to %4%") %row %col %ev.GetString() % m_object_grid->GetCellValue(row, col);
3297
3298 ev.Skip();
3299}

References m_object_grid, and m_object_grid_table.

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

Here is the caller graph for this function:

◆ OnColSize()

void Slic3r::GUI::ObjectTablePanel::OnColSize ( wxGridSizeEvent & ev)
3257{
3258 wxSize panel_size = get_init_size();
3259
3260 g_dialog_max_width = (panel_size.GetWidth() > g_max_size_from_parent.GetWidth())?g_max_size_from_parent.GetWidth():panel_size.GetWidth();
3261 g_dialog_max_height =(panel_size.GetHeight() > g_max_size_from_parent.GetHeight())?g_max_size_from_parent.GetHeight():panel_size.GetHeight();
3262 this->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
3263
3264 wxSize current_size = GetParent()->GetSize();
3265 //if (current_size.GetWidth() < g_dialog_max_width)
3266 GetParent()->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
3267 GetParent()->SetSize(wxSize(g_dialog_max_width, g_dialog_max_height));
3268}
wxSize get_init_size()
Definition GUI_ObjectTable.cpp:3311
static int g_dialog_max_width
Definition GUI_ObjectTable.cpp:79
static int g_dialog_max_height
Definition GUI_ObjectTable.cpp:80
static wxSize g_max_size_from_parent
Definition GUI_ObjectTable.cpp:81

References Slic3r::GUI::g_dialog_max_height, Slic3r::GUI::g_dialog_max_width, Slic3r::GUI::g_max_size_from_parent, and get_init_size().

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

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

◆ OnRangeSelected()

void Slic3r::GUI::ObjectTablePanel::OnRangeSelected ( wxGridRangeSelectEvent & ev)
3303{
3304 range_select_left_col = ev.GetLeftCol();
3305 range_select_right_col = ev.GetRightCol();
3306 range_select_top_row = ev.GetTopRow();
3307 range_select_bottom_row = ev.GetBottomRow();
3308 ev.Skip();
3309}
int range_select_bottom_row
Definition GUI_ObjectTable.hpp:568
int range_select_left_col
Definition GUI_ObjectTable.hpp:565
int range_select_right_col
Definition GUI_ObjectTable.hpp:566
int range_select_top_row
Definition GUI_ObjectTable.hpp:567

References range_select_bottom_row, range_select_left_col, range_select_right_col, and range_select_top_row.

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

Here is the caller graph for this function:

◆ OnRowSize()

void Slic3r::GUI::ObjectTablePanel::OnRowSize ( wxGridSizeEvent & ev)
3243{
3244 wxSize panel_size = get_init_size();
3245
3246 g_dialog_max_width = (panel_size.GetWidth() > g_max_size_from_parent.GetWidth())?g_max_size_from_parent.GetWidth():panel_size.GetWidth();
3247 g_dialog_max_height =(panel_size.GetHeight() > g_max_size_from_parent.GetHeight())?g_max_size_from_parent.GetHeight():panel_size.GetHeight();
3248 this->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
3249
3250 wxSize current_size = GetParent()->GetSize();
3251 //if (current_size.GetHeight() < g_dialog_max_height)
3252 GetParent()->SetMaxSize(wxSize(g_dialog_max_width, g_dialog_max_height));
3253 GetParent()->SetSize(wxSize(g_dialog_max_width, g_dialog_max_height));
3254}

References Slic3r::GUI::g_dialog_max_height, Slic3r::GUI::g_dialog_max_width, Slic3r::GUI::g_max_size_from_parent, and get_init_size().

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

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

◆ OnSelectCell()

void Slic3r::GUI::ObjectTablePanel::OnSelectCell ( wxGridEvent & ev)
3271{
3272 int row = ev.GetRow();
3273 int col = ev.GetCol();
3274
3275 if ((row == m_cur_row) && (col == m_cur_col))
3276 {
3277 //the same cel selected
3278 return;
3279 }
3280
3281 BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format("cell (%1%, %2%) selected") %row %col;
3282 m_object_grid_table->OnSelectCell(row, col);
3283
3284 m_cur_row = row;
3285 m_cur_col = col;
3286 ev.Skip();
3287}
int m_cur_col
Definition GUI_ObjectTable.hpp:616
int m_cur_row
Definition GUI_ObjectTable.hpp:615

References m_cur_col, m_cur_row, and m_object_grid_table.

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

Here is the caller graph for this function:

◆ resetAllValuesInSideWindow()

void Slic3r::GUI::ObjectTablePanel::resetAllValuesInSideWindow ( int row,
bool is_object,
ModelObject * object,
ModelConfig * config,
const std::string & category )
3345{
3346 //
3347 m_object_settings->resetAllValues(row, is_object, object, config, category);
3348}

References m_object_settings.

◆ set_default_filaments_and_colors()

void Slic3r::GUI::ObjectTablePanel::set_default_filaments_and_colors ( )
inline
597 {
599 m_filaments_colors.push_back(*wxGREEN);
600 m_filaments_name.push_back("Generic PLA");
601 }

References m_filaments_colors, m_filaments_count, and m_filaments_name.

Referenced by init_filaments_and_colors().

Here is the caller graph for this function:

◆ SetSelection()

void Slic3r::GUI::ObjectTablePanel::SetSelection ( int object_id,
int volume_id )
3204{
3205 m_object_grid_table->SetSelection(object_id, volume_id);
3206}

References m_object_grid_table.

◆ sort_by_default()

void Slic3r::GUI::ObjectTablePanel::sort_by_default ( )
inline
585{ m_object_grid_table->sort_by_default(); }

References m_object_grid_table.

◆ wxDECLARE_ABSTRACT_CLASS()

Slic3r::GUI::ObjectTablePanel::wxDECLARE_ABSTRACT_CLASS ( ObjectGrid )
private

◆ wxDECLARE_EVENT_TABLE()

Slic3r::GUI::ObjectTablePanel::wxDECLARE_EVENT_TABLE ( )
private

◆ ObjectGridTable

friend class ObjectGridTable
friend

References ObjectGridTable.

Referenced by ObjectGridTable.

Member Data Documentation

◆ m_bg_colour

wxColour Slic3r::GUI::ObjectTablePanel::m_bg_colour
private

◆ m_bmp_reset

ScalableBitmap Slic3r::GUI::ObjectTablePanel::m_bmp_reset
private

◆ m_bmp_reset_disable

ScalableBitmap Slic3r::GUI::ObjectTablePanel::m_bmp_reset_disable
private

◆ m_color_bitmaps

std::vector<wxBitmap*> Slic3r::GUI::ObjectTablePanel::m_color_bitmaps
private

Referenced by init_bitmap(), and load_data().

◆ m_cur_col

int Slic3r::GUI::ObjectTablePanel::m_cur_col { -1 }
private
616{ -1 };

Referenced by OnSelectCell().

◆ m_cur_row

int Slic3r::GUI::ObjectTablePanel::m_cur_row { -1 }
private
615{ -1 };

Referenced by OnSelectCell().

◆ m_filaments_colors

std::vector<wxColour> Slic3r::GUI::ObjectTablePanel::m_filaments_colors

◆ m_filaments_count

int Slic3r::GUI::ObjectTablePanel::m_filaments_count { 1 }

◆ m_filaments_name

std::vector<wxString> Slic3r::GUI::ObjectTablePanel::m_filaments_name

◆ m_float_validator

wxFloatingPointValidator<float> Slic3r::GUI::ObjectTablePanel::m_float_validator
private

◆ m_hover_colour

wxColour Slic3r::GUI::ObjectTablePanel::m_hover_colour
private

◆ m_model

Model* Slic3r::GUI::ObjectTablePanel::m_model {nullptr}
private
612{nullptr};

◆ m_object_grid

ObjectGrid* Slic3r::GUI::ObjectTablePanel::m_object_grid {nullptr}
private

◆ m_object_grid_table

ObjectGridTable* Slic3r::GUI::ObjectTablePanel::m_object_grid_table {nullptr}
private

◆ m_object_settings

ObjectTableSettings* Slic3r::GUI::ObjectTablePanel::m_object_settings { nullptr }
private
611{ nullptr };

Referenced by ~ObjectTablePanel(), and resetAllValuesInSideWindow().

◆ m_page_sizer

wxBoxSizer* Slic3r::GUI::ObjectTablePanel::m_page_sizer {nullptr}
private
607{nullptr};

◆ m_plater

Plater* Slic3r::GUI::ObjectTablePanel::m_plater {nullptr}
private
613{nullptr};

Referenced by init_filaments_and_colors().

◆ m_side_window

wxScrolledWindow* Slic3r::GUI::ObjectTablePanel::m_side_window {nullptr}
private
610{nullptr};

◆ m_top_sizer

wxBoxSizer* Slic3r::GUI::ObjectTablePanel::m_top_sizer {nullptr}
private
606{nullptr};

Referenced by ~ObjectTablePanel().

◆ m_undo_bitmap

wxBitmap Slic3r::GUI::ObjectTablePanel::m_undo_bitmap
private

Referenced by init_bitmap().

◆ range_select_bottom_row

int Slic3r::GUI::ObjectTablePanel::range_select_bottom_row

Referenced by OnRangeSelected().

◆ range_select_left_col

int Slic3r::GUI::ObjectTablePanel::range_select_left_col

Referenced by OnRangeSelected().

◆ range_select_right_col

int Slic3r::GUI::ObjectTablePanel::range_select_right_col

Referenced by OnRangeSelected().

◆ range_select_top_row

int Slic3r::GUI::ObjectTablePanel::range_select_top_row

Referenced by OnRangeSelected().


The documentation for this class was generated from the following files: