Merge remote-tracking branch 'origin/master' into tm_colldetection_upgr
This commit is contained in:
commit
d65fd9f346
@ -1622,6 +1622,8 @@ void GCode::process_layer(
|
||||
|
||||
unsigned int copy_id = 0;
|
||||
for (const Point © : copies) {
|
||||
if (this->config().gcode_label_objects)
|
||||
gcode += std::string("; printing object ") + print_object->model_object()->name + " id:" + std::to_string(layer_id) + " copy " + std::to_string(copy_id) + "\n";
|
||||
// When starting a new object, use the external motion planner for the first travel move.
|
||||
std::pair<const PrintObject*, Point> this_object_copy(print_object, copy);
|
||||
if (m_last_obj_copy != this_object_copy)
|
||||
@ -1646,7 +1648,9 @@ void GCode::process_layer(
|
||||
gcode += this->extrude_infill(print,by_region_specific);
|
||||
}
|
||||
}
|
||||
++copy_id;
|
||||
if (this->config().gcode_label_objects)
|
||||
gcode += std::string("; stop printing object ") + print_object->model_object()->name + " id:" + std::to_string(layer_id) + " copy " + std::to_string(copy_id) + "\n";
|
||||
++ copy_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class SpiralVase {
|
||||
SpiralVase(const PrintConfig &config)
|
||||
: enable(false), _config(&config)
|
||||
{
|
||||
this->_reader.z() = this->_config->z_offset;
|
||||
this->_reader.z() = (float)this->_config->z_offset;
|
||||
this->_reader.apply_config(*this->_config);
|
||||
};
|
||||
std::string process_layer(const std::string &gcode);
|
||||
|
@ -43,7 +43,7 @@ public:
|
||||
}
|
||||
bool cmd_is(const char *cmd_test) const {
|
||||
const char *cmd = GCodeReader::skip_whitespaces(m_raw.c_str());
|
||||
int len = strlen(cmd_test);
|
||||
size_t len = strlen(cmd_test);
|
||||
return strncmp(cmd, cmd_test, len) == 0 && GCodeReader::is_end_of_word(cmd[len]);
|
||||
}
|
||||
bool extruding(const GCodeReader &reader) const { return this->cmd_is("G1") && this->dist_E(reader) > 0; }
|
||||
|
@ -549,11 +549,18 @@ void Model::reset_auto_extruder_id()
|
||||
|
||||
std::string Model::propose_export_file_name() const
|
||||
{
|
||||
std::string input_file;
|
||||
for (const ModelObject *model_object : this->objects)
|
||||
for (ModelInstance *model_instance : model_object->instances)
|
||||
if (model_instance->is_printable())
|
||||
return model_object->name.empty() ? model_object->input_file : model_object->name;
|
||||
return std::string();
|
||||
if (model_instance->is_printable()) {
|
||||
input_file = model_object->name.empty() ? model_object->input_file : model_object->name;
|
||||
if (! input_file.empty())
|
||||
goto end;
|
||||
// Other instances will produce the same name, skip them.
|
||||
break;
|
||||
}
|
||||
end:
|
||||
return input_file;
|
||||
}
|
||||
|
||||
ModelObject::~ModelObject()
|
||||
|
@ -127,6 +127,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
||||
"first_layer_speed",
|
||||
"gcode_comments",
|
||||
"gcode_flavor",
|
||||
"gcode_label_objects",
|
||||
"infill_acceleration",
|
||||
"layer_gcode",
|
||||
"min_fan_speed",
|
||||
|
@ -67,20 +67,9 @@ std::string PrintBase::output_filename(const std::string &format, const std::str
|
||||
std::string PrintBase::output_filepath(const std::string &path) const
|
||||
{
|
||||
// if we were supplied no path, generate an automatic one based on our first object's input file
|
||||
if (path.empty()) {
|
||||
if (path.empty())
|
||||
// get the first input file name
|
||||
std::string input_file;
|
||||
for (const ModelObject *model_object : m_model.objects) {
|
||||
for (ModelInstance *model_instance : model_object->instances)
|
||||
if (model_instance->is_printable()) {
|
||||
input_file = model_object->input_file;
|
||||
break;
|
||||
}
|
||||
if (! input_file.empty())
|
||||
break;
|
||||
}
|
||||
return (boost::filesystem::path(input_file).parent_path() / this->output_filename()).make_preferred().string();
|
||||
}
|
||||
return (boost::filesystem::path(m_model.propose_export_file_name()).parent_path() / this->output_filename()).make_preferred().string();
|
||||
|
||||
// if we were supplied a directory, use it and append our automatically generated filename
|
||||
boost::filesystem::path p(path);
|
||||
|
@ -930,6 +930,15 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);
|
||||
|
||||
def = this->add("gcode_label_objects", coBool);
|
||||
def->label = "Label objects";
|
||||
def->tooltip = "Enable this to add comments into the G-Code labeling print moves with what object they belong to,"
|
||||
" which is useful for the Octoprint CancelObject plugin. This settings is NOT compatible with "
|
||||
"Single Extruder Multi Material setup and Wipe into Object / Wipe into Infill.";
|
||||
def->cli = "gcode-label-objects!";
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionBool(0);
|
||||
|
||||
def = this->add("high_current_on_filament_swap", coBool);
|
||||
def->label = L("High extruder current on filament swap");
|
||||
def->tooltip = L("It may be beneficial to increase the extruder motor current during the filament exchange"
|
||||
|
@ -619,6 +619,7 @@ public:
|
||||
ConfigOptionStrings filament_ramming_parameters;
|
||||
ConfigOptionBool gcode_comments;
|
||||
ConfigOptionEnum<GCodeFlavor> gcode_flavor;
|
||||
ConfigOptionBool gcode_label_objects;
|
||||
ConfigOptionString layer_gcode;
|
||||
ConfigOptionFloat max_print_speed;
|
||||
ConfigOptionFloat max_volumetric_speed;
|
||||
@ -690,6 +691,7 @@ protected:
|
||||
OPT_PTR(filament_ramming_parameters);
|
||||
OPT_PTR(gcode_comments);
|
||||
OPT_PTR(gcode_flavor);
|
||||
OPT_PTR(gcode_label_objects);
|
||||
OPT_PTR(layer_gcode);
|
||||
OPT_PTR(max_print_speed);
|
||||
OPT_PTR(max_volumetric_speed);
|
||||
@ -730,7 +732,7 @@ protected:
|
||||
class PrintConfig : public MachineEnvelopeConfig, public GCodeConfig
|
||||
{
|
||||
STATIC_PRINT_CONFIG_CACHE_DERIVED(PrintConfig)
|
||||
PrintConfig() : GCodeConfig(0) { initialize_cache(); *this = s_cache_PrintConfig.defaults(); }
|
||||
PrintConfig() : MachineEnvelopeConfig(0), GCodeConfig(0) { initialize_cache(); *this = s_cache_PrintConfig.defaults(); }
|
||||
public:
|
||||
double min_object_distance() const;
|
||||
static double min_object_distance(const ConfigBase *config);
|
||||
@ -808,7 +810,7 @@ public:
|
||||
ConfigOptionFloat exp_time_first;
|
||||
|
||||
protected:
|
||||
PrintConfig(int) : GCodeConfig(1) {}
|
||||
PrintConfig(int) : MachineEnvelopeConfig(1), GCodeConfig(1) {}
|
||||
void initialize(StaticCacheBase &cache, const char *base_ptr)
|
||||
{
|
||||
this->MachineEnvelopeConfig::initialize(cache, base_ptr);
|
||||
|
@ -56,3 +56,12 @@
|
||||
#define ENABLE_ANISOTROPIC_FILTER_ON_BED_TEXTURES (1 && ENABLE_1_42_0_ALPHA4)
|
||||
// Bunch of fixes related to volumes centering
|
||||
#define ENABLE_VOLUMES_CENTERING_FIXES (1 && ENABLE_1_42_0_ALPHA4)
|
||||
|
||||
|
||||
//====================
|
||||
// 1.42.0.alpha5 techs
|
||||
//====================
|
||||
#define ENABLE_1_42_0_ALPHA5 1
|
||||
|
||||
// Toolbar items hidden/shown in dependence of the user mode
|
||||
#define ENABLE_MODE_AWARE_TOOLBAR_ITEMS (1 && ENABLE_1_42_0_ALPHA5)
|
||||
|
@ -252,6 +252,7 @@ GLVolume::GLVolume(float r, float g, float b, float a)
|
||||
, is_modifier(false)
|
||||
, is_wipe_tower(false)
|
||||
, is_extrusion_path(false)
|
||||
, force_transparent(false)
|
||||
, tverts_range(0, size_t(-1))
|
||||
, qverts_range(0, size_t(-1))
|
||||
{
|
||||
@ -293,6 +294,9 @@ void GLVolume::set_render_color()
|
||||
set_render_color(OUTSIDE_COLOR, 4);
|
||||
else
|
||||
set_render_color(color, 4);
|
||||
|
||||
if (force_transparent)
|
||||
render_color[3] = color[3];
|
||||
}
|
||||
|
||||
void GLVolume::set_color_from_model_volume(const ModelVolume *model_volume)
|
||||
|
@ -295,6 +295,8 @@ public:
|
||||
bool is_wipe_tower;
|
||||
// Wheter or not this volume has been generated from an extrusion path
|
||||
bool is_extrusion_path;
|
||||
// Wheter or not to always render this volume using its own alpha
|
||||
bool force_transparent;
|
||||
|
||||
// Interleaved triangles & normals with indexed triangles & quads.
|
||||
GLIndexedVertexArray indexed_vertex_array;
|
||||
|
@ -4286,6 +4286,13 @@ bool GLCanvas3D::is_reload_delayed() const
|
||||
void GLCanvas3D::enable_layers_editing(bool enable)
|
||||
{
|
||||
m_layers_editing.set_enabled(enable);
|
||||
const Selection::IndicesList& idxs = m_selection.get_volume_idxs();
|
||||
for (unsigned int idx : idxs)
|
||||
{
|
||||
GLVolume* v = m_volumes.volumes[idx];
|
||||
if (v->is_modifier)
|
||||
v->force_transparent = enable;
|
||||
}
|
||||
}
|
||||
|
||||
void GLCanvas3D::enable_warning_texture(bool enable)
|
||||
@ -4414,6 +4421,16 @@ void GLCanvas3D::update_volumes_colors_by_extruder()
|
||||
m_volumes.update_colors_by_extruder(m_config);
|
||||
}
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
void GLCanvas3D::update_toolbar_items_visibility()
|
||||
{
|
||||
ConfigOptionMode mode = wxGetApp().get_mode();
|
||||
m_toolbar.set_item_visible("more", mode != comSimple);
|
||||
m_toolbar.set_item_visible("fewer", mode != comSimple);
|
||||
m_dirty = true;
|
||||
}
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
// Returns a Rect object denoting size and position of the Reset button used by a gizmo.
|
||||
// Returns in either screen or viewport coords.
|
||||
#if !ENABLE_IMGUI
|
||||
@ -5206,6 +5223,9 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||
|
||||
Point pos(evt.GetX(), evt.GetY());
|
||||
|
||||
if (m_picking_enabled)
|
||||
_set_current();
|
||||
|
||||
int selected_object_idx = m_selection.get_object_idx();
|
||||
int layer_editing_object_idx = is_layers_editing_enabled() ? selected_object_idx : -1;
|
||||
m_layers_editing.select_object(*m_model, layer_editing_object_idx);
|
||||
@ -6166,6 +6186,10 @@ bool GLCanvas3D::_init_toolbar()
|
||||
|
||||
enable_toolbar_item("add", true);
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
update_toolbar_items_visibility();
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1004,6 +1004,10 @@ public:
|
||||
|
||||
void update_volumes_colors_by_extruder();
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
void update_toolbar_items_visibility();
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
#if !ENABLE_IMGUI
|
||||
Rect get_gizmo_reset_rect(const GLCanvas3D& canvas, bool viewport) const;
|
||||
bool gizmo_reset_rect_contains(const GLCanvas3D& canvas, float x, float y) const;
|
||||
|
@ -35,6 +35,9 @@ GLToolbarItem::Data::Data()
|
||||
, tooltip("")
|
||||
, sprite_id(-1)
|
||||
, is_toggable(false)
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
, visible(true)
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
{
|
||||
}
|
||||
|
||||
@ -45,61 +48,11 @@ GLToolbarItem::GLToolbarItem(GLToolbarItem::EType type, const GLToolbarItem::Dat
|
||||
{
|
||||
}
|
||||
|
||||
GLToolbarItem::EState GLToolbarItem::get_state() const
|
||||
{
|
||||
return m_state;
|
||||
}
|
||||
|
||||
void GLToolbarItem::set_state(GLToolbarItem::EState state)
|
||||
{
|
||||
m_state = state;
|
||||
}
|
||||
|
||||
const std::string& GLToolbarItem::get_name() const
|
||||
{
|
||||
return m_data.name;
|
||||
}
|
||||
|
||||
const std::string& GLToolbarItem::get_tooltip() const
|
||||
{
|
||||
return m_data.tooltip;
|
||||
}
|
||||
|
||||
void GLToolbarItem::do_action(wxEvtHandler *target)
|
||||
{
|
||||
wxPostEvent(target, SimpleEvent(m_data.action_event));
|
||||
}
|
||||
|
||||
bool GLToolbarItem::is_enabled() const
|
||||
{
|
||||
return m_state != Disabled;
|
||||
}
|
||||
|
||||
bool GLToolbarItem::is_disabled() const
|
||||
{
|
||||
return m_state == Disabled;
|
||||
}
|
||||
|
||||
bool GLToolbarItem::is_hovered() const
|
||||
{
|
||||
return (m_state == Hover) || (m_state == HoverPressed);
|
||||
}
|
||||
|
||||
bool GLToolbarItem::is_pressed() const
|
||||
{
|
||||
return (m_state == Pressed) || (m_state == HoverPressed);
|
||||
}
|
||||
|
||||
bool GLToolbarItem::is_toggable() const
|
||||
{
|
||||
return m_data.is_toggable;
|
||||
}
|
||||
|
||||
bool GLToolbarItem::is_separator() const
|
||||
{
|
||||
return m_type == Separator;
|
||||
}
|
||||
|
||||
void GLToolbarItem::render(unsigned int tex_id, float left, float right, float bottom, float top, unsigned int texture_size, unsigned int border_size, unsigned int icon_size, unsigned int gap_size) const
|
||||
{
|
||||
GLTexture::render_sub_texture(tex_id, left, right, bottom, top, get_uvs(texture_size, border_size, icon_size, gap_size));
|
||||
@ -355,6 +308,46 @@ bool GLToolbar::is_item_disabled(const std::string& name) const
|
||||
return false;
|
||||
}
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
bool GLToolbar::is_item_visible(const std::string& name) const
|
||||
{
|
||||
for (GLToolbarItem* item : m_items)
|
||||
{
|
||||
if (item->get_name() == name)
|
||||
return item->is_visible();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void GLToolbar::set_item_visible(const std::string& name, bool visible)
|
||||
{
|
||||
for (GLToolbarItem* item : m_items)
|
||||
{
|
||||
if ((item->get_name() == name) && (item->is_visible() != visible))
|
||||
{
|
||||
item->set_visible(visible);
|
||||
m_layout.dirty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// updates separators visibility to avoid having two consecutive
|
||||
bool any_item_visible = false;
|
||||
for (GLToolbarItem* item : m_items)
|
||||
{
|
||||
if (!item->is_separator())
|
||||
any_item_visible |= item->is_visible();
|
||||
else
|
||||
{
|
||||
item->set_visible(any_item_visible);
|
||||
any_item_visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
std::string GLToolbar::update_hover_state(const Vec2d& mouse_pos, GLCanvas3D& parent)
|
||||
{
|
||||
if (!m_enabled)
|
||||
@ -486,6 +479,11 @@ float GLToolbar::get_main_size() const
|
||||
float size = 2.0f * m_layout.border * m_layout.icons_scale;
|
||||
for (unsigned int i = 0; i < (unsigned int)m_items.size(); ++i)
|
||||
{
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!m_items[i]->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (m_items[i]->is_separator())
|
||||
size += m_layout.separator_size * m_layout.icons_scale;
|
||||
else
|
||||
@ -524,6 +522,11 @@ std::string GLToolbar::update_hover_state_horizontal(const Vec2d& mouse_pos, GLC
|
||||
|
||||
for (GLToolbarItem* item : m_items)
|
||||
{
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!item->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (item->is_separator())
|
||||
left += separator_stride;
|
||||
else
|
||||
@ -618,6 +621,11 @@ std::string GLToolbar::update_hover_state_vertical(const Vec2d& mouse_pos, GLCan
|
||||
|
||||
for (GLToolbarItem* item : m_items)
|
||||
{
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!item->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (item->is_separator())
|
||||
top -= separator_stride;
|
||||
else
|
||||
@ -714,6 +722,11 @@ int GLToolbar::contains_mouse_horizontal(const Vec2d& mouse_pos, const GLCanvas3
|
||||
{
|
||||
++id;
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!item->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (item->is_separator())
|
||||
left += separator_stride;
|
||||
else
|
||||
@ -759,6 +772,11 @@ int GLToolbar::contains_mouse_vertical(const Vec2d& mouse_pos, const GLCanvas3D&
|
||||
{
|
||||
++id;
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!item->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (item->is_separator())
|
||||
top -= separator_stride;
|
||||
else
|
||||
@ -892,6 +910,11 @@ void GLToolbar::render_horizontal(const GLCanvas3D& parent) const
|
||||
// renders icons
|
||||
for (const GLToolbarItem* item : m_items)
|
||||
{
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!item->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (item->is_separator())
|
||||
left += separator_stride;
|
||||
else
|
||||
@ -1018,6 +1041,11 @@ void GLToolbar::render_vertical(const GLCanvas3D& parent) const
|
||||
// renders icons
|
||||
for (const GLToolbarItem* item : m_items)
|
||||
{
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (!item->is_visible())
|
||||
continue;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
if (item->is_separator())
|
||||
top -= separator_stride;
|
||||
else
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "GLTexture.hpp"
|
||||
#include "Event.hpp"
|
||||
|
||||
|
||||
class wxEvtHandler;
|
||||
|
||||
namespace Slic3r {
|
||||
@ -56,6 +55,9 @@ public:
|
||||
unsigned int sprite_id;
|
||||
bool is_toggable;
|
||||
wxEventType action_event;
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
bool visible;
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
Data();
|
||||
};
|
||||
@ -68,21 +70,25 @@ private:
|
||||
public:
|
||||
GLToolbarItem(EType type, const Data& data);
|
||||
|
||||
EState get_state() const;
|
||||
void set_state(EState state);
|
||||
EState get_state() const { return m_state; }
|
||||
void set_state(EState state) { m_state = state; }
|
||||
|
||||
const std::string& get_name() const;
|
||||
const std::string& get_tooltip() const;
|
||||
const std::string& get_name() const { return m_data.name; }
|
||||
const std::string& get_tooltip() const { return m_data.tooltip; }
|
||||
|
||||
void do_action(wxEvtHandler *target);
|
||||
|
||||
bool is_enabled() const;
|
||||
bool is_disabled() const;
|
||||
bool is_hovered() const;
|
||||
bool is_pressed() const;
|
||||
bool is_enabled() const { return m_state != Disabled; }
|
||||
bool is_disabled() const { return m_state == Disabled; }
|
||||
bool is_hovered() const { return (m_state == Hover) || (m_state == HoverPressed); }
|
||||
bool is_pressed() const { return (m_state == Pressed) || (m_state == HoverPressed); }
|
||||
|
||||
bool is_toggable() const;
|
||||
bool is_separator() const;
|
||||
bool is_toggable() const { return m_data.is_toggable; }
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
bool is_visible() const { return m_data.visible; }
|
||||
void set_visible(bool visible) { m_data.visible = visible; }
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
bool is_separator() const { return m_type == Separator; }
|
||||
|
||||
void render(unsigned int tex_id, float left, float right, float bottom, float top, unsigned int texture_size, unsigned int border_size, unsigned int icon_size, unsigned int gap_size) const;
|
||||
|
||||
@ -223,6 +229,10 @@ public:
|
||||
|
||||
bool is_item_pressed(const std::string& name) const;
|
||||
bool is_item_disabled(const std::string& name) const;
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
bool is_item_visible(const std::string& name) const;
|
||||
void set_item_visible(const std::string& name, bool visible);
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
std::string update_hover_state(const Vec2d& mouse_pos, GLCanvas3D& parent);
|
||||
|
||||
|
@ -139,6 +139,14 @@ void View3D::mirror_selection(Axis axis)
|
||||
m_canvas->mirror_selection(axis);
|
||||
}
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
void View3D::update_toolbar_items_visibility()
|
||||
{
|
||||
if (m_canvas != nullptr)
|
||||
m_canvas->update_toolbar_items_visibility();
|
||||
}
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
|
||||
void View3D::enable_toolbar_item(const std::string& name, bool enable)
|
||||
{
|
||||
if (m_canvas != nullptr)
|
||||
|
@ -58,6 +58,9 @@ public:
|
||||
void delete_selected();
|
||||
void mirror_selection(Axis axis);
|
||||
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
void update_toolbar_items_visibility();
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
void enable_toolbar_item(const std::string& name, bool enable);
|
||||
int check_volumes_outside_state() const;
|
||||
|
||||
|
@ -44,7 +44,8 @@ KBShortcutsDialog::KBShortcutsDialog()
|
||||
|
||||
for (auto& sc : m_full_shortcuts)
|
||||
{
|
||||
auto sizer = sc.first == _(L("Main Shortcuts")) ? l_sizer : r_sizer;
|
||||
// auto sizer = sc.first == _(L("Main Shortcuts")) ? l_sizer : r_sizer;
|
||||
auto sizer = sc.second.second == 0 ? l_sizer : r_sizer;
|
||||
wxBoxSizer* hsizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
sizer->Add(hsizer, 0, wxEXPAND | wxTOP | wxBOTTOM, 10);
|
||||
|
||||
@ -61,7 +62,7 @@ KBShortcutsDialog::KBShortcutsDialog()
|
||||
auto grid_sizer = new wxFlexGridSizer(2, 5, 15);
|
||||
sizer->Add(grid_sizer, 0, wxEXPAND | wxLEFT| wxRIGHT, 15);
|
||||
|
||||
for (auto pair : sc.second)
|
||||
for (auto pair : sc.second.first)
|
||||
{
|
||||
auto shortcut = new wxStaticText(panel, wxID_ANY, _(pair.first));
|
||||
shortcut->SetFont(bold_font);
|
||||
@ -95,6 +96,8 @@ void KBShortcutsDialog::fill_shortcuts()
|
||||
const std::string alt = "Alt+";
|
||||
#endif // __WXOSX__
|
||||
|
||||
m_full_shortcuts.reserve(4);
|
||||
|
||||
Shortcuts main_shortcuts;
|
||||
main_shortcuts.reserve(25);
|
||||
|
||||
@ -122,7 +125,7 @@ void KBShortcutsDialog::fill_shortcuts()
|
||||
main_shortcuts.push_back(Shortcut("?" ,L("Show keyboard shortcuts list")));
|
||||
main_shortcuts.push_back(Shortcut("Shift+LeftMouse", L("Select multiple object/Move multiple object")));
|
||||
|
||||
m_full_shortcuts.emplace(_(L("Main Shortcuts")), main_shortcuts);
|
||||
m_full_shortcuts.push_back(std::make_pair( _(L("Main Shortcuts")), std::make_pair(main_shortcuts, 0) ));
|
||||
|
||||
|
||||
Shortcuts plater_shortcuts;
|
||||
@ -138,6 +141,8 @@ void KBShortcutsDialog::fill_shortcuts()
|
||||
plater_shortcuts.push_back(Shortcut("C", L("Gizmo cut")));
|
||||
plater_shortcuts.push_back(Shortcut("F", L("Gizmo Place face on bed")));
|
||||
plater_shortcuts.push_back(Shortcut("L", L("Gizmo SLA support points")));
|
||||
plater_shortcuts.push_back(Shortcut("Shift+", L("Press to snap by 5% in Gizmo scale\nor by 1mm in Gizmo move")));
|
||||
plater_shortcuts.push_back(Shortcut(alt, L("Press to scale or rotate selected objects\naround their own center")));
|
||||
plater_shortcuts.push_back(Shortcut("B", L("Zoom to Bed")));
|
||||
plater_shortcuts.push_back(Shortcut("Z", L("Zoom to all objects in scene, if none selected")));
|
||||
plater_shortcuts.push_back(Shortcut("Z", L("Zoom to selected object")));
|
||||
@ -145,16 +150,40 @@ void KBShortcutsDialog::fill_shortcuts()
|
||||
plater_shortcuts.push_back(Shortcut("O", L("Zoom out")));
|
||||
plater_shortcuts.push_back(Shortcut("ESC", L("Unselect gizmo, keep object selection")));
|
||||
|
||||
m_full_shortcuts.emplace(_(L("Plater Shortcuts")), plater_shortcuts);
|
||||
m_full_shortcuts.push_back(std::make_pair(_(L("Plater Shortcuts")), std::make_pair(plater_shortcuts, 1)));
|
||||
|
||||
|
||||
// Shortcuts gizmo_shortcuts;
|
||||
// gizmo_shortcuts.reserve(2);
|
||||
//
|
||||
// gizmo_shortcuts.push_back(Shortcut("Shift+", L("Press to snap by 5% in Gizmo Scale\n or by 1mm in Gizmo Move")));
|
||||
// gizmo_shortcuts.push_back(Shortcut(alt, L("Press to scale or rotate selected objects around their own center")));
|
||||
//
|
||||
// m_full_shortcuts.push_back(std::make_pair(_(L("Gizmo Shortcuts")), std::make_pair(gizmo_shortcuts, 1)));
|
||||
|
||||
|
||||
Shortcuts preview_shortcuts;
|
||||
preview_shortcuts.reserve(2);
|
||||
preview_shortcuts.reserve(4);
|
||||
|
||||
preview_shortcuts.push_back(Shortcut(L("Arrow Up"), L("Upper Layer")));
|
||||
preview_shortcuts.push_back(Shortcut(L("Arrow Down"), L("Lower Layer")));
|
||||
preview_shortcuts.push_back(Shortcut("U", L("Upper Layer")));
|
||||
preview_shortcuts.push_back(Shortcut("D", L("Lower Layer")));
|
||||
|
||||
m_full_shortcuts.emplace(_(L("Preview Shortcuts")), preview_shortcuts);
|
||||
m_full_shortcuts.push_back(std::make_pair( _(L("Preview Shortcuts")), std::make_pair(preview_shortcuts, 0) ));
|
||||
|
||||
|
||||
Shortcuts layers_slider_shortcuts;
|
||||
layers_slider_shortcuts.reserve(6);
|
||||
|
||||
layers_slider_shortcuts.push_back(Shortcut(L("Arrow Up"), L("Move current slider thump Up")));
|
||||
layers_slider_shortcuts.push_back(Shortcut(L("Arrow Down"), L("Move current slider thump Down")));
|
||||
layers_slider_shortcuts.push_back(Shortcut(L("Arrow Left"), L("Set upper thumb to current slider thumb")));
|
||||
layers_slider_shortcuts.push_back(Shortcut(L("Arrow Right"),L("Set lower thumb to current slider thumb")));
|
||||
layers_slider_shortcuts.push_back(Shortcut("+", L("Add color change marker for current layer")));
|
||||
layers_slider_shortcuts.push_back(Shortcut("-", L("Delete color change marker for current layer")));
|
||||
|
||||
m_full_shortcuts.push_back(std::make_pair( _(L("Layers Slider Shortcuts")), std::make_pair(layers_slider_shortcuts, 1) ));
|
||||
}
|
||||
|
||||
void KBShortcutsDialog::onCloseDialog(wxEvent &)
|
||||
|
@ -11,11 +11,11 @@ class KBShortcutsDialog : public wxDialog
|
||||
{
|
||||
typedef std::pair<std::string, std::string> Shortcut;
|
||||
typedef std::vector< Shortcut > Shortcuts;
|
||||
typedef std::map<wxString, Shortcuts> ShortcutsMap;
|
||||
typedef std::vector< std::pair<wxString, std::pair<Shortcuts, int>> > ShortcutsVec;
|
||||
|
||||
wxString text_info {wxEmptyString};
|
||||
|
||||
ShortcutsMap m_full_shortcuts;
|
||||
ShortcutsVec m_full_shortcuts;
|
||||
|
||||
public:
|
||||
KBShortcutsDialog();
|
||||
|
@ -896,7 +896,7 @@ std::vector<PresetComboBox*>& Sidebar::combos_filament()
|
||||
class PlaterDropTarget : public wxFileDropTarget
|
||||
{
|
||||
public:
|
||||
PlaterDropTarget(Plater *plater) : plater(plater) {}
|
||||
PlaterDropTarget(Plater *plater) : plater(plater) { this->SetDefaultAction(wxDragCopy); }
|
||||
|
||||
virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString &filenames);
|
||||
|
||||
@ -2648,6 +2648,10 @@ bool Plater::priv::can_mirror() const
|
||||
void Plater::priv::update_object_menu()
|
||||
{
|
||||
sidebar->obj_list()->append_menu_items_add_volume(&object_menu);
|
||||
#if ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
if (view3D != nullptr)
|
||||
view3D->update_toolbar_items_visibility();
|
||||
#endif // ENABLE_MODE_AWARE_TOOLBAR_ITEMS
|
||||
}
|
||||
|
||||
// Plater / Public
|
||||
|
@ -336,7 +336,7 @@ const std::vector<std::string>& Preset::print_options()
|
||||
"support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers",
|
||||
"support_material_interface_spacing", "support_material_interface_contact_loops", "support_material_contact_distance",
|
||||
"support_material_buildplate_only", "dont_support_bridges", "notes", "complete_objects", "extruder_clearance_radius",
|
||||
"extruder_clearance_height", "gcode_comments", "output_filename_format", "post_process", "perimeter_extruder",
|
||||
"extruder_clearance_height", "gcode_comments", "gcode_label_objects", "output_filename_format", "post_process", "perimeter_extruder",
|
||||
"infill_extruder", "solid_infill_extruder", "support_material_extruder", "support_material_interface_extruder",
|
||||
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
|
||||
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
|
||||
@ -1163,7 +1163,7 @@ std::string PresetCollection::name() const
|
||||
case Preset::TYPE_PRINT: return L("print");
|
||||
case Preset::TYPE_FILAMENT: return L("filament");
|
||||
case Preset::TYPE_SLA_PRINT: return L("SLA print");
|
||||
case Preset::TYPE_SLA_MATERIAL: return L("SLA material");
|
||||
case Preset::TYPE_SLA_MATERIAL: return L("SLA material");
|
||||
case Preset::TYPE_PRINTER: return L("printer");
|
||||
default: return "invalid";
|
||||
}
|
||||
|
@ -1095,6 +1095,7 @@ void TabPrint::build()
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Output file")));
|
||||
optgroup->append_single_option_line("gcode_comments");
|
||||
optgroup->append_single_option_line("gcode_label_objects");
|
||||
option = optgroup->get_option("output_filename_format");
|
||||
option.opt.full_width = true;
|
||||
optgroup->append_single_option_line(option);
|
||||
|
Loading…
Reference in New Issue
Block a user