mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-25 01:31:14 -06:00
Fixed some clang warnings
This commit is contained in:
parent
770d8b5d08
commit
5e9a8ea700
17 changed files with 45 additions and 30 deletions
|
|
@ -301,7 +301,7 @@ static Polylines connect_brim_lines(Polylines &&polylines, const Polygons &brim_
|
|||
polylines.erase(polylines.begin() + end, polylines.end());
|
||||
}
|
||||
|
||||
return polylines;
|
||||
return std::move(polylines);
|
||||
}
|
||||
|
||||
static void make_inner_brim(const Print &print, const ConstPrintObjectPtrs &top_level_objects_with_brim, ExtrusionEntityCollection &brim)
|
||||
|
|
|
|||
|
|
@ -1695,6 +1695,7 @@ public:
|
|||
// Static configuration definition. Any value stored into this ConfigBase shall have its definition here.
|
||||
virtual const ConfigDef* def() const = 0;
|
||||
// Find ando/or create a ConfigOption instance for a given name.
|
||||
using ConfigOptionResolver::optptr;
|
||||
virtual ConfigOption* optptr(const t_config_option_key &opt_key, bool create = false) = 0;
|
||||
// Collect names of all configuration values maintained by this configuration store.
|
||||
virtual t_config_option_keys keys() const = 0;
|
||||
|
|
|
|||
|
|
@ -445,6 +445,7 @@ Points resample_polygon(const Points &contour, double dist, std::vector<Resample
|
|||
return out;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static inline void smooth_compensation(std::vector<float> &compensation, float strength, size_t num_iterations)
|
||||
{
|
||||
std::vector<float> out(compensation);
|
||||
|
|
@ -459,6 +460,7 @@ static inline void smooth_compensation(std::vector<float> &compensation, float s
|
|||
out.swap(compensation);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void smooth_compensation_banded(const Points &contour, float band, std::vector<float> &compensation, float strength, size_t num_iterations)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -690,6 +690,7 @@ static inline bool interval_inside_interval(double outer_low, double outer_high,
|
|||
return inside_interval(outer_low, outer_high, inner_low) && inside_interval(outer_low, outer_high, inner_high);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static inline bool cyclic_interval_inside_interval(double outer_low, double outer_high, double inner_low, double inner_high, double length)
|
||||
{
|
||||
if (outer_low > outer_high)
|
||||
|
|
@ -702,6 +703,7 @@ static inline bool cyclic_interval_inside_interval(double outer_low, double oute
|
|||
}
|
||||
return interval_inside_interval(outer_low, outer_high, inner_low, inner_high, double(SCALED_EPSILON));
|
||||
}
|
||||
#endif
|
||||
|
||||
// #define INFILL_DEBUG_OUTPUT
|
||||
|
||||
|
|
|
|||
|
|
@ -2245,22 +2245,22 @@ static std::vector<MonotonicRegionLink> chain_monotonic_regions(
|
|||
#endif /* NDEBUG */
|
||||
|
||||
// How many times to repeat the ant simulation (number of ant generations).
|
||||
constexpr int num_rounds = 25;
|
||||
constexpr int const const num_rounds = 25;
|
||||
// After how many rounds without an improvement to exit?
|
||||
constexpr int num_rounds_no_change_exit = 8;
|
||||
constexpr int const num_rounds_no_change_exit = 8;
|
||||
// With how many ants each of the run will be performed?
|
||||
const int num_ants = std::min(int(regions.size()), 10);
|
||||
const int const num_ants = std::min(int(regions.size()), 10);
|
||||
// Base (initial) pheromone level. This value will be adjusted based on the length of the first greedy path found.
|
||||
float pheromone_initial_deposit = 0.5f;
|
||||
// Evaporation rate of pheromones.
|
||||
constexpr float pheromone_evaporation = 0.1f;
|
||||
constexpr float const pheromone_evaporation = 0.1f;
|
||||
// Evaporation rate to diversify paths taken by individual ants.
|
||||
constexpr float pheromone_diversification = 0.1f;
|
||||
constexpr float const pheromone_diversification = 0.1f;
|
||||
// Probability at which to take the next best path. Otherwise take the the path based on the cost distribution.
|
||||
constexpr float probability_take_best = 0.9f;
|
||||
constexpr float const probability_take_best = 0.9f;
|
||||
// Exponents of the cost function.
|
||||
constexpr float pheromone_alpha = 1.f; // pheromone exponent
|
||||
constexpr float pheromone_beta = 2.f; // attractiveness weighted towards edge length
|
||||
constexpr float const pheromone_alpha = 1.f; // pheromone exponent
|
||||
constexpr float const pheromone_beta = 2.f; // attractiveness weighted towards edge length
|
||||
|
||||
AntPathMatrix path_matrix(regions, poly_with_offset, segs, pheromone_initial_deposit);
|
||||
|
||||
|
|
|
|||
|
|
@ -2432,7 +2432,7 @@ namespace Slic3r {
|
|||
if (!volume->mesh().has_shared_vertices())
|
||||
throw Slic3r::FileIOError("store_3mf() requires shared vertices");
|
||||
|
||||
volumes_offsets.insert({ volume, Offsets(vertices_count) }).first;
|
||||
volumes_offsets.insert({ volume, Offsets(vertices_count) });
|
||||
|
||||
const indexed_triangle_set &its = volume->mesh().its;
|
||||
if (its.vertices.empty()) {
|
||||
|
|
|
|||
|
|
@ -891,6 +891,7 @@ namespace DoExport {
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Sort the PrintObjects by their increasing Z, likely useful for avoiding colisions on Deltas during sequential prints.
|
||||
static inline std::vector<const PrintInstance*> sort_object_instances_by_max_z(const Print &print)
|
||||
{
|
||||
|
|
@ -903,6 +904,7 @@ static inline std::vector<const PrintInstance*> sort_object_instances_by_max_z(c
|
|||
instances.emplace_back(&object->instances()[i]);
|
||||
return instances;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Produce a vector of PrintObjects in the order of their respective ModelObjects in print.model().
|
||||
std::vector<const PrintInstance*> sort_object_instances_by_model_order(const Print& print)
|
||||
|
|
|
|||
|
|
@ -1083,6 +1083,7 @@ void svg_draw_polyline_chain(const char *name, size_t idx, const Polylines &poly
|
|||
}
|
||||
#endif /* DEBUG_SVG_OUTPUT */
|
||||
|
||||
#if 0
|
||||
// Flip the sequences of polylines to lower the total length of connecting lines.
|
||||
static inline void improve_ordering_by_segment_flipping(Polylines &polylines, bool fixed_start)
|
||||
{
|
||||
|
|
@ -1253,6 +1254,7 @@ static inline void improve_ordering_by_segment_flipping(Polylines &polylines, bo
|
|||
assert(cost_final <= cost_initial);
|
||||
#endif /* NDEBUG */
|
||||
}
|
||||
#endif
|
||||
|
||||
struct FlipEdge {
|
||||
FlipEdge(const Vec2d &p1, const Vec2d &p2, size_t source_index) : p1(p1), p2(p2), source_index(source_index) {}
|
||||
|
|
@ -1337,6 +1339,7 @@ static inline std::pair<double, size_t> minimum_crossover_cost(
|
|||
return std::make_pair(cost_min, flip_min);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static inline std::pair<double, size_t> minimum_crossover_cost(
|
||||
const std::vector<FlipEdge> &edges,
|
||||
const std::pair<size_t, size_t> &span1, const ConnectionCost &cost1,
|
||||
|
|
@ -1412,6 +1415,7 @@ static inline std::pair<double, size_t> minimum_crossover_cost(
|
|||
}
|
||||
return std::make_pair(cost_min, flip_min);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void do_crossover(const std::vector<FlipEdge> &edges_in, std::vector<FlipEdge> &edges_out,
|
||||
const std::pair<size_t, size_t> &span1, const std::pair<size_t, size_t> &span2, const std::pair<size_t, size_t> &span3,
|
||||
|
|
@ -1454,7 +1458,7 @@ static inline void do_crossover(const std::vector<FlipEdge> &edges_in, std::vect
|
|||
assert(edges_in.size() == edges_out.size());
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static inline void do_crossover(const std::vector<FlipEdge> &edges_in, std::vector<FlipEdge> &edges_out,
|
||||
const std::pair<size_t, size_t> &span1, const std::pair<size_t, size_t> &span2, const std::pair<size_t, size_t> &span3, const std::pair<size_t, size_t> &span4,
|
||||
size_t i)
|
||||
|
|
@ -1526,6 +1530,7 @@ static inline void do_crossover(const std::vector<FlipEdge> &edges_in, std::vect
|
|||
}
|
||||
assert(edges_in.size() == edges_out.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
// Worst time complexity: O(min(n, 100) * (n * log n + n^2)
|
||||
// Expected time complexity: O(min(n, 100) * (n * log n + k * n)
|
||||
|
|
@ -1702,6 +1707,7 @@ private:
|
|||
const ConnectionCost* costs[4];
|
||||
};
|
||||
|
||||
#if 0
|
||||
static inline std::pair<double, size_t> minimum_crossover_cost(
|
||||
const FourOptCosts &segment_costs,
|
||||
const Matrixd &segment_end_point_distance_matrix,
|
||||
|
|
@ -1760,7 +1766,6 @@ static inline std::pair<double, size_t> minimum_crossover_cost(
|
|||
return std::make_pair(cost_min, flip_min);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Currently not used, too slow.
|
||||
static inline void reorder_by_three_exchanges_with_segment_flipping2(std::vector<FlipEdge> &edges)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static inline std::pair<float, float> face_z_span(const stl_facet &f)
|
|||
// https://tams.informatik.uni-hamburg.de/publications/2017/Adaptive%20Slicing%20for%20the%20FDM%20Process%20Revisited.pdf
|
||||
// (page 51, formula (8))
|
||||
// Currenty @platch's error metric formula is not used.
|
||||
static constexpr double SURFACE_CONST = 0.18403;
|
||||
static constexpr const double SURFACE_CONST = 0.18403;
|
||||
|
||||
// for a given facet, compute maximum height within the allowed surface roughness / stairstepping deviation
|
||||
static inline float layer_height_from_slope(const SlicingAdaptive::FaceZ &face, float max_surface_deviation)
|
||||
|
|
|
|||
|
|
@ -3304,7 +3304,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
|
|||
|
||||
// Now modulate the support layer height in parallel.
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(n_raft_layers, support_layers.size()),
|
||||
[this, &support_layers, &layer_caches]
|
||||
[&support_layers, &layer_caches]
|
||||
(const tbb::blocked_range<size_t>& range) {
|
||||
for (size_t support_layer_id = range.begin(); support_layer_id < range.end(); ++ support_layer_id) {
|
||||
SupportLayer &support_layer = *support_layers[support_layer_id];
|
||||
|
|
|
|||
|
|
@ -1146,6 +1146,7 @@ TriangleMeshSlicer::FacetSliceType TriangleMeshSlicer::slice_facet(
|
|||
return NoSlice;
|
||||
}
|
||||
|
||||
#if 0
|
||||
//FIXME Should this go away? For valid meshes the function slice_facet() returns Slicing
|
||||
// and sets edges of vertical triangles to produce only a single edge per pair of neighbor faces.
|
||||
// So the following code makes only sense now to handle degenerate meshes with more than two faces
|
||||
|
|
@ -1209,7 +1210,7 @@ static inline void remove_tangent_edges(std::vector<IntersectionLine> &lines)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct OpenPolyline {
|
||||
OpenPolyline() {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue