Added method const GLVolume* Selection::get_first_volume() const to simplify client code

Fixed conflicts during rebase with master
This commit is contained in:
enricoturri1966 2022-05-04 13:31:19 +02:00
parent 9f503b95e8
commit 0e3490620e
13 changed files with 1094 additions and 1092 deletions

View file

@ -2930,7 +2930,7 @@ int Plater::priv::get_selected_volume_idx() const
if ((0 > idx) || (idx > 1000))
#endif // ENABLE_WIPETOWER_OBJECTID_1000_REMOVAL
return-1;
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
const GLVolume* v = selection.get_first_volume();
if (model.objects[idx]->volumes.size() > 1)
return v->volume_idx();
return -1;
@ -3533,7 +3533,7 @@ void Plater::priv::replace_with_stl()
if (selection.is_wipe_tower() || get_selection().get_volume_idxs().size() != 1)
return;
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
const GLVolume* v = selection.get_first_volume();
int object_idx = v->object_idx();
int volume_idx = v->volume_idx();
@ -6052,7 +6052,7 @@ void Plater::export_stl_obj(bool extended, bool selection_only)
if (selection.get_mode() == Selection::Instance)
mesh = mesh_to_export(*model_object, (selection.is_single_full_object() && model_object->instances.size() > 1) ? -1 : selection.get_instance_idx());
else {
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
const GLVolume* volume = selection.get_first_volume();
mesh = model_object->volumes[volume->volume_idx()]->mesh();
mesh.transform(volume->get_volume_transformation().get_matrix(), true);
}