mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-17 03:25:58 +08:00
Small refactoring
This commit is contained in:
parent
662c3da65b
commit
663465299b
@ -2097,6 +2097,14 @@ bool ModelObject::has_solid_mesh() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ModelObject::has_negative_volume_mesh() const
|
||||||
|
{
|
||||||
|
for (const ModelVolume* volume : volumes)
|
||||||
|
if (volume->is_negative_volume())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void ModelVolume::set_material_id(t_model_material_id material_id)
|
void ModelVolume::set_material_id(t_model_material_id material_id)
|
||||||
{
|
{
|
||||||
m_material_id = material_id;
|
m_material_id = material_id;
|
||||||
|
@ -503,6 +503,8 @@ public:
|
|||||||
|
|
||||||
// Detect if object has at least one solid mash
|
// Detect if object has at least one solid mash
|
||||||
bool has_solid_mesh() const;
|
bool has_solid_mesh() const;
|
||||||
|
// Detect if object has at least one negative volume mash
|
||||||
|
bool has_negative_volume_mesh() const;
|
||||||
bool is_cut() const { return cut_id.id().valid(); }
|
bool is_cut() const { return cut_id.id().valid(); }
|
||||||
bool has_connectors() const;
|
bool has_connectors() const;
|
||||||
|
|
||||||
|
@ -1096,16 +1096,7 @@ static bool composite_id_match(const GLVolume::CompositeID& id1, const GLVolume:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool object_contains_negative_volumes(const Model& model, int obj_id) {
|
static bool object_contains_negative_volumes(const Model& model, int obj_id) {
|
||||||
bool ret = false;
|
return (0 <= obj_id && obj_id < (int)model.objects.size()) ? model.objects[obj_id]->has_negative_volume_mesh() : false;
|
||||||
if (0 <= obj_id && obj_id < (int)model.objects.size()) {
|
|
||||||
for (const ModelVolume* v : model.objects[obj_id]->volumes) {
|
|
||||||
if (v->is_negative_volume()) {
|
|
||||||
ret = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::SLAView::detect_type_from_volumes(const GLVolumePtrs& volumes)
|
void GLCanvas3D::SLAView::detect_type_from_volumes(const GLVolumePtrs& volumes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user