New selection -> removed obsolete methods\n+\nFixed a few compile warnings

This commit is contained in:
Enrico Turri 2018-10-08 15:17:36 +02:00
parent 384cfa0e6d
commit 9ae6d115a2
14 changed files with 39 additions and 29 deletions

View file

@ -1350,7 +1350,7 @@ namespace Slic3r {
return false;
}
m_curr_config.volume_id = object->second.volumes.size();
m_curr_config.volume_id = (int)object->second.volumes.size();
unsigned int first_triangle_id = (unsigned int)get_attribute_value_int(attributes, num_attributes, FIRST_TRIANGLE_ID_ATTR);
unsigned int last_triangle_id = (unsigned int)get_attribute_value_int(attributes, num_attributes, LAST_TRIANGLE_ID_ATTR);
@ -1408,7 +1408,7 @@ namespace Slic3r {
return false;
}
unsigned int geo_tri_count = geometry.triangles.size() / 3;
unsigned int geo_tri_count = (unsigned int)geometry.triangles.size() / 3;
for (const ObjectMetadata::VolumeMetadata& volume_data : volumes)
{
@ -1429,7 +1429,7 @@ namespace Slic3r {
unsigned int src_start_id = volume_data.first_triangle_id * 3;
for (size_t i = 0; i < triangles_count; ++i)
for (unsigned int i = 0; i < triangles_count; ++i)
{
unsigned int ii = i * 3;
stl_facet& facet = stl.facet_start[i];

View file

@ -911,7 +911,7 @@ bool store_amf(const char *path, Model *model, Print* print, bool export_print_c
if (volume->is_modifier())
stream << " <metadata type=\"slic3r.modifier\">1</metadata>\n";
stream << " <metadata type=\"slic3r.volume_type\">" << ModelVolume::type_to_string(volume->type()) << "</metadata>\n";
for (int i = 0; i < volume->mesh.stl.stats.number_of_facets; ++i) {
for (int i = 0; i < (int)volume->mesh.stl.stats.number_of_facets; ++i) {
stream << " <triangle>\n";
for (int j = 0; j < 3; ++j)
stream << " <v" << j + 1 << ">" << volume->mesh.stl.v_indices[i].vertex[j] + vertices_offset << "</v" << j + 1 << ">\n";

View file

@ -37,7 +37,7 @@ static_assert(sizeof(StlHeader) == 84, "StlHeader size not correct");
class LineReader
{
public:
LineReader(std::vector<char> &data) : m_buffer(data), m_pos(0), m_len(data.size()) {}
LineReader(std::vector<char> &data) : m_buffer(data), m_pos(0), m_len((int)data.size()) {}
const char* next_line() {
// Skip empty lines.
@ -154,7 +154,7 @@ static void extract_model_from_archive(
#if ENABLE_MODELINSTANCE_3D_FULL_TRANSFORM
instance_offset = Vec3d((double)(position[0] - zero[0]), (double)(position[1] - zero[1]), (double)(position[2] - zero[2]));
// CHECK_ME -> Is the following correct ?
trafo[2][3] = position[2] / instance_scaling_factor(2);
trafo[2][3] = position[2] / (float)instance_scaling_factor(2);
#else
instance_offset(0) = position[0] - zero[0];
instance_offset(1) = position[1] - zero[1];
@ -291,8 +291,8 @@ static void extract_model_from_archive(
if (! facets.empty() && solid_name.empty()) {
stl_file &stl = mesh.stl;
stl.stats.type = inmemory;
stl.stats.number_of_facets = facets.size();
stl.stats.original_num_facets = facets.size();
stl.stats.number_of_facets = (uint32_t)facets.size();
stl.stats.original_num_facets = (int)facets.size();
stl_allocate(&stl);
memcpy((void*)stl.facet_start, facets.data(), facets.size() * 50);
stl_get_size(&stl);