Removed the STDMOVE macro.

This commit is contained in:
bubnikv 2018-11-02 20:45:23 +01:00
parent 5da83742a3
commit 3b72748489
6 changed files with 31 additions and 44 deletions

View file

@ -247,7 +247,7 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
// Only concentric fills are not sorted. // Only concentric fills are not sorted.
eec->no_sort = f->no_sort(); eec->no_sort = f->no_sort();
extrusion_entities_append_paths( extrusion_entities_append_paths(
eec->entities, STDMOVE(polylines), eec->entities, std::move(polylines),
is_bridge ? is_bridge ?
erBridgeInfill : erBridgeInfill :
(surface.is_solid() ? (surface.is_solid() ?

View file

@ -135,7 +135,7 @@ void Layer::make_perimeters()
// Separate the fill surfaces. // Separate the fill surfaces.
ExPolygons expp = intersection_ex(to_polygons(fill_surfaces), (*l)->slices); ExPolygons expp = intersection_ex(to_polygons(fill_surfaces), (*l)->slices);
(*l)->fill_expolygons = expp; (*l)->fill_expolygons = expp;
(*l)->fill_surfaces.set(STDMOVE(expp), fill_surfaces.surfaces.front()); (*l)->fill_surfaces.set(std::move(expp), fill_surfaces.surfaces.front());
} }
} }
} }

View file

@ -34,7 +34,7 @@ void LayerRegion::slices_to_fill_surfaces_clipped()
// in place. However we're now only using its boundaries (which are invariant) // in place. However we're now only using its boundaries (which are invariant)
// so we're safe. This guarantees idempotence of prepare_infill() also in case // so we're safe. This guarantees idempotence of prepare_infill() also in case
// that combine_infill() turns some fill_surface into VOID surfaces. // that combine_infill() turns some fill_surface into VOID surfaces.
// Polygons fill_boundaries = to_polygons(STDMOVE(this->fill_surfaces)); // Polygons fill_boundaries = to_polygons(std::move(this->fill_surfaces));
Polygons fill_boundaries = to_polygons(this->fill_expolygons); Polygons fill_boundaries = to_polygons(this->fill_expolygons);
// Collect polygons per surface type. // Collect polygons per surface type.
std::vector<Polygons> polygons_by_surface; std::vector<Polygons> polygons_by_surface;
@ -133,9 +133,9 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
if (internal_surface) if (internal_surface)
// Make a copy as the following line uses the move semantics. // Make a copy as the following line uses the move semantics.
internal.push_back(surface); internal.push_back(surface);
polygons_append(fill_boundaries, STDMOVE(surface.expolygon)); polygons_append(fill_boundaries, std::move(surface.expolygon));
} else if (internal_surface) } else if (internal_surface)
internal.push_back(STDMOVE(surface)); internal.push_back(std::move(surface));
} }
} }
@ -192,7 +192,7 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
polys = intersection(polys, to_polygons(fill_boundaries_ex[idx_island])); polys = intersection(polys, to_polygons(fill_boundaries_ex[idx_island]));
} }
bridge_bboxes.push_back(get_extents(polys)); bridge_bboxes.push_back(get_extents(polys));
bridges_grown.push_back(STDMOVE(polys)); bridges_grown.push_back(std::move(polys));
} }
} }
@ -243,7 +243,7 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
for (size_t i = 0; i < bridges.size(); ++ i) { for (size_t i = 0; i < bridges.size(); ++ i) {
if (bridge_group[i] != group_id) if (bridge_group[i] != group_id)
continue; continue;
initial.push_back(STDMOVE(bridges[i].expolygon)); initial.push_back(std::move(bridges[i].expolygon));
polygons_append(grown, bridges_grown[i]); polygons_append(grown, bridges_grown[i]);
} }
// detect bridge direction before merging grown surfaces otherwise adjacent bridges // detect bridge direction before merging grown surfaces otherwise adjacent bridges
@ -269,7 +269,7 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
surfaces_append(bottom, union_ex(grown, true), bridges[idx_last]); surfaces_append(bottom, union_ex(grown, true), bridges[idx_last]);
} }
fill_boundaries = STDMOVE(to_polygons(fill_boundaries_ex)); fill_boundaries = std::move(to_polygons(fill_boundaries_ex));
BOOST_LOG_TRIVIAL(trace) << "Processing external surface, detecting bridges - done"; BOOST_LOG_TRIVIAL(trace) << "Processing external surface, detecting bridges - done";
} }
@ -284,7 +284,7 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
Surfaces new_surfaces; Surfaces new_surfaces;
{ {
// Merge top and bottom in a single collection. // Merge top and bottom in a single collection.
surfaces_append(top, STDMOVE(bottom)); surfaces_append(top, std::move(bottom));
// Intersect the grown surfaces with the actual fill boundaries. // Intersect the grown surfaces with the actual fill boundaries.
Polygons bottom_polygons = to_polygons(bottom); Polygons bottom_polygons = to_polygons(bottom);
for (size_t i = 0; i < top.size(); ++ i) { for (size_t i = 0; i < top.size(); ++ i) {
@ -292,11 +292,11 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
if (s1.empty()) if (s1.empty())
continue; continue;
Polygons polys; Polygons polys;
polygons_append(polys, STDMOVE(s1)); polygons_append(polys, std::move(s1));
for (size_t j = i + 1; j < top.size(); ++ j) { for (size_t j = i + 1; j < top.size(); ++ j) {
Surface &s2 = top[j]; Surface &s2 = top[j];
if (! s2.empty() && surfaces_could_merge(s1, s2)) { if (! s2.empty() && surfaces_could_merge(s1, s2)) {
polygons_append(polys, STDMOVE(s2)); polygons_append(polys, std::move(s2));
s2.clear(); s2.clear();
} }
} }
@ -306,7 +306,7 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
surfaces_append( surfaces_append(
new_surfaces, new_surfaces,
// Don't use a safety offset as fill_boundaries were already united using the safety offset. // Don't use a safety offset as fill_boundaries were already united using the safety offset.
STDMOVE(intersection_ex(polys, fill_boundaries, false)), std::move(intersection_ex(polys, fill_boundaries, false)),
s1); s1);
} }
} }
@ -318,20 +318,20 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer)
if (s1.empty()) if (s1.empty())
continue; continue;
Polygons polys; Polygons polys;
polygons_append(polys, STDMOVE(s1)); polygons_append(polys, std::move(s1));
for (size_t j = i + 1; j < internal.size(); ++ j) { for (size_t j = i + 1; j < internal.size(); ++ j) {
Surface &s2 = internal[j]; Surface &s2 = internal[j];
if (! s2.empty() && surfaces_could_merge(s1, s2)) { if (! s2.empty() && surfaces_could_merge(s1, s2)) {
polygons_append(polys, STDMOVE(s2)); polygons_append(polys, std::move(s2));
s2.clear(); s2.clear();
} }
} }
ExPolygons new_expolys = diff_ex(polys, new_polygons); ExPolygons new_expolys = diff_ex(polys, new_polygons);
polygons_append(new_polygons, to_polygons(new_expolys)); polygons_append(new_polygons, to_polygons(new_expolys));
surfaces_append(new_surfaces, STDMOVE(new_expolys), s1); surfaces_append(new_surfaces, std::move(new_expolys), s1);
} }
this->fill_surfaces.surfaces = STDMOVE(new_surfaces); this->fill_surfaces.surfaces = std::move(new_surfaces);
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING #ifdef SLIC3R_DEBUG_SLICE_PROCESSING
export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-final"); export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-final");

View file

@ -2450,7 +2450,7 @@ void LoopInterfaceProcessor::generate(MyLayerExtruded &top_contact_layer, const
// Transform loops into ExtrusionPath objects. // Transform loops into ExtrusionPath objects.
extrusion_entities_append_paths( extrusion_entities_append_paths(
top_contact_layer.extrusions, top_contact_layer.extrusions,
STDMOVE(loop_lines), std::move(loop_lines),
erSupportMaterialInterface, flow.mm3_per_mm(), flow.width, flow.height); erSupportMaterialInterface, flow.mm3_per_mm(), flow.width, flow.height);
} }
@ -2827,7 +2827,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
to_infill = offset_ex(to_infill, float(- 0.4 * flow.scaled_spacing())); to_infill = offset_ex(to_infill, float(- 0.4 * flow.scaled_spacing()));
extrusion_entities_append_paths( extrusion_entities_append_paths(
support_layer.support_fills.entities, support_layer.support_fills.entities,
to_polylines(STDMOVE(to_infill_polygons)), to_polylines(std::move(to_infill_polygons)),
erSupportMaterial, flow.mm3_per_mm(), flow.width, flow.height); erSupportMaterial, flow.mm3_per_mm(), flow.width, flow.height);
} }
if (! to_infill.empty()) { if (! to_infill.empty()) {
@ -2841,7 +2841,7 @@ void PrintObjectSupportMaterial::generate_toolpaths(
// Destination // Destination
support_layer.support_fills.entities, support_layer.support_fills.entities,
// Regions to fill // Regions to fill
STDMOVE(to_infill), std::move(to_infill),
// Filler and its parameters // Filler and its parameters
filler, float(support_density), filler, float(support_density),
// Extrusion parameters // Extrusion parameters
@ -3037,14 +3037,14 @@ void PrintObjectSupportMaterial::generate_toolpaths(
to_infill = offset_ex(to_infill, - 0.4 * float(flow.scaled_spacing())); to_infill = offset_ex(to_infill, - 0.4 * float(flow.scaled_spacing()));
extrusion_entities_append_paths( extrusion_entities_append_paths(
base_layer.extrusions, base_layer.extrusions,
to_polylines(STDMOVE(to_infill_polygons)), to_polylines(std::move(to_infill_polygons)),
erSupportMaterial, flow.mm3_per_mm(), flow.width, flow.height); erSupportMaterial, flow.mm3_per_mm(), flow.width, flow.height);
} }
fill_expolygons_generate_paths( fill_expolygons_generate_paths(
// Destination // Destination
base_layer.extrusions, base_layer.extrusions,
// Regions to fill // Regions to fill
STDMOVE(to_infill), std::move(to_infill),
// Filler and its parameters // Filler and its parameters
filler, density, filler, density,
// Extrusion parameters // Extrusion parameters

View file

@ -47,19 +47,6 @@ typedef double coordf_t;
#define scale_(val) ((val) / SCALING_FACTOR) #define scale_(val) ((val) / SCALING_FACTOR)
#define SCALED_EPSILON scale_(EPSILON) #define SCALED_EPSILON scale_(EPSILON)
// Which C++ version is supported?
// For example, could optimized functions with move semantics be used?
#if __cplusplus==201402L
#define SLIC3R_CPPVER 14
#define STDMOVE(WHAT) std::move(WHAT)
#elif __cplusplus==201103L
#define SLIC3R_CPPVER 11
#define STDMOVE(WHAT) std::move(WHAT)
#else
#define SLIC3R_CPPVER 0
#define STDMOVE(WHAT) (WHAT)
#endif
#define SLIC3R_DEBUG_OUT_PATH_PREFIX "out/" #define SLIC3R_DEBUG_OUT_PATH_PREFIX "out/"
inline std::string debug_out_path(const char *name, ...) inline std::string debug_out_path(const char *name, ...)

View file

@ -22,18 +22,18 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
// is the normal type. // is the normal type.
if (opt.gui_type.compare("select") == 0) { if (opt.gui_type.compare("select") == 0) {
} else if (opt.gui_type.compare("select_open") == 0) { } else if (opt.gui_type.compare("select_open") == 0) {
m_fields.emplace(id, STDMOVE(Choice::Create<Choice>(parent(), opt, id))); m_fields.emplace(id, std::move(Choice::Create<Choice>(parent(), opt, id)));
} else if (opt.gui_type.compare("color") == 0) { } else if (opt.gui_type.compare("color") == 0) {
m_fields.emplace(id, STDMOVE(ColourPicker::Create<ColourPicker>(parent(), opt, id))); m_fields.emplace(id, std::move(ColourPicker::Create<ColourPicker>(parent(), opt, id)));
} else if (opt.gui_type.compare("f_enum_open") == 0 || } else if (opt.gui_type.compare("f_enum_open") == 0 ||
opt.gui_type.compare("i_enum_open") == 0 || opt.gui_type.compare("i_enum_open") == 0 ||
opt.gui_type.compare("i_enum_closed") == 0) { opt.gui_type.compare("i_enum_closed") == 0) {
m_fields.emplace(id, STDMOVE(Choice::Create<Choice>(parent(), opt, id))); m_fields.emplace(id, std::move(Choice::Create<Choice>(parent(), opt, id)));
} else if (opt.gui_type.compare("slider") == 0) { } else if (opt.gui_type.compare("slider") == 0) {
m_fields.emplace(id, STDMOVE(SliderCtrl::Create<SliderCtrl>(parent(), opt, id))); m_fields.emplace(id, std::move(SliderCtrl::Create<SliderCtrl>(parent(), opt, id)));
} else if (opt.gui_type.compare("i_spin") == 0) { // Spinctrl } else if (opt.gui_type.compare("i_spin") == 0) { // Spinctrl
} else if (opt.gui_type.compare("legend") == 0) { // StaticText } else if (opt.gui_type.compare("legend") == 0) { // StaticText
m_fields.emplace(id, STDMOVE(StaticText::Create<StaticText>(parent(), opt, id))); m_fields.emplace(id, std::move(StaticText::Create<StaticText>(parent(), opt, id)));
} else { } else {
switch (opt.type) { switch (opt.type) {
case coFloatOrPercent: case coFloatOrPercent:
@ -43,21 +43,21 @@ const t_field& OptionsGroup::build_field(const t_config_option_key& id, const Co
case coPercents: case coPercents:
case coString: case coString:
case coStrings: case coStrings:
m_fields.emplace(id, STDMOVE(TextCtrl::Create<TextCtrl>(parent(), opt, id))); m_fields.emplace(id, std::move(TextCtrl::Create<TextCtrl>(parent(), opt, id)));
break; break;
case coBool: case coBool:
case coBools: case coBools:
m_fields.emplace(id, STDMOVE(CheckBox::Create<CheckBox>(parent(), opt, id))); m_fields.emplace(id, std::move(CheckBox::Create<CheckBox>(parent(), opt, id)));
break; break;
case coInt: case coInt:
case coInts: case coInts:
m_fields.emplace(id, STDMOVE(SpinCtrl::Create<SpinCtrl>(parent(), opt, id))); m_fields.emplace(id, std::move(SpinCtrl::Create<SpinCtrl>(parent(), opt, id)));
break; break;
case coEnum: case coEnum:
m_fields.emplace(id, STDMOVE(Choice::Create<Choice>(parent(), opt, id))); m_fields.emplace(id, std::move(Choice::Create<Choice>(parent(), opt, id)));
break; break;
case coPoints: case coPoints:
m_fields.emplace(id, STDMOVE(PointCtrl::Create<PointCtrl>(parent(), opt, id))); m_fields.emplace(id, std::move(PointCtrl::Create<PointCtrl>(parent(), opt, id)));
break; break;
case coNone: break; case coNone: break;
default: default: