Performance improvements:

Lazy "Place on face" gizmo update.
Caching of MeshObject::raw_mesh_bounding_box() for the object size display.
ModelObject::bounding_box(), raw_mesh_bounding_box(), full_raw_mesh_bounding_box() will not copy the mesh.
TriangleMesh::transformed_bounding_box(const Transform3d &trafo) will not copy the mesh data.
get_options_for_bundle() will not return reference to temp value
is_splittable() calls cheap mesh.has_multiple_patches()
This commit is contained in:
bubnikv 2019-01-26 18:51:34 +01:00
parent 48d64b0842
commit 588c07c12a
10 changed files with 76 additions and 108 deletions

View file

@ -621,7 +621,8 @@ const std::vector<std::string>& get_options_for_bundle(const wxString& bundle_na
if (bundle_name == _(it.first))
return it.second;
}
return std::vector<std::string> {};
static std::vector<std::string> empty;
return empty;
}
// category -> vector ( option ; label )
@ -1276,15 +1277,12 @@ bool ObjectList::is_splittable()
if (!get_volume_by_item(item, volume) || !volume)
return false;
if (volume->is_splittable() != -1) // if is_splittable value is already known
return volume->is_splittable() == 0 ? false : true;
TriangleMeshPtrs meshptrs = volume->mesh.split();
bool splittable = meshptrs.size() > 1;
for (TriangleMesh* m : meshptrs) { delete m; }
volume->set_splittable(splittable ? 1 : 0);
return splittable;
int splittable = volume->is_splittable();
if (splittable == -1) {
splittable = (int)volume->mesh.has_multiple_patches();
volume->set_splittable(splittable);
}
return splittable != 0;
}
bool ObjectList::selected_instances_of_same_object()