ENABLE_ENHANCED_RELOAD_FROM_DISK set as default

This commit is contained in:
Enrico Turri 2019-09-23 15:35:49 +02:00
parent 1115e77b38
commit 2dc9949a4c
13 changed files with 10 additions and 269 deletions
src/libslic3r

View file

@ -141,14 +141,12 @@ Model Model::read_from_archive(const std::string& input_file, DynamicPrintConfig
for (ModelObject *o : model.objects)
{
#if !ENABLE_ENHANCED_RELOAD_FROM_DISK
if (boost::algorithm::iends_with(input_file, ".zip.amf"))
{
// we remove the .zip part of the extension to avoid it be added to filenames when exporting
o->input_file = boost::ireplace_last_copy(input_file, ".zip.", ".");
}
else
#endif // !ENABLE_ENHANCED_RELOAD_FROM_DISK
// if (boost::algorithm::iends_with(input_file, ".zip.amf"))
// {
// // we remove the .zip part of the extension to avoid it be added to filenames when exporting
// o->input_file = boost::ireplace_last_copy(input_file, ".zip.", ".");
// }
// else
o->input_file = input_file;
}
@ -172,11 +170,9 @@ ModelObject* Model::add_object(const char *name, const char *path, const Triangl
new_object->input_file = path;
ModelVolume *new_volume = new_object->add_volume(mesh);
new_volume->name = name;
#if ENABLE_ENHANCED_RELOAD_FROM_DISK
new_volume->source.input_file = path;
new_volume->source.object_idx = (int)this->objects.size() - 1;
new_volume->source.volume_idx = (int)new_object->volumes.size() - 1;
#endif // ENABLE_ENHANCED_RELOAD_FROM_DISK
new_object->invalidate_bounding_box();
return new_object;
}
@ -189,11 +185,9 @@ ModelObject* Model::add_object(const char *name, const char *path, TriangleMesh
new_object->input_file = path;
ModelVolume *new_volume = new_object->add_volume(std::move(mesh));
new_volume->name = name;
#if ENABLE_ENHANCED_RELOAD_FROM_DISK
new_volume->source.input_file = path;
new_volume->source.object_idx = (int)this->objects.size() - 1;
new_volume->source.volume_idx = (int)new_object->volumes.size() - 1;
#endif // ENABLE_ENHANCED_RELOAD_FROM_DISK
new_object->invalidate_bounding_box();
return new_object;
}
@ -1555,11 +1549,7 @@ bool ModelVolume::is_splittable() const
return m_is_splittable == 1;
}
#if ENABLE_ENHANCED_RELOAD_FROM_DISK
void ModelVolume::center_geometry_after_creation(bool update_source_offset)
#else
void ModelVolume::center_geometry_after_creation()
#endif // ENABLE_ENHANCED_RELOAD_FROM_DISK
{
Vec3d shift = this->mesh().bounding_box().center();
if (!shift.isApprox(Vec3d::Zero()))
@ -1570,10 +1560,9 @@ void ModelVolume::center_geometry_after_creation()
const_cast<TriangleMesh*>(m_convex_hull.get())->translate(-(float)shift(0), -(float)shift(1), -(float)shift(2));
translate(shift);
}
#if ENABLE_ENHANCED_RELOAD_FROM_DISK
if (update_source_offset)
source.mesh_offset = shift;
#endif // ENABLE_ENHANCED_RELOAD_FROM_DISK
}
void ModelVolume::calculate_convex_hull()