mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-25 09:41:11 -06:00
Fixing Clang warnings 2
This commit is contained in:
parent
0ff0444dcc
commit
b85de89751
22 changed files with 70 additions and 107 deletions
|
|
@ -10,15 +10,6 @@
|
|||
|
||||
#include <GL/glew.h>
|
||||
|
||||
// phi / theta angles to orient the camera.
|
||||
static const float VIEW_DEFAULT[2] = { 45.0f, 45.0f };
|
||||
static const float VIEW_LEFT[2] = { 90.0f, 90.0f };
|
||||
static const float VIEW_RIGHT[2] = { -90.0f, 90.0f };
|
||||
static const float VIEW_TOP[2] = { 0.0f, 0.0f };
|
||||
static const float VIEW_BOTTOM[2] = { 0.0f, 180.0f };
|
||||
static const float VIEW_FRONT[2] = { 0.0f, 90.0f };
|
||||
static const float VIEW_REAR[2] = { 180.0f, 90.0f };
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
|
||||
|
|
|
|||
|
|
@ -113,8 +113,8 @@ public:
|
|||
|
||||
void field_changed() { on_change_field(); }
|
||||
|
||||
Field(const ConfigOptionDef& opt, const t_config_option_key& id) : m_opt(opt), m_opt_id(id) {};
|
||||
Field(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : m_parent(parent), m_opt(opt), m_opt_id(id) {};
|
||||
Field(const ConfigOptionDef& opt, const t_config_option_key& id) : m_opt(opt), m_opt_id(id) {}
|
||||
Field(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : m_parent(parent), m_opt(opt), m_opt_id(id) {}
|
||||
virtual ~Field();
|
||||
|
||||
/// If you don't know what you are getting back, check both methods for nullptr.
|
||||
|
|
@ -315,12 +315,12 @@ public:
|
|||
/// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
|
||||
void propagate_value() ;
|
||||
|
||||
void set_value(const std::string& value, bool change_event = false) {
|
||||
void set_value(const std::string& value, bool change_event = false) {
|
||||
m_disable_change_event = !change_event;
|
||||
dynamic_cast<wxSpinCtrl*>(window)->SetValue(value);
|
||||
m_disable_change_event = false;
|
||||
}
|
||||
void set_value(const boost::any& value, bool change_event = false) {
|
||||
}
|
||||
void set_value(const boost::any& value, bool change_event = false) override {
|
||||
m_disable_change_event = !change_event;
|
||||
tmp_value = boost::any_cast<int>(value);
|
||||
m_value = value;
|
||||
|
|
@ -395,8 +395,8 @@ public:
|
|||
boost::any& get_value() override;
|
||||
void msw_rescale() override;
|
||||
|
||||
void enable() override { dynamic_cast<wxColourPickerCtrl*>(window)->Enable(); };
|
||||
void disable() override{ dynamic_cast<wxColourPickerCtrl*>(window)->Disable(); };
|
||||
void enable() override { dynamic_cast<wxColourPickerCtrl*>(window)->Enable(); }
|
||||
void disable() override{ dynamic_cast<wxColourPickerCtrl*>(window)->Disable(); }
|
||||
wxWindow* getWindow() override { return window; }
|
||||
};
|
||||
|
||||
|
|
@ -456,8 +456,8 @@ public:
|
|||
|
||||
void msw_rescale() override;
|
||||
|
||||
void enable() override { dynamic_cast<wxStaticText*>(window)->Enable(); };
|
||||
void disable() override{ dynamic_cast<wxStaticText*>(window)->Disable(); };
|
||||
void enable() override { dynamic_cast<wxStaticText*>(window)->Enable(); }
|
||||
void disable() override{ dynamic_cast<wxStaticText*>(window)->Disable(); }
|
||||
wxWindow* getWindow() override { return window; }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2771,7 +2771,7 @@ void GCodeViewer::refresh_render_paths(bool keep_sequential_current_first, bool
|
|||
return color;
|
||||
};
|
||||
|
||||
auto travel_color = [this](const Path& path) {
|
||||
auto travel_color = [](const Path& path) {
|
||||
return (path.delta_extruder < 0.0f) ? Travel_Colors[2] /* Retract */ :
|
||||
((path.delta_extruder > 0.0f) ? Travel_Colors[1] /* Extrude */ :
|
||||
Travel_Colors[0] /* Move */);
|
||||
|
|
@ -3436,7 +3436,7 @@ void GCodeViewer::render_toolpaths() const
|
|||
shader.set_uniform("uniform_color", color4);
|
||||
};
|
||||
|
||||
auto render_as_points = [this, zoom, point_size, near_plane_height, set_uniform_color]
|
||||
auto render_as_points = [zoom, point_size, near_plane_height, set_uniform_color]
|
||||
(const TBuffer& buffer, unsigned int ibuffer_id, GLShaderProgram& shader) {
|
||||
#if ENABLE_FIXED_SCREEN_SIZE_POINT_MARKERS
|
||||
shader.set_uniform("use_fixed_screen_size", 1);
|
||||
|
|
@ -3466,7 +3466,7 @@ void GCodeViewer::render_toolpaths() const
|
|||
glsafe(::glDisable(GL_VERTEX_PROGRAM_POINT_SIZE));
|
||||
};
|
||||
|
||||
auto render_as_lines = [this, light_intensity, set_uniform_color](const TBuffer& buffer, unsigned int ibuffer_id, GLShaderProgram& shader) {
|
||||
auto render_as_lines = [light_intensity, set_uniform_color](const TBuffer& buffer, unsigned int ibuffer_id, GLShaderProgram& shader) {
|
||||
shader.set_uniform("light_intensity", light_intensity);
|
||||
for (const RenderPath& path : buffer.render_paths) {
|
||||
if (path.index_buffer_id == ibuffer_id) {
|
||||
|
|
@ -3479,7 +3479,7 @@ void GCodeViewer::render_toolpaths() const
|
|||
}
|
||||
};
|
||||
|
||||
auto render_as_triangles = [this, set_uniform_color](const TBuffer& buffer, unsigned int ibuffer_id, GLShaderProgram& shader) {
|
||||
auto render_as_triangles = [set_uniform_color](const TBuffer& buffer, unsigned int ibuffer_id, GLShaderProgram& shader) {
|
||||
for (const RenderPath& path : buffer.render_paths) {
|
||||
if (path.index_buffer_id == ibuffer_id) {
|
||||
set_uniform_color(path.color, shader);
|
||||
|
|
@ -3874,8 +3874,8 @@ void GCodeViewer::render_legend() const
|
|||
ImGui::PopStyleVar();
|
||||
};
|
||||
|
||||
auto append_range = [this, draw_list, &imgui, append_item](const Extrusions::Range& range, unsigned int decimals) {
|
||||
auto append_range_item = [this, draw_list, &imgui, append_item](int i, float value, unsigned int decimals) {
|
||||
auto append_range = [append_item](const Extrusions::Range& range, unsigned int decimals) {
|
||||
auto append_range_item = [append_item](int i, float value, unsigned int decimals) {
|
||||
char buf[1024];
|
||||
::sprintf(buf, "%.*f", decimals, value);
|
||||
append_item(EItemType::Rect, Range_Colors[i], buf);
|
||||
|
|
@ -3969,7 +3969,7 @@ void GCodeViewer::render_legend() const
|
|||
return _u8L("from") + " " + std::string(buf1) + " " + _u8L("to") + " " + std::string(buf2) + " " + _u8L("mm");
|
||||
};
|
||||
|
||||
auto role_time_and_percent = [this, time_mode](ExtrusionRole role) {
|
||||
auto role_time_and_percent = [ time_mode](ExtrusionRole role) {
|
||||
auto it = std::find_if(time_mode.roles_times.begin(), time_mode.roles_times.end(), [role](const std::pair<ExtrusionRole, float>& item) { return role == item.first; });
|
||||
return (it != time_mode.roles_times.end()) ? std::make_pair(it->second, it->second / time_mode.time) : std::make_pair(0.0f, 0.0f);
|
||||
};
|
||||
|
|
@ -4177,7 +4177,7 @@ void GCodeViewer::render_legend() const
|
|||
return items;
|
||||
};
|
||||
|
||||
auto append_color_change = [this, &imgui](const Color& color1, const Color& color2, const std::array<float, 2>& offsets, const Times& times) {
|
||||
auto append_color_change = [&imgui](const Color& color1, const Color& color2, const std::array<float, 2>& offsets, const Times& times) {
|
||||
imgui.text(_u8L("Color change"));
|
||||
ImGui::SameLine();
|
||||
|
||||
|
|
@ -4196,7 +4196,7 @@ void GCodeViewer::render_legend() const
|
|||
imgui.text(short_time(get_time_dhms(times.second - times.first)));
|
||||
};
|
||||
|
||||
auto append_print = [this, &imgui](const Color& color, const std::array<float, 2>& offsets, const Times& times) {
|
||||
auto append_print = [&imgui](const Color& color, const std::array<float, 2>& offsets, const Times& times) {
|
||||
imgui.text(_u8L("Print"));
|
||||
ImGui::SameLine();
|
||||
|
||||
|
|
|
|||
|
|
@ -394,7 +394,6 @@ class GLCanvas3D
|
|||
class Slope
|
||||
{
|
||||
bool m_enabled{ false };
|
||||
bool m_dialog_shown{ false };
|
||||
GLCanvas3D& m_canvas;
|
||||
GLVolumeCollection& m_volumes;
|
||||
static float s_window_width;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ void disable_screensaver()
|
|||
{
|
||||
#if __APPLE__
|
||||
CFStringRef reasonForActivity = CFSTR("Slic3r");
|
||||
IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
|
||||
[[maybe_unused]]IOReturn success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
|
||||
kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
|
||||
// ignore result: success == kIOReturnSuccess
|
||||
#elif _WIN32
|
||||
|
|
@ -46,7 +46,7 @@ void disable_screensaver()
|
|||
void enable_screensaver()
|
||||
{
|
||||
#if __APPLE__
|
||||
IOReturn success = IOPMAssertionRelease(assertionID);
|
||||
IOPMAssertionRelease(assertionID);
|
||||
#elif _WIN32
|
||||
SetThreadExecutionState(ES_CONTINUOUS);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,17 +31,17 @@ public:
|
|||
std::string get_tooltip() const override;
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual void on_load(cereal::BinaryInputArchive& ar) { ar(m_cut_z, m_keep_upper, m_keep_lower, m_rotate_lower); }
|
||||
virtual void on_save(cereal::BinaryOutputArchive& ar) const { ar(m_cut_z, m_keep_upper, m_keep_lower, m_rotate_lower); }
|
||||
virtual std::string on_get_name() const;
|
||||
virtual void on_set_state();
|
||||
virtual bool on_is_activable() const;
|
||||
virtual void on_start_dragging();
|
||||
virtual void on_update(const UpdateData& data);
|
||||
virtual void on_render() const;
|
||||
virtual void on_render_for_picking() const;
|
||||
virtual void on_render_input_window(float x, float y, float bottom_limit);
|
||||
virtual bool on_init() override;
|
||||
virtual void on_load(cereal::BinaryInputArchive& ar) override{ ar(m_cut_z, m_keep_upper, m_keep_lower, m_rotate_lower); }
|
||||
virtual void on_save(cereal::BinaryOutputArchive& ar) const override { ar(m_cut_z, m_keep_upper, m_keep_lower, m_rotate_lower); }
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual void on_set_state() override;
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_start_dragging() override;
|
||||
virtual void on_update(const UpdateData& data) override;
|
||||
virtual void on_render() const override;
|
||||
virtual void on_render_for_picking() const override;
|
||||
virtual void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
|
||||
private:
|
||||
void update_max_z(const Selection& selection) const;
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ public:
|
|||
std::string get_tooltip() const override;
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual std::string on_get_name() const;
|
||||
virtual bool on_is_activable() const;
|
||||
virtual void on_start_dragging();
|
||||
virtual void on_stop_dragging();
|
||||
virtual void on_update(const UpdateData& data);
|
||||
virtual void on_render() const;
|
||||
virtual void on_render_for_picking() const;
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_start_dragging() override;
|
||||
virtual void on_stop_dragging() override;
|
||||
virtual void on_update(const UpdateData& data) override;
|
||||
virtual void on_render() const override;
|
||||
virtual void on_render_for_picking() const override;
|
||||
|
||||
private:
|
||||
double calc_projection(const UpdateData& data) const;
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ class GLGizmoPainterBase : public GLGizmoBase
|
|||
private:
|
||||
ObjectID m_old_mo_id;
|
||||
size_t m_old_volumes_size = 0;
|
||||
virtual void on_render() const {}
|
||||
virtual void on_render_for_picking() const {}
|
||||
virtual void on_render() const override {}
|
||||
virtual void on_render_for_picking() const override {}
|
||||
|
||||
public:
|
||||
GLGizmoPainterBase(GLCanvas3D& parent, const std::string& icon_filename, unsigned int sprite_id);
|
||||
|
|
|
|||
|
|
@ -47,13 +47,13 @@ public:
|
|||
std::string get_tooltip() const override;
|
||||
|
||||
protected:
|
||||
virtual bool on_init();
|
||||
virtual std::string on_get_name() const;
|
||||
virtual bool on_is_activable() const;
|
||||
virtual void on_start_dragging();
|
||||
virtual void on_update(const UpdateData& data);
|
||||
virtual void on_render() const;
|
||||
virtual void on_render_for_picking() const;
|
||||
virtual bool on_init() override;
|
||||
virtual std::string on_get_name() const override;
|
||||
virtual bool on_is_activable() const override;
|
||||
virtual void on_start_dragging() override;
|
||||
virtual void on_update(const UpdateData& data) override;
|
||||
virtual void on_render() const override;
|
||||
virtual void on_render_for_picking() const override;
|
||||
|
||||
private:
|
||||
void render_grabbers_connection(unsigned int id_1, unsigned int id_2) const;
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ protected:
|
|||
|
||||
private:
|
||||
ModelObject* m_model_object = nullptr;
|
||||
int m_active_inst = -1;
|
||||
// int m_active_inst = -1;
|
||||
float m_z_shift = 0.f;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class MainFrame : public DPIFrame
|
|||
ESettingsLayout m_layout{ ESettingsLayout::Unknown };
|
||||
|
||||
protected:
|
||||
virtual void on_dpi_changed(const wxRect &suggested_rect);
|
||||
virtual void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||
virtual void on_sys_color_changed() override;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -273,7 +273,6 @@ private:
|
|||
const DynamicPrintConfig* m_config {nullptr};
|
||||
// If the config is modelconfig, then ModelConfig::touch() has to be called after value change.
|
||||
ModelConfig* m_modelconfig { nullptr };
|
||||
bool m_full_labels{ 0 };
|
||||
t_opt_map m_opt_map;
|
||||
std::string m_config_category;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public:
|
|||
OctoPrint(DynamicPrintConfig *config);
|
||||
~OctoPrint() override = default;
|
||||
|
||||
const char* get_name() const;
|
||||
const char* get_name() const override;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg () const override;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public:
|
|||
Repetier(DynamicPrintConfig *config);
|
||||
~Repetier() override = default;
|
||||
|
||||
const char* get_name() const;
|
||||
const char* get_name() const override;
|
||||
|
||||
bool test(wxString &curl_msg) const override;
|
||||
wxString get_test_ok_msg () const override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue