Removed obsolete member variable GLCanvas3D::m_color_by

(cherry picked from commit prusa3d/PrusaSlicer@5089d1460d)
This commit is contained in:
enricoturri1966 2023-10-23 11:47:22 +08:00 committed by Noisyfox
parent dd51ce3b90
commit d1b0743735
7 changed files with 7 additions and 23 deletions

View file

@ -1008,13 +1008,12 @@ std::vector<int> GLVolumeCollection::load_object(
const ModelObject *model_object,
int obj_idx,
const std::vector<int> &instance_idxs,
const std::string &color_by,
bool opengl_initialized)
{
std::vector<int> volumes_idx;
for (int volume_idx = 0; volume_idx < int(model_object->volumes.size()); ++volume_idx)
for (int instance_idx : instance_idxs)
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized));
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, opengl_initialized));
return volumes_idx;
}
@ -1023,7 +1022,6 @@ int GLVolumeCollection::load_object_volume(
int obj_idx,
int volume_idx,
int instance_idx,
const std::string &color_by,
bool opengl_initialized,
bool in_assemble_view,
bool use_loaded_id)
@ -1032,9 +1030,7 @@ int GLVolumeCollection::load_object_volume(
const int extruder_id = model_volume->extruder_id();
const ModelInstance *instance = model_object->instances[instance_idx];
const TriangleMesh &mesh = model_volume->mesh();
ColorRGBA color = GLVolume::MODEL_COLOR[((color_by == "volume") ? volume_idx : obj_idx) % 4];
color.a(model_volume->is_model_part() ? 0.7f : 0.4f);
this->volumes.emplace_back(new GLVolume(color));
this->volumes.emplace_back(new GLVolume());
GLVolume& v = *this->volumes.back();
v.set_color(color_from_model_volume(*model_volume));
v.name = model_volume->name;