Fixing GCC warnings 2
This commit is contained in:
parent
b5280fbed9
commit
2d32c80b75
@ -512,7 +512,6 @@ void Layer::make_ironing()
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::vector<IroningParams> by_extruder;
|
std::vector<IroningParams> by_extruder;
|
||||||
bool extruder_dont_care = this->object()->config().wipe_into_objects;
|
|
||||||
double default_layer_height = this->object()->config().layer_height;
|
double default_layer_height = this->object()->config().layer_height;
|
||||||
|
|
||||||
for (LayerRegion *layerm : m_regions)
|
for (LayerRegion *layerm : m_regions)
|
||||||
|
@ -166,7 +166,7 @@ static ExtrusionEntityCollection traverse_loops(const PerimeterGenerator &perime
|
|||||||
(float)perimeter_generator.layer_height);
|
(float)perimeter_generator.layer_height);
|
||||||
|
|
||||||
// get overhang paths by checking what parts of this loop fall
|
// get overhang paths by checking what parts of this loop fall
|
||||||
// outside the grown lower slices (thus where the distance between
|
// outside the grown lower slices (thus where the distance between
|
||||||
// the loop centerline and original lower slices is >= half nozzle diameter
|
// the loop centerline and original lower slices is >= half nozzle diameter
|
||||||
extrusion_paths_append(
|
extrusion_paths_append(
|
||||||
paths,
|
paths,
|
||||||
@ -396,8 +396,8 @@ void PerimeterGenerator::process()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fuzzy skin configuration
|
// fuzzy skin configuration
|
||||||
double fuzzy_skin_thickness;
|
double fuzzy_skin_thickness = scale_(this->object_config->fuzzy_skin_thickness);
|
||||||
double fuzzy_skin_point_dist;
|
double fuzzy_skin_point_dist = scale_(this->object_config->fuzzy_skin_point_dist);
|
||||||
//FuzzyShape fuzzy_skin_shape;
|
//FuzzyShape fuzzy_skin_shape;
|
||||||
if (this->object_config->fuzzy_skin_perimeter_mode != FuzzySkinPerimeterMode::None) {
|
if (this->object_config->fuzzy_skin_perimeter_mode != FuzzySkinPerimeterMode::None) {
|
||||||
/*
|
/*
|
||||||
@ -419,8 +419,6 @@ void PerimeterGenerator::process()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
fuzzy_skin_thickness = scale_(this->object_config->fuzzy_skin_thickness);
|
|
||||||
fuzzy_skin_point_dist = scale_(this->object_config->fuzzy_skin_point_dist);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// we need to process each island separately because we might have different
|
// we need to process each island separately because we might have different
|
||||||
|
@ -304,8 +304,6 @@ void SupportPointGenerator::add_support_points(SupportPointGenerator::Structure
|
|||||||
|
|
||||||
float tp = m_config.tear_pressure();
|
float tp = m_config.tear_pressure();
|
||||||
float current = s.supports_force_total();
|
float current = s.supports_force_total();
|
||||||
static constexpr float DANGL_DAMPING = .5f;
|
|
||||||
static constexpr float SLOPE_DAMPING = .1f;
|
|
||||||
|
|
||||||
if (s.islands_below.empty()) {
|
if (s.islands_below.empty()) {
|
||||||
// completely new island - needs support no doubt
|
// completely new island - needs support no doubt
|
||||||
|
@ -21,7 +21,7 @@ template<typename EndPointType, typename KDTreeType, typename CouldReverseFunc>
|
|||||||
std::vector<std::pair<size_t, bool>> chain_segments_closest_point(std::vector<EndPointType> &end_points, KDTreeType &kdtree, CouldReverseFunc &could_reverse_func, EndPointType &first_point)
|
std::vector<std::pair<size_t, bool>> chain_segments_closest_point(std::vector<EndPointType> &end_points, KDTreeType &kdtree, CouldReverseFunc &could_reverse_func, EndPointType &first_point)
|
||||||
{
|
{
|
||||||
assert((end_points.size() & 1) == 0);
|
assert((end_points.size() & 1) == 0);
|
||||||
size_t num_segments = end_points.size() / 2;
|
size_t num_segments = end_points.size() / 2;
|
||||||
assert(num_segments >= 2);
|
assert(num_segments >= 2);
|
||||||
for (EndPointType &ep : end_points)
|
for (EndPointType &ep : end_points)
|
||||||
ep.chain_id = 0;
|
ep.chain_id = 0;
|
||||||
@ -1553,9 +1553,7 @@ static inline void reorder_by_two_exchanges_with_segment_flipping(std::vector<Fl
|
|||||||
size_t crossover1_pos_final = std::numeric_limits<size_t>::max();
|
size_t crossover1_pos_final = std::numeric_limits<size_t>::max();
|
||||||
size_t crossover2_pos_final = std::numeric_limits<size_t>::max();
|
size_t crossover2_pos_final = std::numeric_limits<size_t>::max();
|
||||||
size_t crossover_flip_final = 0;
|
size_t crossover_flip_final = 0;
|
||||||
for (const std::pair<double, size_t> &first_crossover_candidate : connection_lengths) {
|
for (const auto& [longest_connection_length, longest_connection_idx] : connection_lengths) {
|
||||||
double longest_connection_length = first_crossover_candidate.first;
|
|
||||||
size_t longest_connection_idx = first_crossover_candidate.second;
|
|
||||||
connection_tried[longest_connection_idx] = true;
|
connection_tried[longest_connection_idx] = true;
|
||||||
// Find the second crossover connection with the lowest total chain cost.
|
// Find the second crossover connection with the lowest total chain cost.
|
||||||
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
|
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
|
||||||
@ -1630,12 +1628,9 @@ static inline void reorder_by_three_exchanges_with_segment_flipping(std::vector<
|
|||||||
size_t crossover2_pos_final = std::numeric_limits<size_t>::max();
|
size_t crossover2_pos_final = std::numeric_limits<size_t>::max();
|
||||||
size_t crossover3_pos_final = std::numeric_limits<size_t>::max();
|
size_t crossover3_pos_final = std::numeric_limits<size_t>::max();
|
||||||
size_t crossover_flip_final = 0;
|
size_t crossover_flip_final = 0;
|
||||||
for (const std::pair<double, size_t> &first_crossover_candidate : connection_lengths) {
|
for (const auto& [longest_connection_length, longest_connection_idx] : connection_lengths) {
|
||||||
double longest_connection_length = first_crossover_candidate.first;
|
connection_tried[longest_connection_idx] = true;
|
||||||
size_t longest_connection_idx = first_crossover_candidate.second;
|
|
||||||
connection_tried[longest_connection_idx] = true;
|
|
||||||
// Find the second crossover connection with the lowest total chain cost.
|
// Find the second crossover connection with the lowest total chain cost.
|
||||||
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
|
|
||||||
double crossover_cost_min = connections.back().cost;
|
double crossover_cost_min = connections.back().cost;
|
||||||
for (size_t j = 1; j < connections.size(); ++ j)
|
for (size_t j = 1; j < connections.size(); ++ j)
|
||||||
if (! connection_tried[j]) {
|
if (! connection_tried[j]) {
|
||||||
@ -1789,12 +1784,9 @@ static inline void reorder_by_three_exchanges_with_segment_flipping2(std::vector
|
|||||||
#else /* NDEBUG */
|
#else /* NDEBUG */
|
||||||
Matrixd segment_end_point_distance_matrix = Matrixd::Constant(4 * 4, 4 * 4, std::numeric_limits<double>::max());
|
Matrixd segment_end_point_distance_matrix = Matrixd::Constant(4 * 4, 4 * 4, std::numeric_limits<double>::max());
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
for (const std::pair<double, size_t> &first_crossover_candidate : connection_lengths) {
|
for (const auto& [longest_connection_length, longest_connection_idx] : connection_lengths) {
|
||||||
double longest_connection_length = first_crossover_candidate.first;
|
connection_tried[longest_connection_idx] = true;
|
||||||
size_t longest_connection_idx = first_crossover_candidate.second;
|
// Find the second crossover connection with the lowest total chain cost.
|
||||||
connection_tried[longest_connection_idx] = true;
|
|
||||||
// Find the second crossover connection with the lowest total chain cost.
|
|
||||||
size_t crossover_pos_min = std::numeric_limits<size_t>::max();
|
|
||||||
double crossover_cost_min = connections.back().cost;
|
double crossover_cost_min = connections.back().cost;
|
||||||
for (size_t j = 1; j < connections.size(); ++ j)
|
for (size_t j = 1; j < connections.size(); ++ j)
|
||||||
if (! connection_tried[j]) {
|
if (! connection_tried[j]) {
|
||||||
|
@ -561,9 +561,11 @@ Polygons voronoi_offset(
|
|||||||
const Point &pt = cell->contains_point() ?
|
const Point &pt = cell->contains_point() ?
|
||||||
((cell->source_category() == boost::polygon::SOURCE_CATEGORY_SEGMENT_START_POINT) ? line0.a : line0.b) :
|
((cell->source_category() == boost::polygon::SOURCE_CATEGORY_SEGMENT_START_POINT) ? line0.a : line0.b) :
|
||||||
((cell2->source_category() == boost::polygon::SOURCE_CATEGORY_SEGMENT_START_POINT) ? line1.a : line1.b);
|
((cell2->source_category() == boost::polygon::SOURCE_CATEGORY_SEGMENT_START_POINT) ? line1.a : line1.b);
|
||||||
|
#ifndef NDEBUG
|
||||||
const Line &line = cell->contains_segment() ? line0 : line1;
|
const Line &line = cell->contains_segment() ? line0 : line1;
|
||||||
assert(pt == line.a || pt == line.b);
|
assert(pt == line.a || pt == line.b);
|
||||||
assert((pt.cast<double>() - Vec2d(v0->x(), v0->y())).norm() < SCALED_EPSILON);
|
assert((pt.cast<double>() - Vec2d(v0->x(), v0->y())).norm() < SCALED_EPSILON);
|
||||||
|
#endif // NDEBUG
|
||||||
Vec2d dir(v1->x() - v0->x(), v1->y() - v0->y());
|
Vec2d dir(v1->x() - v0->x(), v1->y() - v0->y());
|
||||||
double l2 = dir.squaredNorm();
|
double l2 = dir.squaredNorm();
|
||||||
if (offset_distance2 <= l2) {
|
if (offset_distance2 <= l2) {
|
||||||
|
@ -734,7 +734,7 @@ void PageMaterials::set_compatible_printers_html_window(const std::vector<std::s
|
|||||||
, text_clr_str
|
, text_clr_str
|
||||||
, first_line
|
, first_line
|
||||||
, second_line);
|
, second_line);
|
||||||
for (int i = 0; i < printer_names.size(); ++i)
|
for (size_t i = 0; i < printer_names.size(); ++i)
|
||||||
{
|
{
|
||||||
text += wxString::Format("<td>%s</td>", boost::nowide::widen(printer_names[i]));
|
text += wxString::Format("<td>%s</td>", boost::nowide::widen(printer_names[i]));
|
||||||
if (i % 3 == 2) {
|
if (i % 3 == 2) {
|
||||||
@ -830,7 +830,7 @@ void PageMaterials::update_lists(int sel_printer, int sel_type, int sel_vendor)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sel_printers[0] != 0) {
|
if (sel_printers[0] != 0) {
|
||||||
for (size_t i = 0; i < sel_printers_count; i++) {
|
for (int i = 0; i < sel_printers_count; i++) {
|
||||||
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
||||||
const Preset* printer = nullptr;
|
const Preset* printer = nullptr;
|
||||||
for (const Preset* it : materials->printers) {
|
for (const Preset* it : materials->printers) {
|
||||||
@ -881,7 +881,7 @@ void PageMaterials::update_lists(int sel_printer, int sel_type, int sel_vendor)
|
|||||||
if (sel_printers_count != 0 && sel_type != wxNOT_FOUND) {
|
if (sel_printers_count != 0 && sel_type != wxNOT_FOUND) {
|
||||||
const std::string& type = list_type->get_data(sel_type);
|
const std::string& type = list_type->get_data(sel_type);
|
||||||
// find printer preset
|
// find printer preset
|
||||||
for (size_t i = 0; i < sel_printers_count; i++) {
|
for (int i = 0; i < sel_printers_count; i++) {
|
||||||
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
||||||
const Preset* printer = nullptr;
|
const Preset* printer = nullptr;
|
||||||
for (const Preset* it : materials->printers) {
|
for (const Preset* it : materials->printers) {
|
||||||
@ -917,7 +917,7 @@ void PageMaterials::update_lists(int sel_printer, int sel_type, int sel_vendor)
|
|||||||
const std::string& vendor = list_vendor->get_data(sel_vendor);
|
const std::string& vendor = list_vendor->get_data(sel_vendor);
|
||||||
// finst printer preset
|
// finst printer preset
|
||||||
std::vector<ProfilePrintData> to_list;
|
std::vector<ProfilePrintData> to_list;
|
||||||
for (size_t i = 0; i < sel_printers_count; i++) {
|
for (int i = 0; i < sel_printers_count; i++) {
|
||||||
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
||||||
const Preset* printer = nullptr;
|
const Preset* printer = nullptr;
|
||||||
for (const Preset* it : materials->printers) {
|
for (const Preset* it : materials->printers) {
|
||||||
@ -986,7 +986,7 @@ void PageMaterials::sort_list_data(StringList* list, bool add_All_item, bool mat
|
|||||||
|
|
||||||
const ConfigOptionDef* def = print_config_def.get("filament_type");
|
const ConfigOptionDef* def = print_config_def.get("filament_type");
|
||||||
std::vector<std::string>enum_values = def->enum_values;
|
std::vector<std::string>enum_values = def->enum_values;
|
||||||
int end_of_sorted = 0;
|
size_t end_of_sorted = 0;
|
||||||
for (size_t vals = 0; vals < enum_values.size(); vals++) {
|
for (size_t vals = 0; vals < enum_values.size(); vals++) {
|
||||||
for (size_t profs = end_of_sorted; profs < other_profiles.size(); profs++)
|
for (size_t profs = end_of_sorted; profs < other_profiles.size(); profs++)
|
||||||
{
|
{
|
||||||
@ -1044,13 +1044,11 @@ void PageMaterials::sort_list_data(PresetList* list, const std::vector<ProfilePr
|
|||||||
return a.name.get() < b.name.get();
|
return a.name.get() < b.name.get();
|
||||||
});
|
});
|
||||||
list->Clear();
|
list->Clear();
|
||||||
//for (const auto& item : prusa_profiles)
|
for (size_t i = 0; i < prusa_profiles.size(); ++i) {
|
||||||
for (int i = 0; i < prusa_profiles.size(); ++i) {
|
|
||||||
list->append(std::string(prusa_profiles[i].name) + (prusa_profiles[i].omnipresent ? "" : " *"), &const_cast<std::string&>(prusa_profiles[i].name.get()));
|
list->append(std::string(prusa_profiles[i].name) + (prusa_profiles[i].omnipresent ? "" : " *"), &const_cast<std::string&>(prusa_profiles[i].name.get()));
|
||||||
list->Check(i, prusa_profiles[i].checked);
|
list->Check(i, prusa_profiles[i].checked);
|
||||||
}
|
}
|
||||||
//for (const auto& item : other_profiles)
|
for (size_t i = 0; i < other_profiles.size(); ++i) {
|
||||||
for (int i = 0; i < other_profiles.size(); ++i) {
|
|
||||||
list->append(std::string(other_profiles[i].name) + (other_profiles[i].omnipresent ? "" : " *"), &const_cast<std::string&>(other_profiles[i].name.get()));
|
list->append(std::string(other_profiles[i].name) + (other_profiles[i].omnipresent ? "" : " *"), &const_cast<std::string&>(other_profiles[i].name.get()));
|
||||||
list->Check(i + prusa_profiles.size(), other_profiles[i].checked);
|
list->Check(i + prusa_profiles.size(), other_profiles[i].checked);
|
||||||
}
|
}
|
||||||
|
@ -1028,7 +1028,7 @@ void Choice::set_selection()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!text_value.IsEmpty()) {
|
if (!text_value.IsEmpty()) {
|
||||||
int idx = 0;
|
size_t idx = 0;
|
||||||
for (auto el : m_opt.enum_values) {
|
for (auto el : m_opt.enum_values) {
|
||||||
if (el == text_value)
|
if (el == text_value)
|
||||||
break;
|
break;
|
||||||
@ -1375,7 +1375,7 @@ void ColourPicker::msw_rescale()
|
|||||||
size.SetHeight(m_opt.height * m_em_unit);
|
size.SetHeight(m_opt.height * m_em_unit);
|
||||||
else if (parent_is_custom_ctrl && opt_height > 0)
|
else if (parent_is_custom_ctrl && opt_height > 0)
|
||||||
size.SetHeight(lround(opt_height * m_em_unit));
|
size.SetHeight(lround(opt_height * m_em_unit));
|
||||||
if (m_opt.width >= 0) size.SetWidth(m_opt.width * m_em_unit);
|
if (m_opt.width >= 0) size.SetWidth(m_opt.width * m_em_unit);
|
||||||
if (parent_is_custom_ctrl)
|
if (parent_is_custom_ctrl)
|
||||||
field->SetSize(size);
|
field->SetSize(size);
|
||||||
else
|
else
|
||||||
@ -1402,7 +1402,7 @@ void PointCtrl::BUILD()
|
|||||||
if (parent_is_custom_ctrl && m_opt.height < 0)
|
if (parent_is_custom_ctrl && m_opt.height < 0)
|
||||||
opt_height = (double)x_textctrl->GetSize().GetHeight() / m_em_unit;
|
opt_height = (double)x_textctrl->GetSize().GetHeight() / m_em_unit;
|
||||||
|
|
||||||
x_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
x_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||||
x_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
x_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||||
y_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
y_textctrl->SetFont(Slic3r::GUI::wxGetApp().normal_font());
|
||||||
y_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
y_textctrl->SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||||
|
@ -392,18 +392,18 @@ void NotificationManager::PopNotification::count_spaces()
|
|||||||
}
|
}
|
||||||
void NotificationManager::PopNotification::init()
|
void NotificationManager::PopNotification::init()
|
||||||
{
|
{
|
||||||
std::string text = m_text1 + " " + m_hypertext;
|
std::string text = m_text1 + " " + m_hypertext;
|
||||||
int last_end = 0;
|
size_t last_end = 0;
|
||||||
m_lines_count = 0;
|
m_lines_count = 0;
|
||||||
|
|
||||||
count_spaces();
|
count_spaces();
|
||||||
|
|
||||||
// count lines
|
// count lines
|
||||||
m_endlines.clear();
|
m_endlines.clear();
|
||||||
while (last_end < text.length() - 1)
|
while (last_end < text.length() - 1)
|
||||||
{
|
{
|
||||||
int next_hard_end = text.find_first_of('\n', last_end);
|
size_t next_hard_end = text.find_first_of('\n', last_end);
|
||||||
if (next_hard_end > 0 && ImGui::CalcTextSize(text.substr(last_end, next_hard_end - last_end).c_str()).x < m_window_width - m_window_width_offset) {
|
if (next_hard_end != std::string::npos && ImGui::CalcTextSize(text.substr(last_end, next_hard_end - last_end).c_str()).x < m_window_width - m_window_width_offset) {
|
||||||
//next line is ended by '/n'
|
//next line is ended by '/n'
|
||||||
m_endlines.push_back(next_hard_end);
|
m_endlines.push_back(next_hard_end);
|
||||||
last_end = next_hard_end + 1;
|
last_end = next_hard_end + 1;
|
||||||
@ -411,9 +411,9 @@ void NotificationManager::PopNotification::init()
|
|||||||
// find next suitable endline
|
// find next suitable endline
|
||||||
if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset) {
|
if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset) {
|
||||||
// more than one line till end
|
// more than one line till end
|
||||||
int next_space = text.find_first_of(' ', last_end);
|
size_t next_space = text.find_first_of(' ', last_end);
|
||||||
if (next_space > 0) {
|
if (next_space > 0) {
|
||||||
int next_space_candidate = text.find_first_of(' ', next_space + 1);
|
size_t next_space_candidate = text.find_first_of(' ', next_space + 1);
|
||||||
while (next_space_candidate > 0 && ImGui::CalcTextSize(text.substr(last_end, next_space_candidate - last_end).c_str()).x < m_window_width - m_window_width_offset) {
|
while (next_space_candidate > 0 && ImGui::CalcTextSize(text.substr(last_end, next_space_candidate - last_end).c_str()).x < m_window_width - m_window_width_offset) {
|
||||||
next_space = next_space_candidate;
|
next_space = next_space_candidate;
|
||||||
next_space_candidate = text.find_first_of(' ', next_space + 1);
|
next_space_candidate = text.find_first_of(' ', next_space + 1);
|
||||||
@ -456,7 +456,6 @@ void NotificationManager::PopNotification::set_next_window_size(ImGuiWrapper& im
|
|||||||
void NotificationManager::PopNotification::render_text(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
void NotificationManager::PopNotification::render_text(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
||||||
{
|
{
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
ImVec2 win_size(win_size_x, win_size_y);
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
|
||||||
float x_offset = m_left_indentation;
|
float x_offset = m_left_indentation;
|
||||||
std::string fulltext = m_text1 + m_hypertext; //+ m_text2;
|
std::string fulltext = m_text1 + m_hypertext; //+ m_text2;
|
||||||
ImVec2 text_size = ImGui::CalcTextSize(fulltext.c_str());
|
ImVec2 text_size = ImGui::CalcTextSize(fulltext.c_str());
|
||||||
@ -594,8 +593,6 @@ void NotificationManager::PopNotification::render_close_button(ImGuiWrapper& img
|
|||||||
{
|
{
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
ImVec2 win_size(win_size_x, win_size_y);
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
ImVec2 win_pos(win_pos_x, win_pos_y);
|
||||||
ImVec4 orange_color = ImGui::GetStyleColorVec4(ImGuiCol_Button);
|
|
||||||
orange_color.w = 0.8f;
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
Notifications_Internal::push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_fading_out, m_current_fade_opacity);
|
Notifications_Internal::push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_fading_out, m_current_fade_opacity);
|
||||||
@ -831,9 +828,7 @@ void NotificationManager::SlicingCompleteLargeNotification::render_text(ImGuiWra
|
|||||||
if (!m_is_large)
|
if (!m_is_large)
|
||||||
PopNotification::render_text(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
|
PopNotification::render_text(imgui, win_size_x, win_size_y, win_pos_x, win_pos_y);
|
||||||
else {
|
else {
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
ImVec2 win_size(win_size_x, win_size_y);
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
|
||||||
|
|
||||||
ImVec2 text1_size = ImGui::CalcTextSize(m_text1.c_str());
|
ImVec2 text1_size = ImGui::CalcTextSize(m_text1.c_str());
|
||||||
float x_offset = m_left_indentation;
|
float x_offset = m_left_indentation;
|
||||||
std::string fulltext = m_text1 + m_hypertext + m_text2;
|
std::string fulltext = m_text1 + m_hypertext + m_text2;
|
||||||
@ -889,15 +884,12 @@ void NotificationManager::ExportFinishedNotification::count_spaces()
|
|||||||
void NotificationManager::ExportFinishedNotification::render_text(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
void NotificationManager::ExportFinishedNotification::render_text(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
||||||
{
|
{
|
||||||
|
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
|
||||||
float x_offset = m_left_indentation;
|
float x_offset = m_left_indentation;
|
||||||
std::string fulltext = m_text1 + m_hypertext; //+ m_text2;
|
std::string fulltext = m_text1 + m_hypertext; //+ m_text2;
|
||||||
ImVec2 text_size = ImGui::CalcTextSize(fulltext.c_str());
|
|
||||||
// Lines are always at least two and m_multiline is always true for ExportFinishedNotification.
|
// Lines are always at least two and m_multiline is always true for ExportFinishedNotification.
|
||||||
// First line has "Export Finished" text and than hyper text open folder.
|
// First line has "Export Finished" text and than hyper text open folder.
|
||||||
// Following lines are path to gcode.
|
// Following lines are path to gcode.
|
||||||
int last_end = 0;
|
size_t last_end = 0;
|
||||||
float starting_y = m_line_height / 2;//10;
|
float starting_y = m_line_height / 2;//10;
|
||||||
float shift_y = m_line_height;// -m_line_height / 20;
|
float shift_y = m_line_height;// -m_line_height / 20;
|
||||||
for (size_t i = 0; i < m_lines_count; i++) {
|
for (size_t i = 0; i < m_lines_count; i++) {
|
||||||
@ -926,8 +918,6 @@ void NotificationManager::ExportFinishedNotification::render_eject_button(ImGuiW
|
|||||||
{
|
{
|
||||||
ImVec2 win_size(win_size_x, win_size_y);
|
ImVec2 win_size(win_size_x, win_size_y);
|
||||||
ImVec2 win_pos(win_pos_x, win_pos_y);
|
ImVec2 win_pos(win_pos_x, win_pos_y);
|
||||||
ImVec4 orange_color = ImGui::GetStyleColorVec4(ImGuiCol_Button);
|
|
||||||
orange_color.w = 0.8f;
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(.0f, .0f, .0f, .0f));
|
||||||
Notifications_Internal::push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_fading_out, m_current_fade_opacity);
|
Notifications_Internal::push_style_color(ImGuiCol_Text, ImVec4(1.f, 1.f, 1.f, 1.f), m_fading_out, m_current_fade_opacity);
|
||||||
@ -1003,7 +993,6 @@ void NotificationManager::ProgressBarNotification::render_text(ImGuiWrapper& img
|
|||||||
}
|
}
|
||||||
void NotificationManager::ProgressBarNotification::render_bar(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
void NotificationManager::ProgressBarNotification::render_bar(ImGuiWrapper& imgui, const float win_size_x, const float win_size_y, const float win_pos_x, const float win_pos_y)
|
||||||
{
|
{
|
||||||
float bar_y = win_size_y / 2 - win_size_y / 6 + m_line_height;
|
|
||||||
ImVec4 orange_color = ImVec4(.99f, .313f, .0f, 1.0f);
|
ImVec4 orange_color = ImVec4(.99f, .313f, .0f, 1.0f);
|
||||||
float invisible_length = 0;//((float)(m_data.duration - m_remaining_time) / (float)m_data.duration * win_size_x);
|
float invisible_length = 0;//((float)(m_data.duration - m_remaining_time) / (float)m_data.duration * win_size_x);
|
||||||
//invisible_length -= win_size_x / ((float)m_data.duration * 60.f) * (60 - m_countdown_frame);
|
//invisible_length -= win_size_x / ((float)m_data.duration * 60.f) * (60 - m_countdown_frame);
|
||||||
@ -1141,12 +1130,17 @@ void NotificationManager::push_slicing_complete_notification(int timestamp, bool
|
|||||||
int time = 10;
|
int time = 10;
|
||||||
if (has_slicing_error_notification())
|
if (has_slicing_error_notification())
|
||||||
return;
|
return;
|
||||||
if (large) {
|
if (large) {
|
||||||
hypertext = _u8L("Export G-Code.");
|
hypertext = _u8L("Export G-Code.");
|
||||||
time = 0;
|
time = 0;
|
||||||
}
|
}
|
||||||
NotificationData data{ NotificationType::SlicingComplete, NotificationLevel::RegularNotification, time, _u8L("Slicing finished."), hypertext, [](wxEvtHandler* evnthndlr){
|
NotificationData data{ NotificationType::SlicingComplete, NotificationLevel::RegularNotification, time, _u8L("Slicing finished."), hypertext,
|
||||||
if (evnthndlr != nullptr) wxPostEvent(evnthndlr, ExportGcodeNotificationClickedEvent(EVT_EXPORT_GCODE_NOTIFICAION_CLICKED)); return true; } };
|
[](wxEvtHandler* evnthndlr){
|
||||||
|
if (evnthndlr != nullptr)
|
||||||
|
wxPostEvent(evnthndlr, ExportGcodeNotificationClickedEvent(EVT_EXPORT_GCODE_NOTIFICAION_CLICKED));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
push_notification_data(std::make_unique<NotificationManager::SlicingCompleteLargeNotification>(data, m_id_provider, m_evt_handler, large), timestamp);
|
push_notification_data(std::make_unique<NotificationManager::SlicingCompleteLargeNotification>(data, m_id_provider, m_evt_handler, large), timestamp);
|
||||||
}
|
}
|
||||||
void NotificationManager::set_slicing_complete_print_time(const std::string &info)
|
void NotificationManager::set_slicing_complete_print_time(const std::string &info)
|
||||||
|
@ -339,14 +339,14 @@ private:
|
|||||||
// Height of text
|
// Height of text
|
||||||
// Used as basic scaling unit!
|
// Used as basic scaling unit!
|
||||||
float m_line_height;
|
float m_line_height;
|
||||||
std::vector<int> m_endlines;
|
std::vector<size_t> m_endlines;
|
||||||
// Gray are f.e. eorrors when its uknown if they are still valid
|
// Gray are f.e. eorrors when its uknown if they are still valid
|
||||||
bool m_is_gray { false };
|
bool m_is_gray { false };
|
||||||
//if multiline = true, notification is showing all lines(>2)
|
//if multiline = true, notification is showing all lines(>2)
|
||||||
bool m_multiline { false };
|
bool m_multiline { false };
|
||||||
// True if minimized button is rendered, helps to decide where is area for invisible close button
|
// True if minimized button is rendered, helps to decide where is area for invisible close button
|
||||||
bool m_minimize_b_visible { false };
|
bool m_minimize_b_visible { false };
|
||||||
int m_lines_count{ 1 };
|
size_t m_lines_count{ 1 };
|
||||||
// Target for wxWidgets events sent by clicking on the hyperlink available at some notifications.
|
// Target for wxWidgets events sent by clicking on the hyperlink available at some notifications.
|
||||||
wxEvtHandler* m_evt_handler;
|
wxEvtHandler* m_evt_handler;
|
||||||
};
|
};
|
||||||
@ -366,7 +366,7 @@ private:
|
|||||||
override;
|
override;
|
||||||
bool m_is_large;
|
bool m_is_large;
|
||||||
bool m_has_print_info { false };
|
bool m_has_print_info { false };
|
||||||
std::string m_print_info { std::string() };
|
std::string m_print_info;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SlicingWarningNotification : public PopNotification
|
class SlicingWarningNotification : public PopNotification
|
||||||
@ -471,8 +471,13 @@ private:
|
|||||||
{NotificationType::Mouse3dDisconnected, NotificationLevel::RegularNotification, 10, _u8L("3D Mouse disconnected.") },
|
{NotificationType::Mouse3dDisconnected, NotificationLevel::RegularNotification, 10, _u8L("3D Mouse disconnected.") },
|
||||||
// {NotificationType::Mouse3dConnected, NotificationLevel::RegularNotification, 5, _u8L("3D Mouse connected.") },
|
// {NotificationType::Mouse3dConnected, NotificationLevel::RegularNotification, 5, _u8L("3D Mouse connected.") },
|
||||||
// {NotificationType::NewPresetsAviable, NotificationLevel::ImportantNotification, 20, _u8L("New Presets are available."), _u8L("See here.") },
|
// {NotificationType::NewPresetsAviable, NotificationLevel::ImportantNotification, 20, _u8L("New Presets are available."), _u8L("See here.") },
|
||||||
{NotificationType::PresetUpdateAvailable, NotificationLevel::ImportantNotification, 20, _u8L("Configuration update is available."), _u8L("See more."), [](wxEvtHandler* evnthndlr){
|
{NotificationType::PresetUpdateAvailable, NotificationLevel::ImportantNotification, 20, _u8L("Configuration update is available."), _u8L("See more."),
|
||||||
if (evnthndlr != nullptr) wxPostEvent(evnthndlr, PresetUpdateAvailableClickedEvent(EVT_PRESET_UPDATE_AVAILABLE_CLICKED)); return true; }},
|
[](wxEvtHandler* evnthndlr) {
|
||||||
|
if (evnthndlr != nullptr)
|
||||||
|
wxPostEvent(evnthndlr, PresetUpdateAvailableClickedEvent(EVT_PRESET_UPDATE_AVAILABLE_CLICKED));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotification, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr){
|
{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotification, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr){
|
||||||
wxLaunchDefaultBrowser("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
|
wxLaunchDefaultBrowser("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
|
||||||
{NotificationType::EmptyColorChangeCode, NotificationLevel::RegularNotification, 10,
|
{NotificationType::EmptyColorChangeCode, NotificationLevel::RegularNotification, 10,
|
||||||
|
@ -98,7 +98,7 @@ void OG_CustomCtrl::init_ctrl_lines()
|
|||||||
ctrl_lines.emplace_back(CtrlLine(height, this, line, false, opt_group->staticbox));
|
ctrl_lines.emplace_back(CtrlLine(height, this, line, false, opt_group->staticbox));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
int i = 0;
|
assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,9 +250,8 @@ void OptionsGroup::activate_line(Line& line)
|
|||||||
if (custom_ctrl)
|
if (custom_ctrl)
|
||||||
m_use_custom_ctrl_as_parent = true;
|
m_use_custom_ctrl_as_parent = true;
|
||||||
|
|
||||||
// if we have an extra column, build it
|
// if we have an extra column, build it
|
||||||
if (extra_column)
|
if (extra_column) {
|
||||||
{
|
|
||||||
m_extra_column_item_ptrs.push_back(extra_column(this->ctrl_parent(), line));
|
m_extra_column_item_ptrs.push_back(extra_column(this->ctrl_parent(), line));
|
||||||
grid_sizer->Add(m_extra_column_item_ptrs.back(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 3);
|
grid_sizer->Add(m_extra_column_item_ptrs.back(), 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 3);
|
||||||
}
|
}
|
||||||
@ -309,8 +308,8 @@ void OptionsGroup::activate_line(Line& line)
|
|||||||
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
auto sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||||
if (!custom_ctrl)
|
if (!custom_ctrl)
|
||||||
grid_sizer->Add(sizer, 0, wxEXPAND | (staticbox ? wxALL : wxBOTTOM | wxTOP | wxLEFT), staticbox ? 0 : 1);
|
grid_sizer->Add(sizer, 0, wxEXPAND | (staticbox ? wxALL : wxBOTTOM | wxTOP | wxLEFT), staticbox ? 0 : 1);
|
||||||
// If we have a single option with no sidetext just add it directly to the grid sizer
|
// If we have a single option with no sidetext just add it directly to the grid sizer
|
||||||
if (option_set.size() == 1 && option_set.front().opt.sidetext.size() == 0 &&
|
if (option_set.size() == 1 && option_set.front().opt.sidetext.size() == 0 &&
|
||||||
option_set.front().opt.label.empty() &&
|
option_set.front().opt.label.empty() &&
|
||||||
option_set.front().side_widget == nullptr && line.get_extra_widgets().size() == 0) {
|
option_set.front().side_widget == nullptr && line.get_extra_widgets().size() == 0) {
|
||||||
const auto& option = option_set.front();
|
const auto& option = option_set.front();
|
||||||
@ -319,16 +318,16 @@ void OptionsGroup::activate_line(Line& line)
|
|||||||
if (!custom_ctrl) {
|
if (!custom_ctrl) {
|
||||||
if (is_window_field(field))
|
if (is_window_field(field))
|
||||||
sizer->Add(field->getWindow(), option.opt.full_width ? 1 : 0,
|
sizer->Add(field->getWindow(), option.opt.full_width ? 1 : 0,
|
||||||
wxBOTTOM | wxTOP | (option.opt.full_width ? wxEXPAND : wxALIGN_CENTER_VERTICAL), (wxOSX || !staticbox) ? 0 : 2);
|
wxBOTTOM | wxTOP | (option.opt.full_width ? int(wxEXPAND) : int(wxALIGN_CENTER_VERTICAL)), (wxOSX || !staticbox) ? 0 : 2);
|
||||||
if (is_sizer_field(field))
|
if (is_sizer_field(field))
|
||||||
sizer->Add(field->getSizer(), 1, option.opt.full_width ? wxEXPAND : wxALIGN_CENTER_VERTICAL, 0);
|
sizer->Add(field->getSizer(), 1, (option.opt.full_width ? int(wxEXPAND) : int(wxALIGN_CENTER_VERTICAL)), 0);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto opt : option_set) {
|
for (auto opt : option_set) {
|
||||||
ConfigOptionDef option = opt.opt;
|
ConfigOptionDef option = opt.opt;
|
||||||
wxSizer* sizer_tmp = sizer;
|
wxSizer* sizer_tmp = sizer;
|
||||||
// add label if any
|
// add label if any
|
||||||
if (!option.label.empty() && !custom_ctrl) {
|
if (!option.label.empty() && !custom_ctrl) {
|
||||||
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
|
//! To correct translation by context have to use wxGETTEXT_IN_CONTEXT macro from wxWidget 3.1.1
|
||||||
|
@ -333,7 +333,7 @@ void PrintHostQueueDialog::on_cancel(Event &evt)
|
|||||||
void PrintHostQueueDialog::get_active_jobs(std::vector<std::pair<std::string, std::string>>& ret)
|
void PrintHostQueueDialog::get_active_jobs(std::vector<std::pair<std::string, std::string>>& ret)
|
||||||
{
|
{
|
||||||
int ic = job_list->GetItemCount();
|
int ic = job_list->GetItemCount();
|
||||||
for (size_t i = 0; i < ic; i++)
|
for (int i = 0; i < ic; i++)
|
||||||
{
|
{
|
||||||
auto item = job_list->RowToItem(i);
|
auto item = job_list->RowToItem(i);
|
||||||
auto data = job_list->GetItemData(item);
|
auto data = job_list->GetItemData(item);
|
||||||
|
@ -411,11 +411,6 @@ Slic3r::GUI::PageShp Tab::add_options_page(const wxString& title, const std::str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Initialize the page.
|
// Initialize the page.
|
||||||
#ifdef __WXOSX__
|
|
||||||
auto panel = m_tmp_panel;
|
|
||||||
#else
|
|
||||||
auto panel = this;
|
|
||||||
#endif
|
|
||||||
PageShp page(new Page(m_page_view, title, icon_idx));
|
PageShp page(new Page(m_page_view, title, icon_idx));
|
||||||
// page->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
|
// page->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
@ -2999,8 +2994,8 @@ void Tab::update_btns_enabling()
|
|||||||
// we can delete any preset from the physical printer
|
// we can delete any preset from the physical printer
|
||||||
// and any user preset
|
// and any user preset
|
||||||
const Preset& preset = m_presets->get_edited_preset();
|
const Preset& preset = m_presets->get_edited_preset();
|
||||||
m_btn_delete_preset->Show(m_type == Preset::TYPE_PRINTER && m_preset_bundle->physical_printers.has_selection() ||
|
m_btn_delete_preset->Show((m_type == Preset::TYPE_PRINTER && m_preset_bundle->physical_printers.has_selection())
|
||||||
!preset.is_default && !preset.is_system);
|
|| (!preset.is_default && !preset.is_system));
|
||||||
|
|
||||||
if (m_btn_edit_ph_printer)
|
if (m_btn_edit_ph_printer)
|
||||||
m_btn_edit_ph_printer->SetToolTip( m_preset_bundle->physical_printers.has_selection() ?
|
m_btn_edit_ph_printer->SetToolTip( m_preset_bundle->physical_printers.has_selection() ?
|
||||||
|
Loading…
Reference in New Issue
Block a user