mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 05:25:54 +08:00
Fix: ../src/slic3r/GUI/Jobs/EmbossJob.cpp:388:21: warning: 'Slic3r::ModelVolume* get_volume(const Slic3r::ObjectID&)' defined but not used [-Wunused-function]
This commit is contained in:
parent
34304a40bf
commit
8cf8e06164
@ -376,19 +376,6 @@ TriangleMesh priv::create_default_mesh()
|
|||||||
return triangle_mesh;
|
return triangle_mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ModelVolume *get_volume(const ObjectID &volume_id, Model &model)
|
|
||||||
{
|
|
||||||
for (auto obj : model.objects)
|
|
||||||
for (auto vol : obj->volumes)
|
|
||||||
if (vol->id() == volume_id)
|
|
||||||
return vol;
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ModelVolume *get_volume(const ObjectID &volume_id) {
|
|
||||||
return get_volume(volume_id, wxGetApp().plater()->model());
|
|
||||||
}
|
|
||||||
|
|
||||||
void priv::update_volume(TriangleMesh &&mesh,
|
void priv::update_volume(TriangleMesh &&mesh,
|
||||||
const EmbossDataUpdate &data)
|
const EmbossDataUpdate &data)
|
||||||
{
|
{
|
||||||
@ -406,7 +393,13 @@ void priv::update_volume(TriangleMesh &&mesh,
|
|||||||
std::string snap_name = GUI::format(_L("Text: %1%"), data.text_configuration.text);
|
std::string snap_name = GUI::format(_L("Text: %1%"), data.text_configuration.text);
|
||||||
Plater::TakeSnapshot snapshot(plater, snap_name, UndoRedo::SnapshotType::GizmoAction);
|
Plater::TakeSnapshot snapshot(plater, snap_name, UndoRedo::SnapshotType::GizmoAction);
|
||||||
|
|
||||||
ModelVolume *volume = get_volume(data.volume_id, plater->model());
|
auto get_volume = [&model = plater->model()](const ObjectID &volume_id)->ModelVolume *{
|
||||||
|
for (ModelObject* obj : model.objects)
|
||||||
|
for (ModelVolume* vol : obj->volumes)
|
||||||
|
if (vol->id() == volume_id) return vol;
|
||||||
|
return nullptr;
|
||||||
|
};
|
||||||
|
ModelVolume *volume = get_volume(data.volume_id);
|
||||||
// could appear when user delete edited volume
|
// could appear when user delete edited volume
|
||||||
if (volume == nullptr)
|
if (volume == nullptr)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user