../src/slic3r/GUI/IconManager.cpp:174:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../src/slic3r/GUI/SurfaceDrag.cpp:104:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Slic3r::GLVolume*>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
../src/slic3r/GUI/SurfaceDrag.cpp:57:30: warning: 'std::optional<double> Slic3r::GUI::calc_scale(const Matrix3d&, const Matrix3d&, const Vec3d&)' defined but not used [-Wunused-function]
../src/slic3r/Utils/RaycastManager.cpp:14:56: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
../src/slic3r/Utils/RaycastManager.cpp:316:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<Slic3r::GLVolume*>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
This commit is contained in:
Filip Sykala - NTB T15p 2023-03-17 09:29:28 +01:00
parent bc825ec7d7
commit 19d02e6d74
3 changed files with 16 additions and 11 deletions

View File

@ -171,7 +171,7 @@ void draw(const IconManager::Icon &icon, const ImVec2 &size, const ImVec4 &tint_
return;
}
ImTextureID id = (void *) icon.tex_id;
ImTextureID id = (void *)static_cast<intptr_t>(icon.tex_id);
const ImVec2 &s = (size.x < 1 || size.y < 1) ? icon.size : size;
ImGui::Image(id, s, icon.tl, icon.br, tint_col, border_col);
}

View File

@ -53,8 +53,8 @@ static Vec2d calc_screen_offset_to_volume_center(const Vec2d &screen_coor, const
return nearest_offset;
}
// Calculate scale in world
static std::optional<double> calc_scale(const Matrix3d &from, const Matrix3d &to, const Vec3d &dir)
// Calculate scale in world for check in debug
[[maybe_unused]] static std::optional<double> calc_scale(const Matrix3d &from, const Matrix3d &to, const Vec3d &dir)
{
Vec3d from_dir = from * dir;
Vec3d to_dir = to * dir;
@ -98,11 +98,13 @@ bool on_mouse_surface_drag(const wxMouseEvent &mouse_event,
return false;
// is selected volume closest hovered?
const GLVolumePtrs &gl_volumes = canvas.get_volumes().volumes;
int hovered_idx = canvas.get_first_hover_volume_idx();
if (hovered_idx < 0 ||
hovered_idx >= gl_volumes.size() ||
gl_volumes[hovered_idx] != gl_volume)
const GLVolumePtrs &gl_volumes = canvas.get_volumes().volumes;
if (int hovered_idx = canvas.get_first_hover_volume_idx();
hovered_idx < 0)
return false;
else if (auto hovered_idx_ = static_cast<size_t>(hovered_idx);
hovered_idx_ >= gl_volumes.size() ||
gl_volumes[hovered_idx_] != gl_volume)
return false;
const ModelObject *object = get_model_object(*gl_volume, canvas.get_model()->objects);

View File

@ -11,7 +11,7 @@ static RaycastManager::TrKey create_key(const ModelVolume& volume, const ModelIn
return std::make_pair(instance.id().id, volume.id().id); }
static RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key);
static bool is_lower_key(const RaycastManager::TrKey &k1, const RaycastManager::TrKey &k2) {
return k1.first < k2.first || k1.first == k2.first && k1.second < k2.second; }
return k1.first < k2.first || (k1.first == k2.first && k1.second < k2.second); }
static bool is_lower(const RaycastManager::TrItem &i1, const RaycastManager::TrItem &i2) {
return is_lower_key(i1.first, i2.first); };
}
@ -313,9 +313,12 @@ RaycastManager::Meshes create_meshes(GLCanvas3D &canvas, const RaycastManager::A
RaycastManager::Meshes meshes;
for (const std::shared_ptr<SceneRaycasterItem> &caster : casters) {
int index = SceneRaycaster::decode_id(type, caster->get_id());
if (index < 0 || index >= gl_volumes.size())
if (index < 0)
continue;
const GLVolume *gl_volume = gl_volumes[index];
auto index_ = static_cast<size_t>(index);
if(index_ >= gl_volumes.size())
continue;
const GLVolume *gl_volume = gl_volumes[index_];
const ModelVolume *volume = get_model_volume(*gl_volume, objects);
size_t id = volume->id().id;
if (condition.skip(id))