Fix Compile Warnings (#5963)
* Fix calls to depreciated wxPen constructor * Fix use of wxTimerEvent * Fix unrecognized character escape sequence * Fix signed/unsigned mismatch At least as much as possible without significantly altering parts of the application * Clean unreferenced variables * fix mistyped namespace selector * Update deprecated calls * Fix preprocessor statement * Remove empty switch statements * Change int vector used as bool to bool vector * Remove empty control statements and related unused code * Change multi character constant to string constant * Fix discarded return value json::parse was being called on the object, rather than statically like it should be. Also, the value was not being captured. * Rename ICON_SIZE def used by MultiMachine By having the definition in the header, it causes issues when other files define ICON_SIZE. By renaming it to MM_ICON_SIZE, this lessens the issue. It would probably be ideal to have the definitions in the respective .cpp that use them, but it would make it less convenient to update the values if needed in the future. * Remove unused includes * Fix linux/macOS compilation * Hide unused-function errors on non-Windows systems * Disable signed/unsigned comparison mismatch error * Remove/Disable more unused variables Still TODO: check double for loop in Print.cpp * Remove unused variable that was missed * Remove unused variables in libraries in the src folder * Apply temporary fix for subobject linkage error * Remove/Disable last set of unused variables reported by GCC * remove redundant for loop * fix misspelled ifdef check * Update message on dialog * Fix hard-coded platform specific modifier keys * Remove duplicate for loop * Disable -Wmisleading-indentation warning * disable -Wswitch warning * Remove unused local typedefs * Fix -Wunused-value * Fix pragma error on Windows from subobject linkage fix * Fix -Waddress * Fix null conversions (-Wconversion-null) --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@ -338,7 +338,7 @@ static std::string get_svg_filename(std::string layer_nr_or_z, std::string tag
|
||||
rand_init = true;
|
||||
}
|
||||
|
||||
int rand_num = rand() % 1000000;
|
||||
// int rand_num = rand() % 1000000;
|
||||
//makedir("./SVG");
|
||||
std::string prefix = "./SVG/";
|
||||
std::string suffix = ".svg";
|
||||
@ -1554,7 +1554,6 @@ static inline ExPolygons detect_overhangs(
|
||||
double thresh_angle = object_config.support_threshold_angle.value > 0 ? object_config.support_threshold_angle.value + 1 : 0;
|
||||
thresh_angle = std::min(thresh_angle, 89.); // BBS should be smaller than 90
|
||||
const double threshold_rad = Geometry::deg2rad(thresh_angle);
|
||||
const coordf_t max_bridge_length = scale_(object_config.max_bridge_length.value);
|
||||
const bool bridge_no_support = object_config.bridge_no_support.value;
|
||||
const coordf_t xy_expansion = scale_(object_config.support_expansion.value);
|
||||
|
||||
@ -1577,7 +1576,6 @@ static inline ExPolygons detect_overhangs(
|
||||
{
|
||||
// Generate overhang / contact_polygons for non-raft layers.
|
||||
const Layer &lower_layer = *layer.lower_layer;
|
||||
const bool has_enforcer = !annotations.enforcers_layers.empty() && !annotations.enforcers_layers[layer_id].empty();
|
||||
// Can't directly use lower_layer.lslices, or we'll miss some very sharp tails.
|
||||
// Filter out areas whose diameter that is smaller than extrusion_width. Do not use offset2() for this purpose!
|
||||
// FIXME if there are multiple regions with different extrusion width, the following code may not be right.
|
||||
@ -1689,7 +1687,6 @@ static inline ExPolygons detect_overhangs(
|
||||
// check cantilever
|
||||
if (layer.lower_layer) {
|
||||
for (ExPolygon& poly : overhang_areas) {
|
||||
float fw = float(layer.regions().front()->flow(frExternalPerimeter).scaled_width());
|
||||
auto cluster_boundary_ex = intersection_ex(poly, offset_ex(layer.lower_layer->lslices, scale_(0.5)));
|
||||
Polygons cluster_boundary = to_polygons(cluster_boundary_ex);
|
||||
if (cluster_boundary.empty()) continue;
|
||||
@ -1734,7 +1731,6 @@ static inline std::tuple<Polygons, Polygons, double> detect_contacts(
|
||||
Polygons enforcer_polygons;
|
||||
|
||||
// BBS.
|
||||
const bool auto_normal_support = object_config.support_type.value == stNormalAuto;
|
||||
const bool buildplate_only = !annotations.buildplate_covered.empty();
|
||||
float no_interface_offset = 0.f;
|
||||
|
||||
@ -1748,8 +1744,6 @@ static inline std::tuple<Polygons, Polygons, double> detect_contacts(
|
||||
// Generate overhang / contact_polygons for non-raft layers.
|
||||
const Layer& lower_layer = *layer.lower_layer;
|
||||
const bool has_enforcer = !annotations.enforcers_layers.empty() && !annotations.enforcers_layers[layer_id].empty();
|
||||
const ExPolygons& lower_layer_expolys = lower_layer.lslices;
|
||||
const ExPolygons& lower_layer_sharptails = lower_layer.sharp_tails;
|
||||
|
||||
// Cache support trimming polygons derived from lower layer polygons, possible merged with "on build plate only" trimming polygons.
|
||||
auto slices_margin_update =
|
||||
@ -2187,7 +2181,6 @@ struct OverhangCluster {
|
||||
|
||||
static OverhangCluster* add_overhang(std::vector<OverhangCluster>& clusters, ExPolygon* overhang, int layer_nr, coordf_t offset_scaled) {
|
||||
OverhangCluster* cluster = nullptr;
|
||||
bool found = false;
|
||||
for (int i = 0; i < clusters.size(); i++) {
|
||||
auto cluster_i = &clusters[i];
|
||||
if (cluster_i->intersects(*overhang, layer_nr)) {
|
||||
@ -3546,13 +3539,13 @@ std::pair<PrintObjectSupportMaterial::MyLayersPtr, PrintObjectSupportMaterial::M
|
||||
// distinguish between interface and base interface layers
|
||||
// Contact layer is considered an interface layer, therefore run the following block only if support_interface_top_layers > 1.
|
||||
// Contact layer needs a base_interface layer, therefore run the following block if support_interface_top_layers > 0, has soluble support and extruders are different.
|
||||
bool soluble_interface_non_soluble_base =
|
||||
// Zero z-gap between the overhangs and the support interface.
|
||||
m_slicing_params.soluble_interface &&
|
||||
// Interface extruder soluble.
|
||||
m_object_config->support_interface_filament.value > 0 && m_print_config->filament_soluble.get_at(m_object_config->support_interface_filament.value - 1) &&
|
||||
// Base extruder: Either "print with active extruder" not soluble.
|
||||
(m_object_config->support_filament.value == 0 || ! m_print_config->filament_soluble.get_at(m_object_config->support_filament.value - 1));
|
||||
// bool soluble_interface_non_soluble_base =
|
||||
// // Zero z-gap between the overhangs and the support interface.
|
||||
// m_slicing_params.soluble_interface &&
|
||||
// // Interface extruder soluble.
|
||||
// m_object_config->support_interface_filament.value > 0 && m_print_config->filament_soluble.get_at(m_object_config->support_interface_filament.value - 1) &&
|
||||
// // Base extruder: Either "print with active extruder" not soluble.
|
||||
// (m_object_config->support_filament.value == 0 || ! m_print_config->filament_soluble.get_at(m_object_config->support_filament.value - 1));
|
||||
bool snug_supports = m_object_config->support_style.value == smsSnug;
|
||||
// BBS: if support interface and support base do not use the same filament, add a base layer to improve their adhesion
|
||||
bool differnt_support_interface_filament = m_object_config->support_interface_filament.value != m_object_config->support_filament.value;
|
||||
@ -4628,7 +4621,6 @@ void PrintObjectSupportMaterial::generate_toolpaths(
|
||||
|
||||
if (object_layer != nullptr) {
|
||||
float biggest_bridge_area = 0.f;
|
||||
const Polygons& top_contact_polys = top_contact_layer.polygons_to_extrude();
|
||||
for (auto layerm : object_layer->regions()) {
|
||||
for (auto bridge_surface : layerm->fill_surfaces.filter_by_type(stBottomBridge)) {
|
||||
float bs_area = bridge_surface->area();
|
||||
|
||||
Reference in New Issue
Block a user