mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fixed some more warnings (mostly GLGizmoSlaSupports.cpp)
This commit is contained in:
parent
570bec299f
commit
09e4ac42ba
6 changed files with 13 additions and 17 deletions
|
@ -108,7 +108,6 @@ static inline bool opts_equal(const DynamicConfig &config_old, const DynamicConf
|
||||||
|
|
||||||
std::vector<std::string> PlaceholderParser::config_diff(const DynamicPrintConfig &rhs)
|
std::vector<std::string> PlaceholderParser::config_diff(const DynamicPrintConfig &rhs)
|
||||||
{
|
{
|
||||||
const ConfigDef *def = rhs.def();
|
|
||||||
std::vector<std::string> diff_keys;
|
std::vector<std::string> diff_keys;
|
||||||
for (const t_config_option_key &opt_key : rhs.keys())
|
for (const t_config_option_key &opt_key : rhs.keys())
|
||||||
if (! opts_equal(m_config, rhs, opt_key))
|
if (! opts_equal(m_config, rhs, opt_key))
|
||||||
|
@ -124,7 +123,6 @@ std::vector<std::string> PlaceholderParser::config_diff(const DynamicPrintConfig
|
||||||
// a current extruder ID is used.
|
// a current extruder ID is used.
|
||||||
bool PlaceholderParser::apply_config(const DynamicPrintConfig &rhs)
|
bool PlaceholderParser::apply_config(const DynamicPrintConfig &rhs)
|
||||||
{
|
{
|
||||||
const ConfigDef *def = rhs.def();
|
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
for (const t_config_option_key &opt_key : rhs.keys()) {
|
for (const t_config_option_key &opt_key : rhs.keys()) {
|
||||||
if (! opts_equal(m_config, rhs, opt_key)) {
|
if (! opts_equal(m_config, rhs, opt_key)) {
|
||||||
|
|
|
@ -2049,7 +2049,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
{
|
{
|
||||||
int threads = (unsigned int)boost::thread::hardware_concurrency();
|
int threads = (unsigned int)boost::thread::hardware_concurrency();
|
||||||
def->set_default_value(new ConfigOptionInt(threads > 0 ? threads : 2));
|
def->set_default_value(new ConfigOptionInt(threads > 0 ? threads : 2));
|
||||||
def->cli == ConfigOptionDef::nocli;
|
def->cli = ConfigOptionDef::nocli;
|
||||||
}
|
}
|
||||||
|
|
||||||
def = this->add("toolchange_gcode", coString);
|
def = this->add("toolchange_gcode", coString);
|
||||||
|
|
|
@ -79,12 +79,14 @@ void PrintRegion::collect_object_printing_extruders(const PrintConfig &print_con
|
||||||
|
|
||||||
void PrintRegion::collect_object_printing_extruders(std::vector<unsigned int> &object_extruders) const
|
void PrintRegion::collect_object_printing_extruders(std::vector<unsigned int> &object_extruders) const
|
||||||
{
|
{
|
||||||
auto num_extruders = (int)print()->config().nozzle_diameter.size();
|
|
||||||
// PrintRegion, if used by some PrintObject, shall have all the extruders set to an existing printer extruder.
|
// PrintRegion, if used by some PrintObject, shall have all the extruders set to an existing printer extruder.
|
||||||
// If not, then there must be something wrong with the Print::apply() function.
|
// If not, then there must be something wrong with the Print::apply() function.
|
||||||
|
#ifndef NDEBUG
|
||||||
|
auto num_extruders = (int)print()->config().nozzle_diameter.size();
|
||||||
assert(this->config().perimeter_extruder <= num_extruders);
|
assert(this->config().perimeter_extruder <= num_extruders);
|
||||||
assert(this->config().infill_extruder <= num_extruders);
|
assert(this->config().infill_extruder <= num_extruders);
|
||||||
assert(this->config().solid_infill_extruder <= num_extruders);
|
assert(this->config().solid_infill_extruder <= num_extruders);
|
||||||
|
#endif
|
||||||
collect_object_printing_extruders(print()->config(), this->config(), object_extruders);
|
collect_object_printing_extruders(print()->config(), this->config(), object_extruders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -185,8 +185,6 @@ private:
|
||||||
|
|
||||||
SLAAutoSupports::Config m_config;
|
SLAAutoSupports::Config m_config;
|
||||||
|
|
||||||
float m_supports_force_total = 0.f;
|
|
||||||
|
|
||||||
void process(const std::vector<ExPolygons>& slices, const std::vector<float>& heights);
|
void process(const std::vector<ExPolygons>& slices, const std::vector<float>& heights);
|
||||||
void uniformly_cover(const ExPolygons& islands, Structure& structure, PointGrid3D &grid3d, bool is_new_island = false, bool just_one = false);
|
void uniformly_cover(const ExPolygons& islands, Structure& structure, PointGrid3D &grid3d, bool is_new_island = false, bool just_one = false);
|
||||||
void project_onto_mesh(std::vector<sla::SupportPoint>& points) const;
|
void project_onto_mesh(std::vector<sla::SupportPoint>& points) const;
|
||||||
|
|
|
@ -308,7 +308,7 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
render_color[3] = 1.f;
|
render_color[3] = 1.f;
|
||||||
if ((m_hover_id == i && m_editing_mode)) { // ignore hover state unless editing mode is active
|
if ((size_t(m_hover_id) == i && m_editing_mode)) { // ignore hover state unless editing mode is active
|
||||||
render_color[0] = 0.f;
|
render_color[0] = 0.f;
|
||||||
render_color[1] = 1.0f;
|
render_color[1] = 1.0f;
|
||||||
render_color[2] = 1.0f;
|
render_color[2] = 1.0f;
|
||||||
|
@ -330,7 +330,7 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking)
|
||||||
|
|
||||||
// Inverse matrix of the instance scaling is applied so that the mark does not scale with the object.
|
// Inverse matrix of the instance scaling is applied so that the mark does not scale with the object.
|
||||||
glsafe(::glPushMatrix());
|
glsafe(::glPushMatrix());
|
||||||
glsafe(::glTranslated(support_point.pos(0), support_point.pos(1), support_point.pos(2)));
|
glsafe(::glTranslatef(support_point.pos(0), support_point.pos(1), support_point.pos(2)));
|
||||||
glsafe(::glMultMatrixd(instance_scaling_matrix_inverse.data()));
|
glsafe(::glMultMatrixd(instance_scaling_matrix_inverse.data()));
|
||||||
|
|
||||||
if (vol->is_left_handed())
|
if (vol->is_left_handed())
|
||||||
|
@ -347,16 +347,16 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking)
|
||||||
Eigen::AngleAxisd aa(q);
|
Eigen::AngleAxisd aa(q);
|
||||||
glsafe(::glRotated(aa.angle() * (180. / M_PI), aa.axis()(0), aa.axis()(1), aa.axis()(2)));
|
glsafe(::glRotated(aa.angle() * (180. / M_PI), aa.axis()(0), aa.axis()(1), aa.axis()(2)));
|
||||||
|
|
||||||
const float cone_radius = 0.25f; // mm
|
const double cone_radius = 0.25; // mm
|
||||||
const float cone_height = 0.75f;
|
const double cone_height = 0.75;
|
||||||
glsafe(::glPushMatrix());
|
glsafe(::glPushMatrix());
|
||||||
glsafe(::glTranslatef(0.f, 0.f, support_point.head_front_radius * RenderPointScale));
|
glsafe(::glTranslatef(0.f, 0.f, support_point.head_front_radius * RenderPointScale));
|
||||||
::gluCylinder(m_quadric, 0.f, cone_radius, cone_height, 24, 1);
|
::gluCylinder(m_quadric, 0., cone_radius, cone_height, 24, 1);
|
||||||
glsafe(::glTranslatef(0.f, 0.f, cone_height));
|
glsafe(::glTranslatef(0.f, 0.f, cone_height));
|
||||||
::gluDisk(m_quadric, 0.0, cone_radius, 24, 1);
|
::gluDisk(m_quadric, 0.0, cone_radius, 24, 1);
|
||||||
glsafe(::glPopMatrix());
|
glsafe(::glPopMatrix());
|
||||||
}
|
}
|
||||||
::gluSphere(m_quadric, support_point.head_front_radius * RenderPointScale, 24, 12);
|
::gluSphere(m_quadric, (double)support_point.head_front_radius * RenderPointScale, 24, 12);
|
||||||
if (vol->is_left_handed())
|
if (vol->is_left_handed())
|
||||||
glFrontFace(GL_CCW);
|
glFrontFace(GL_CCW);
|
||||||
|
|
||||||
|
@ -777,7 +777,7 @@ std::vector<const ConfigOption*> GLGizmoSlaSupports::get_config_options(const st
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GLGizmoSlaSupports::update_cache_entry_normal(unsigned int i) const
|
void GLGizmoSlaSupports::update_cache_entry_normal(size_t i) const
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
Eigen::Matrix<float, 1, 3> pp = m_editing_cache[i].support_point.pos;
|
Eigen::Matrix<float, 1, 3> pp = m_editing_cache[i].support_point.pos;
|
||||||
|
|
|
@ -30,7 +30,7 @@ private:
|
||||||
ObjectID m_model_object_id = 0;
|
ObjectID m_model_object_id = 0;
|
||||||
int m_active_instance = -1;
|
int m_active_instance = -1;
|
||||||
float m_active_instance_bb_radius; // to cache the bb
|
float m_active_instance_bb_radius; // to cache the bb
|
||||||
mutable float m_z_shift = 0.f;
|
mutable double m_z_shift = 0.f;
|
||||||
bool unproject_on_mesh(const Vec2d& mouse_pos, std::pair<Vec3f, Vec3f>& pos_and_normal);
|
bool unproject_on_mesh(const Vec2d& mouse_pos, std::pair<Vec3f, Vec3f>& pos_and_normal);
|
||||||
|
|
||||||
const float RenderPointScale = 1.f;
|
const float RenderPointScale = 1.f;
|
||||||
|
@ -99,11 +99,9 @@ private:
|
||||||
void render_clipping_plane(const Selection& selection) const;
|
void render_clipping_plane(const Selection& selection) const;
|
||||||
bool is_mesh_update_necessary() const;
|
bool is_mesh_update_necessary() const;
|
||||||
void update_mesh();
|
void update_mesh();
|
||||||
void update_cache_entry_normal(unsigned int i) const;
|
void update_cache_entry_normal(size_t i) const;
|
||||||
bool unsaved_changes() const;
|
bool unsaved_changes() const;
|
||||||
|
|
||||||
EState m_no_hover_state = Off;
|
|
||||||
EState m_no_hover_old_state = Off;
|
|
||||||
bool m_lock_unique_islands = false;
|
bool m_lock_unique_islands = false;
|
||||||
bool m_editing_mode = false; // Is editing mode active?
|
bool m_editing_mode = false; // Is editing mode active?
|
||||||
bool m_old_editing_state = false; // To keep track of whether the user toggled between the modes (needed for imgui refreshes).
|
bool m_old_editing_state = false; // To keep track of whether the user toggled between the modes (needed for imgui refreshes).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue