2019-09-26 07:44:38 +00:00
|
|
|
#ifndef slic3r_ShortestPath_hpp_
|
|
|
|
#define slic3r_ShortestPath_hpp_
|
|
|
|
|
|
|
|
#include "libslic3r.h"
|
|
|
|
#include "ExtrusionEntity.hpp"
|
|
|
|
#include "Point.hpp"
|
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
#include <vector>
|
|
|
|
|
2019-09-26 15:30:03 +00:00
|
|
|
namespace ClipperLib { class PolyNode; }
|
|
|
|
|
2019-09-26 07:44:38 +00:00
|
|
|
namespace Slic3r {
|
|
|
|
|
2019-09-26 14:39:50 +00:00
|
|
|
std::vector<size_t> chain_points(const Points &points, Point *start_near = nullptr);
|
|
|
|
|
2019-09-26 07:44:38 +00:00
|
|
|
std::vector<std::pair<size_t, bool>> chain_extrusion_entities(std::vector<ExtrusionEntity*> &entities, const Point *start_near = nullptr);
|
2019-09-27 11:26:58 +00:00
|
|
|
void reorder_extrusion_entities(std::vector<ExtrusionEntity*> &entities, const std::vector<std::pair<size_t, bool>> &chain);
|
2019-09-26 14:39:50 +00:00
|
|
|
void chain_and_reorder_extrusion_entities(std::vector<ExtrusionEntity*> &entities, const Point *start_near = nullptr);
|
|
|
|
|
2019-09-27 16:17:21 +00:00
|
|
|
std::vector<std::pair<size_t, bool>> chain_extrusion_paths(std::vector<ExtrusionPath> &extrusion_paths, const Point *start_near = nullptr);
|
|
|
|
void reorder_extrusion_paths(std::vector<ExtrusionPath> &extrusion_paths, std::vector<std::pair<size_t, bool>> &chain);
|
|
|
|
void chain_and_reorder_extrusion_paths(std::vector<ExtrusionPath> &extrusion_paths, const Point *start_near = nullptr);
|
|
|
|
|
2019-09-27 16:23:36 +00:00
|
|
|
Polylines chain_polylines(Polylines &&src, const Point *start_near = nullptr);
|
2019-09-27 17:07:07 +00:00
|
|
|
inline Polylines chain_polylines(const Polylines& src, const Point* start_near = nullptr) { Polylines tmp(src); return chain_polylines(std::move(tmp), start_near); }
|
2019-09-27 07:51:07 +00:00
|
|
|
|
2019-09-26 15:30:03 +00:00
|
|
|
std::vector<ClipperLib::PolyNode*> chain_clipper_polynodes(const Points &points, const std::vector<ClipperLib::PolyNode*> &items);
|
|
|
|
|
2019-09-26 14:39:50 +00:00
|
|
|
// Chain instances of print objects by an approximate shortest path.
|
|
|
|
// Returns pairs of PrintObject idx and instance of that PrintObject.
|
|
|
|
class Print;
|
|
|
|
std::vector<std::pair<size_t, size_t>> chain_print_object_instances(const Print &print);
|
|
|
|
|
2019-09-26 07:44:38 +00:00
|
|
|
|
|
|
|
} // namespace Slic3r
|
|
|
|
|
|
|
|
#endif /* slic3r_ShortestPath_hpp_ */
|