mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Code cleaning
This commit is contained in:
parent
496e09302f
commit
901a20b3b1
9 changed files with 11 additions and 266 deletions
|
@ -379,8 +379,6 @@ std::string GCodePreviewData::get_legend_title() const
|
|||
return "";
|
||||
}
|
||||
|
||||
// #ys_FIXME_COLOR
|
||||
// GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::vector<float>& tool_colors, const std::vector</*double*/std::pair<double, double>>& cp_values) const
|
||||
GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::vector<float>& tool_colors,
|
||||
const std::vector<std::string>& cp_items) const
|
||||
{
|
||||
|
@ -455,43 +453,6 @@ GCodePreviewData::LegendItemsList GCodePreviewData::get_legend_items(const std::
|
|||
|
||||
break;
|
||||
}
|
||||
// #ys_FIXME_COLOR
|
||||
/*case Extrusion::ColorPrint:
|
||||
{
|
||||
const int color_cnt = (int)tool_colors.size()/4;
|
||||
const auto color_print_cnt = (int)cp_values.size();
|
||||
if (color_print_cnt > 0) {
|
||||
GCodePreviewData::Color color;
|
||||
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + (color_cnt-1) * 4), 4 * sizeof(float));
|
||||
items.emplace_back(Slic3r::I18N::translate(L("Pause print or custom G-code")), color);
|
||||
}
|
||||
|
||||
for (int i = color_print_cnt; i >= 0 ; --i)
|
||||
{
|
||||
GCodePreviewData::Color color;
|
||||
::memcpy((void*)color.rgba, (const void*)(tool_colors.data() + (i % color_cnt) * 4), 4 * sizeof(float));
|
||||
|
||||
if (color_print_cnt == 0) {
|
||||
items.emplace_back(Slic3r::I18N::translate(L("Default print color")), color);
|
||||
break;
|
||||
}
|
||||
|
||||
std::string id_str = std::to_string(i + 1) + ": ";
|
||||
|
||||
if (i == 0) {
|
||||
items.emplace_back(id_str + (boost::format(Slic3r::I18N::translate(L("up to %.2f mm"))) % cp_values[0].first).str(), color);
|
||||
break;
|
||||
}
|
||||
if (i == color_print_cnt) {
|
||||
items.emplace_back(id_str + (boost::format(Slic3r::I18N::translate(L("above %.2f mm"))) % cp_values[i - 1].second).str(), color);
|
||||
continue;
|
||||
}
|
||||
|
||||
// items.emplace_back((boost::format(Slic3r::I18N::translate(L("%.2f - %.2f mm"))) % cp_values[i-1] % cp_values[i]).str(), color);
|
||||
items.emplace_back(id_str + (boost::format(Slic3r::I18N::translate(L("%.2f - %.2f mm"))) % cp_values[i - 1].second% cp_values[i].first).str(), color);
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
case Extrusion::ColorPrint:
|
||||
{
|
||||
const int color_cnt = (int)tool_colors.size()/4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue