mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
NEW:add "slice error" for double extruder
jira: none Change-Id: I58e86c33bc91456d42efcc1a0cad003432bb13df (cherry picked from commit 166a46caa8157e246adfeec591dc13383a47b252)
This commit is contained in:
@@ -224,6 +224,7 @@ GLVolume::GLVolume(float r, float g, float b, float a)
|
|||||||
, partly_inside(false)
|
, partly_inside(false)
|
||||||
, hover(HS_None)
|
, hover(HS_None)
|
||||||
, is_modifier(false)
|
, is_modifier(false)
|
||||||
|
, slice_error(false)
|
||||||
, is_wipe_tower(false)
|
, is_wipe_tower(false)
|
||||||
, is_extrusion_path(false)
|
, is_extrusion_path(false)
|
||||||
, force_transparent(false)
|
, force_transparent(false)
|
||||||
@@ -999,7 +1000,8 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type,
|
|||||||
#endif // ENABLE_ENVIRONMENT_MAP
|
#endif // ENABLE_ENVIRONMENT_MAP
|
||||||
glcheck();
|
glcheck();
|
||||||
|
|
||||||
volume.first->model.set_color(volume.first->render_color);
|
auto red_color = ColorRGBA{1.0f, 0.0f, 0.0f, 1.0f};//slice_error
|
||||||
|
volume.first->model.set_color(volume.first->slice_error ? red_color : volume.first->render_color);
|
||||||
const Transform3d model_matrix = volume.first->world_matrix();
|
const Transform3d model_matrix = volume.first->world_matrix();
|
||||||
shader->set_uniform("view_model_matrix", view_matrix * model_matrix);
|
shader->set_uniform("view_model_matrix", view_matrix * model_matrix);
|
||||||
shader->set_uniform("projection_matrix", projection_matrix);
|
shader->set_uniform("projection_matrix", projection_matrix);
|
||||||
|
|||||||
@@ -216,6 +216,8 @@ public:
|
|||||||
bool force_sinking_contours : 1;
|
bool force_sinking_contours : 1;
|
||||||
// Is render for picking
|
// Is render for picking
|
||||||
bool picking : 1;
|
bool picking : 1;
|
||||||
|
// slice error
|
||||||
|
bool slice_error : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Is mouse or rectangle selection over this object to select/deselect it ?
|
// Is mouse or rectangle selection over this object to select/deselect it ?
|
||||||
|
|||||||
@@ -377,16 +377,6 @@ class GCodeViewer
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// helper to render shells
|
|
||||||
struct Shells
|
|
||||||
{
|
|
||||||
GLVolumeCollection volumes;
|
|
||||||
bool visible{ false };
|
|
||||||
//BBS: always load shell when preview
|
|
||||||
int print_id{ -1 };
|
|
||||||
int print_modify_count { -1 };
|
|
||||||
bool previewing{ false };
|
|
||||||
};
|
|
||||||
|
|
||||||
// helper to render extrusion paths
|
// helper to render extrusion paths
|
||||||
struct Extrusions
|
struct Extrusions
|
||||||
@@ -733,11 +723,21 @@ public:
|
|||||||
LayerTimeLog,
|
LayerTimeLog,
|
||||||
Count
|
Count
|
||||||
};
|
};
|
||||||
|
// helper to render shells
|
||||||
|
struct Shells
|
||||||
|
{
|
||||||
|
GLVolumeCollection volumes;
|
||||||
|
bool visible{false};
|
||||||
|
// BBS: always load shell when preview
|
||||||
|
int print_id{-1};
|
||||||
|
int print_modify_count{-1};
|
||||||
|
bool previewing{false};
|
||||||
|
};
|
||||||
//BBS
|
//BBS
|
||||||
ConflictResultOpt m_conflict_result;
|
ConflictResultOpt m_conflict_result;
|
||||||
GCodeCheckResult m_gcode_check_result;
|
GCodeCheckResult m_gcode_check_result;
|
||||||
FilamentPrintableResult filament_printable_reuslt;
|
FilamentPrintableResult filament_printable_reuslt;
|
||||||
|
Shells m_shells;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<int> m_plater_extruder;
|
std::vector<int> m_plater_extruder;
|
||||||
@@ -780,7 +780,7 @@ private:
|
|||||||
SequentialView m_sequential_view;
|
SequentialView m_sequential_view;
|
||||||
IMSlider* m_moves_slider;
|
IMSlider* m_moves_slider;
|
||||||
IMSlider* m_layers_slider;
|
IMSlider* m_layers_slider;
|
||||||
Shells m_shells;
|
|
||||||
/*BBS GUI refactor, store displayed items in color scheme combobox */
|
/*BBS GUI refactor, store displayed items in color scheme combobox */
|
||||||
std::vector<EViewType> view_type_items;
|
std::vector<EViewType> view_type_items;
|
||||||
std::vector<std::string> view_type_items_str;
|
std::vector<std::string> view_type_items_str;
|
||||||
|
|||||||
@@ -9755,15 +9755,34 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
|
|||||||
}
|
}
|
||||||
int extruder_id = error_iter->first + 1;
|
int extruder_id = error_iter->first + 1;
|
||||||
std::string filaments;
|
std::string filaments;
|
||||||
|
std::vector<int> slice_error_object_idxs;
|
||||||
for (size_t i = 0; i < error_iter->second.size(); ++i) {
|
for (size_t i = 0; i < error_iter->second.size(); ++i) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
filaments += ", ";
|
filaments += ", ";
|
||||||
}
|
}
|
||||||
int filament_id = error_iter->second[i].first;
|
int filament_id = error_iter->second[i].first;
|
||||||
int object_label_id = error_iter->second[i].second;
|
int object_label_id = error_iter->second[i].second;
|
||||||
// todo: display the conflict objects
|
|
||||||
//ModelObject* object->instances[0]->get_labeled_id();
|
//ModelObject* object->instances[0]->get_labeled_id();
|
||||||
filaments += std::to_string(filament_id);
|
filaments += std::to_string(filament_id);
|
||||||
|
for (int object_idx = 0; object_idx < (int) m_model->objects.size(); ++object_idx) {
|
||||||
|
const ModelObject *model_object = m_model->objects[object_idx];
|
||||||
|
for (int instance_idx = 0; instance_idx < (int) model_object->instances.size(); ++instance_idx) {
|
||||||
|
const ModelInstance *model_instance = model_object->instances[instance_idx];
|
||||||
|
auto expect_id = model_instance->get_labeled_id();
|
||||||
|
if (object_label_id == expect_id) {
|
||||||
|
slice_error_object_idxs.emplace_back(object_idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (GLVolume *volume : m_gcode_viewer.m_shells.volumes.volumes) {
|
||||||
|
for (auto obj_idx : slice_error_object_idxs) {
|
||||||
|
if (volume->object_idx() == obj_idx) {
|
||||||
|
volume->slice_error = true;
|
||||||
|
volume->selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::string extruder_name = extruder_id == master_extruder_id ? "Left extruder" : "Right extruder";
|
std::string extruder_name = extruder_id == master_extruder_id ? "Left extruder" : "Right extruder";
|
||||||
if (error_iter->second.size() == 1) {
|
if (error_iter->second.size() == 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user